Skip to content

Commit 40574ed

Browse files
committed
fix(glsl): fix webgl1_frontLight_fragment.glsl->calcTotalLight
change to "totalLight += u_ambient * materialDiffuseRGB;" publish npm
1 parent 895b2e0 commit 40574ed

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wonder.js",
3-
"version": "1.1.0-alpha.12",
3+
"version": "1.1.0-alpha.13",
44
"authors": "Wonder",
55
"description": "3d webgl engine",
66
"homepage": "https://github.com/Wonder-Technology/Wonder.js",

src/glsl/ShaderChunkSystem.re

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ varying vec3 v_texCoord;
6060
|},{|
6161
6262
|}),{|
63-
//gl_FragColor = textureCube(u_skyboxCubeMapSampler, v_texCoord);
64-
vec3 dir = vec3(-v_texCoord.x, v_texCoord.y, v_texCoord.z);
65-
gl_FragColor = textureCube(u_skyboxCubeMapSampler, dir);
63+
gl_FragColor = textureCube(u_skyboxCubeMapSampler, vec3(-v_texCoord.x, v_texCoord.y, v_texCoord.z));
6664
|}))
6765

6866
|> set("webgl1_outline_origin_vertex", _buildChunk(({|
@@ -283,7 +281,7 @@ vec4 calcTotalLight(vec3 norm, vec3 viewDir){
283281
}
284282
#endif
285283
286-
totalLight += u_ambient;
284+
totalLight += u_ambient * materialDiffuseRGB;
287285
288286
return vec4(totalLight, alpha);
289287
}

src/glsl/light/front/webgl1_frontLight_fragment.glsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ vec4 calcTotalLight(vec3 norm, vec3 viewDir){
122122
}
123123
#endif
124124

125-
totalLight += u_ambient;
125+
totalLight += u_ambient * materialDiffuseRGB;
126126

127127
return vec4(totalLight, alpha);
128128
}

test/integration/no_worker/job/init/initLightMaterialJob_test.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ vec4 calcTotalLight(vec3 norm, vec3 viewDir){
966966
}
967967
#endif
968968
969-
totalLight += u_ambient;
969+
totalLight += u_ambient * materialDiffuseRGB;
970970
971971
return vec4(totalLight, alpha);
972972
}

0 commit comments

Comments
 (0)