Skip to content

Commit 05b2879

Browse files
committed
Merge remote-tracking branch 'alteredq/dev' into dev
2 parents 7602900 + fd0fb85 commit 05b2879

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

build/Three.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/custom/ThreeWebGL.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/webgl_materials.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
//materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) );
7878

7979
materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.SmoothShading } ) );
80-
materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading } ) );
80+
materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading, map: THREE.ImageUtils.loadTexture( "textures/planets/earth_specular_2048.jpg" ) } ) );
8181
materials.push( new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } ) );
8282
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) );
8383

src/renderers/WebGLShaders.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -391,21 +391,24 @@ THREE.ShaderChunk = {
391391

392392
"#endif",
393393

394-
"vec4 totalLight = vec4( ambient, opacity );",
394+
"vec4 totalDiffuse = vec4( vec3( 0.0 ), opacity );",
395+
"vec4 totalSpecular = vec4( ambient, opacity );",
395396

396397
"#if MAX_DIR_LIGHTS > 0",
397398

398-
"totalLight += dirDiffuse + dirSpecular;",
399+
"totalDiffuse += dirDiffuse;",
400+
"totalSpecular += dirSpecular;",
399401

400402
"#endif",
401403

402404
"#if MAX_POINT_LIGHTS > 0",
403405

404-
"totalLight += pointDiffuse + pointSpecular;",
406+
"totalDiffuse += pointDiffuse;",
407+
"totalSpecular += pointSpecular;",
405408

406409
"#endif",
407410

408-
"gl_FragColor = gl_FragColor * totalLight;"
411+
"gl_FragColor = gl_FragColor * totalDiffuse + totalSpecular;"
409412

410413
].join("\n"),
411414

0 commit comments

Comments
 (0)