Skip to content

Commit afe765a

Browse files
committed
Fix component properties
1 parent 6abeb84 commit afe765a

1 file changed

Lines changed: 19 additions & 13 deletions

File tree

src/renderer/webgl/pipelines/MeshPipeline.js

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ var MeshPipeline = new Class({
9999

100100
this.dirtyCache = [
101101
-1,
102-
0,
103-
0, 0, 0,
104-
0, 0, 0,
105-
0, 0, 0,
106-
0
102+
-1,
103+
-1, -1, -1,
104+
-1, -1, -1,
105+
-1, -1, -1,
106+
-1
107107
];
108108
},
109109

@@ -165,24 +165,30 @@ var MeshPipeline = new Class({
165165
this.set3f('uLightPosition', light.x, light.y, light.z);
166166
}
167167

168-
if (light.ambient.dirty)
168+
var ambient = light.ambient;
169+
var diffuse = light.diffuse;
170+
var specular = light.specular;
171+
172+
if (ambient.dirty)
169173
{
170-
this.set3f('uLightAmbient', light.ambient.x, light.ambient.y, light.ambient.z);
174+
this.set3f('uLightAmbient', ambient.r, ambient.g, ambient.b);
171175
}
172176

173-
if (light.diffuse.dirty)
177+
if (diffuse.dirty)
174178
{
175-
this.set3f('uLightDiffuse', light.diffuse.x, light.diffuse.y, light.diffuse.z);
179+
this.set3f('uLightDiffuse', diffuse.r, diffuse.g, diffuse.b);
176180
}
177181

178-
if (light.specular.dirty)
182+
if (specular.dirty)
179183
{
180-
this.set3f('uLightSpecular', light.specular.x, light.specular.y, light.specular.z);
184+
this.set3f('uLightSpecular', specular.r, specular.g, specular.b);
181185
}
182186

183-
if (mesh.fogColor.dirty)
187+
var fogColor = mesh.fogColor;
188+
189+
if (fogColor.dirty)
184190
{
185-
this.set3f('uFogColor', mesh.fogColor.r, mesh.fogColor.g, mesh.fogColor.b);
191+
this.set3f('uFogColor', fogColor.r, fogColor.g, fogColor.b);
186192
}
187193

188194
var cache = this.dirtyCache;

0 commit comments

Comments
 (0)