Prechádzať zdrojové kódy

environment rotation in radians

Nicolas Cannasse 4 rokov pred
rodič
commit
17d2cd5f42
2 zmenil súbory, kde vykonal 2 pridanie a 3 odobranie
  1. 1 1
      h3d/scene/pbr/Environment.hx
  2. 1 2
      h3d/scene/pbr/Renderer.hx

+ 1 - 1
h3d/scene/pbr/Environment.hx

@@ -225,7 +225,7 @@ class Environment {
 	public var specular : h3d.mat.Texture;
 
 	public var power : Float = 1.;
-	public var rot : Float = 0.;
+	public var rotation : Float = 0.;
 
 	/*
 		Source can be cube map already prepared or a 2D equirectangular map that

+ 1 - 2
h3d/scene/pbr/Renderer.hx

@@ -367,8 +367,7 @@ class Renderer extends h3d.scene.Renderer {
 		if( env != null ) {
 			pbrIndirect.cameraPosition.load(ctx.camera.pos);
 			pbrIndirect.emissivePower = props.emissive * props.emissive;
-			var rot = hxd.Math.degToRad(env.rot);
-			pbrIndirect.irrRotation.set(Math.cos(rot), Math.sin(rot));
+			pbrIndirect.irrRotation.set(Math.cos(env.rotation), Math.sin(env.rotation));
 			pbrIndirect.irrPower = env.power * env.power;
 			pbrIndirect.irrLut = env.lut;
 			pbrIndirect.irrDiffuse = env.diffuse;