本文整理汇总了Java中com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight类的典型用法代码示例。如果您正苦于以下问题:Java DirectionalShadowLight类的具体用法?Java DirectionalShadowLight怎么用?Java DirectionalShadowLight使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DirectionalShadowLight类属于com.badlogic.gdx.graphics.g3d.environment包,在下文中一共展示了DirectionalShadowLight类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: dispose
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
@Override
public void dispose () {
world.dispose();
world = null;
for (Disposable disposable : disposables)
disposable.dispose();
disposables.clear();
modelBatch.dispose();
modelBatch = null;
shadowBatch.dispose();
shadowBatch = null;
if (shadows)
((DirectionalShadowLight)light).dispose();
light = null;
super.dispose();
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:22,代码来源:BaseBulletTest.java
示例2: setEnvironmentLights
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
public void setEnvironmentLights(Array<BaseLight<?>> lights, Vector3 sunDirection) {
environment = new Environment();
environment.add((shadowLight = new DirectionalShadowLight(
GameSettings.SHADOW_MAP_WIDTH,
GameSettings.SHADOW_MAP_HEIGHT,
GameSettings.SHADOW_VIEWPORT_WIDTH,
GameSettings.SHADOW_VIEWPORT_HEIGHT,
GameSettings.SHADOW_NEAR,
GameSettings.SHADOW_FAR))
.set(GameSettings.SHADOW_INTENSITY,
GameSettings.SHADOW_INTENSITY,
GameSettings.SHADOW_INTENSITY,
sunDirection.nor()));
environment.shadowMap = shadowLight;
float ambientLight = GameSettings.SCENE_AMBIENT_LIGHT;
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, ambientLight, ambientLight, ambientLight, 1));
for (BaseLight<?> light : lights) {
environment.add(light);
}
}
开发者ID:jsjolund,项目名称:GdxDemo3D,代码行数:22,代码来源:GameRenderer.java
示例3: dispose
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
@Override
public void dispose () {
world.dispose();
world = null;
for (Disposable disposable : disposables)
disposable.dispose();
disposables.clear();
modelBatch.dispose();
modelBatch = null;
shadowBatch.dispose();
shadowBatch = null;
if (shadows) ((DirectionalShadowLight)light).dispose();
light = null;
}
开发者ID:libgdx,项目名称:gdx-ai,代码行数:19,代码来源:BulletSteeringTest.java
示例4: renderWorld
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
protected void renderWorld () {
if (shadows) {
((DirectionalShadowLight)light).begin(Vector3.Zero, camera.direction);
shadowBatch.begin(((DirectionalShadowLight)light).getCamera());
world.render(shadowBatch, null);
shadowBatch.end();
((DirectionalShadowLight)light).end();
}
modelBatch.begin(camera);
world.render(modelBatch, environment);
modelBatch.end();
}
开发者ID:Matsemann,项目名称:eamaster,代码行数:14,代码来源:BaseBulletTest.java
示例5: configureEnvironments
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
/**
* Configures the lighting and attributes for the environments *
*/
private void configureEnvironments() {
mEnvironment.set(new CubemapAttribute(CubemapAttribute.EnvironmentMap, AssetHandler.getInstance().getCubeMap()),
new ColorAttribute(ColorAttribute.AmbientLight, 0.5f, 0.5f, 0.5f, 0.5f));
mEnvironment.add((mShadowLight = new DirectionalShadowLight(4096, 4096, 60f, 60f, .1f, 50f)).set(0.5f, 0.5f, 0.5f,
mLightDirection.x, mLightDirection.y, mLightDirection.z));
mEnvironment.shadowMap = mShadowLight;
mBackgroundEnvironment.set(new ColorAttribute(ColorAttribute.AmbientLight, 1.0f, 1.0f, 1.0f, 1f));
}
开发者ID:nkarasch,项目名称:ChessGDX,代码行数:14,代码来源:PerspectiveRenderer.java
示例6: create
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
@Override
public void create () {
modelBatch = new ModelBatch();
environment = new Environment();
environment.set(new ColorAttribute(ColorAttribute.AmbientLight, .4f, .4f, .4f, 1f));
environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));
environment.add((shadowLight = new DirectionalShadowLight(1024, 1024, 30f, 30f, 1f, 100f)).set(0.8f, 0.8f, 0.8f, -1f, -.8f,
-.2f));
environment.shadowMap = shadowLight;
cam = new PerspectiveCamera(67, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
cam.position.set(0f, 7f, 10f);
cam.lookAt(0, 0, 0);
cam.near = 1f;
cam.far = 50f;
cam.update();
ModelBuilder modelBuilder = new ModelBuilder();
modelBuilder.begin();
MeshPartBuilder mpb = modelBuilder.part("parts", GL20.GL_TRIANGLES, Usage.Position | Usage.Normal | Usage.Color,
new Material(ColorAttribute.createDiffuse(Color.WHITE)));
mpb.setColor(1f, 1f, 1f, 1f);
mpb.box(0, -1.5f, 0, 10, 1, 10);
mpb.setColor(1f, 0f, 1f, 1f);
mpb.sphere(2f, 2f, 2f, 10, 10);
model = modelBuilder.end();
instance = new ModelInstance(model);
shadowBatch = new ModelBatch(new DepthShaderProvider());
Gdx.input.setInputProcessor(camController = new CameraInputController(cam));
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:33,代码来源:ShadowMappingTest.java
示例7: create
import com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight; //导入依赖的package包/类
@Override
public void create () {
super.create();
lights = new Environment();
lights.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.4f, 0.4f, 0.4f, 1.f));
lights.add((shadowLight = new DirectionalShadowLight(1024, 1024, 30f, 30f, 1f, 100f))
.set(0.8f, 0.8f, 0.8f, -.4f, -.4f, -.4f));
lights.shadowMap = shadowLight;
inputController.rotateLeftKey = inputController.rotateRightKey = inputController.forwardKey = inputController.backwardKey = 0;
cam.position.set(25, 25, 25);
cam.lookAt(0, 0, 0);
cam.update();
modelsWindow.setVisible(false);
assets.load("data/g3d/skydome.g3db", Model.class);
assets.load("data/g3d/concrete.png", Texture.class);
assets.load("data/tree.png", Texture.class);
loading = true;
trForward.translation.set(0, 0, 8f);
trBackward.translation.set(0, 0, -8f);
trLeft.rotation.setFromAxis(Vector3.Y, 90);
trRight.rotation.setFromAxis(Vector3.Y, -90);
ModelBuilder builder = new ModelBuilder();
builder.begin();
builder.node().id = "floor";
MeshPartBuilder part = builder.part("floor", GL20.GL_TRIANGLES, Usage.Position | Usage.TextureCoordinates | Usage.Normal,
new Material("concrete"));
((MeshBuilder)part).ensureRectangles(1600);
for (float x = -200f; x < 200f; x += 10f) {
for (float z = -200f; z < 200f; z += 10f) {
part.rect(x, 0, z + 10f, x + 10f, 0, z + 10f, x + 10f, 0, z, x, 0, z, 0, 1, 0);
}
}
builder.node().id = "tree";
part = builder.part("tree", GL20.GL_TRIANGLES, Usage.Position | Usage.TextureCoordinates | Usage.Normal,
new Material("tree"));
part.rect( 0f, 0f, -10f, 10f, 0f, -10f, 10f, 10f, -10f, 0f, 10f, -10f, 0, 0, 1f);
part.setUVRange(1, 0, 0, 1);
part.rect(10f, 0f, -10f, 0f, 0f, -10f, 0f, 10f, -10f, 10f, 10f, -10f, 0, 0, -1f);
floorModel = builder.end();
shadowBatch = new ModelBatch(new DepthShaderProvider());
}
开发者ID:basherone,项目名称:libgdxcn,代码行数:44,代码来源:Animation3DTest.java
注:本文中的com.badlogic.gdx.graphics.g3d.environment.DirectionalShadowLight类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论