浏览代码

fixed samples ambientLight (close #988)

Nicolas Cannasse 4 年之前
父节点
当前提交
0d6fea6a0e

+ 1 - 1
samples/Base3D.hx

@@ -50,7 +50,7 @@ class Base3D extends SampleApp {
 		light.enableSpecular = true;
 
 		// set the ambient light to 30%
-		s3d.lightSystem.ambientLight.set(0.3, 0.3, 0.3);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.3, 0.3, 0.3);
 
 		// disable shadows
 		obj1.material.shadows = false;

+ 1 - 1
samples/CubeTexture.hx

@@ -36,7 +36,7 @@ class CubeTexture extends hxd.App {
 		pt.enableSpecular = true;
 		pt.params.set(0, 1, 0);
 
-		s3d.lightSystem.ambientLight.set(0.1, 0.1, 0.1);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.1, 0.1, 0.1);
 
 		new h3d.scene.CameraController(5, s3d).loadFromCamera();
 

+ 1 - 1
samples/Helpers.hx

@@ -29,7 +29,7 @@ class Helpers extends hxd.App {
 
 		new AxesHelper( cube, 1 );
 
-		s3d.lightSystem.ambientLight.set( 0.3, 0.3, 0.3 );
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set( 0.3, 0.3, 0.3 );
 
 		var dirLight = new DirLight( new Vector( 0.5, 0.5, -0.5 ), s3d );
 		dirLight.enableSpecular = true;

+ 1 - 1
samples/Interactive.hx

@@ -48,7 +48,7 @@ class Interactive extends SampleApp {
 		light.enableSpecular = true;
 		light.color.set(0.28, 0.28, 0.28);
 
-		s3d.lightSystem.ambientLight.set(0.74, 0.74, 0.74);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.74, 0.74, 0.74);
 
 		rnd = new hxd.Rand(5);
 		for(i in 0...8) {

+ 1 - 1
samples/MeshBatch.hx

@@ -38,7 +38,7 @@ class MeshBatch extends hxd.App {
 		var cube = new h3d.prim.Cube(1,1,1,true);
 		cube.unindex();
 		cube.addNormals();
-		s3d.lightSystem.ambientLight.set(0.5,0.5,0.5);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.5,0.5,0.5);
 		batch = new h3d.scene.MeshBatch(cube,s3d);
 		meshes = [];
 		new h3d.scene.CameraController(20,s3d);

+ 1 - 1
samples/PointLights.hx

@@ -47,7 +47,7 @@ class PointLights extends hxd.App {
 		dir = new h3d.scene.fwd.DirLight(new h3d.Vector(0.2, 0.3, -1), s3d);
 		dir.color.set(0.1, 0.1, 0.1);
 
-		s3d.lightSystem.ambientLight.set(0, 0, 0);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0, 0, 0);
 
 		s3d.camera.pos.set(5, 1, 3);
 		new h3d.scene.CameraController(s3d).loadFromCamera();

+ 1 - 1
samples/Polygons.hx

@@ -101,7 +101,7 @@ class Polygons extends hxd.App {
 
 		// Lights
 		var light = new h3d.scene.fwd.DirLight(new h3d.Vector( 0.3, -0.4, -0.9), s3d);
-		s3d.lightSystem.ambientLight.setColor(0x909090);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.setColor(0x909090);
 
 		shadow = s3d.renderer.getPass(h3d.pass.DefaultShadowMap);
 		shadow.size = 2048;

+ 1 - 1
samples/Sao.hx

@@ -98,7 +98,7 @@ class Sao extends SampleApp {
 		s3d.camera.zNear = 0.1 * wscale;
 		s3d.camera.zFar = 150 * wscale;
 
-		s3d.lightSystem.ambientLight.set(0.5, 0.5, 0.5);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.5, 0.5, 0.5);
 		var dir = new h3d.scene.fwd.DirLight(new h3d.Vector( -0.3, -0.2, -1), s3d);
 		dir.color.set(0.5, 0.5, 0.5);
 

+ 1 - 1
samples/Shadows.hx

@@ -32,7 +32,7 @@ class Shadows extends SampleApp {
 		}
 		s3d.camera.zNear = 6;
 		s3d.camera.zFar = 30;
-		s3d.lightSystem.ambientLight.set(0.5, 0.5, 0.5);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.5, 0.5, 0.5);
 
 		dir = new h3d.scene.fwd.DirLight(new h3d.Vector(-0.3, -0.2, -1), s3d);
 		dir.enableSpecular = true;

+ 1 - 1
samples/Skin.hx

@@ -24,7 +24,7 @@ class Skin extends SampleApp {
 			m.mainPass.culling = None;
 			m.getPass("shadow").culling = None;
 		}
-		s3d.lightSystem.ambientLight.set(0.4, 0.4, 0.4);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.4, 0.4, 0.4);
 
 		var shadow = s3d.renderer.getPass(h3d.pass.DefaultShadowMap);
 		shadow.power = 20;

+ 1 - 1
samples/Stencil.hx

@@ -56,7 +56,7 @@ class Stencil extends hxd.App {
 		// adds a directional light to the scene
 		var light = new h3d.scene.fwd.DirLight(new h3d.Vector(-0.5, -0.5, -0.5), s3d);
 		light.enableSpecular = true;
-		s3d.lightSystem.ambientLight.set(0.3, 0.3, 0.3);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.set(0.3, 0.3, 0.3);
 
 		s3d.camera.pos.set(5, 5, 5);
 	}

+ 1 - 1
samples/World.hx

@@ -34,7 +34,7 @@ class World extends hxd.App {
 
 		//
 		new h3d.scene.fwd.DirLight(new h3d.Vector( 0.3, -0.4, -0.9), s3d);
-		s3d.lightSystem.ambientLight.setColor(0x909090);
+		cast(s3d.lightSystem,h3d.scene.fwd.LightSystem).ambientLight.setColor(0x909090);
 
 		s3d.camera.target.set(72, 72, 0);
 		s3d.camera.pos.set(120, 120, 40);