Ver código fonte

Opti alloc for pbr.Decal

ShiroSmith 4 anos atrás
pai
commit
6e4e7f0b12
1 arquivos alterados com 3 adições e 2 exclusões
  1. 3 2
      h3d/scene/pbr/Decal.hx

+ 3 - 2
h3d/scene/pbr/Decal.hx

@@ -15,8 +15,9 @@ class Decal extends Mesh {
 	}
 	}
 
 
 	function syncDecalPBR( shader : h3d.shader.pbr.VolumeDecal.DecalPBR ) {
 	function syncDecalPBR( shader : h3d.shader.pbr.VolumeDecal.DecalPBR ) {
-		shader.normal = getAbsPos().up();
-		shader.tangent = getAbsPos().right();
+		var absPos = getAbsPos();
+		shader.normal.set(absPos._31, absPos._32, absPos._33); // up
+		shader.tangent.set(absPos._21, absPos._22, absPos._23); // right
 	}
 	}