Skip to content

Commit

Permalink
Merge remote-tracking branch 'alteredq/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Sep 21, 2011
2 parents 7602900 + fd0fb85 commit 05b2879
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build/Three.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/custom/ThreeWebGL.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/webgl_materials.html
Expand Up @@ -77,7 +77,7 @@
//materials.push( new THREE.MeshBasicMaterial( { color: 0xff0000, blending: THREE.SubtractiveBlending } ) );

materials.push( new THREE.MeshLambertMaterial( { color: 0xdddddd, shading: THREE.SmoothShading } ) );
materials.push( new THREE.MeshPhongMaterial( { ambient: 0x030303, color: 0xdddddd, specular: 0x009900, shininess: 30, shading: THREE.SmoothShading } ) );
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" ) } ) );
materials.push( new THREE.MeshNormalMaterial( { shading: THREE.SmoothShading } ) );
materials.push( new THREE.MeshBasicMaterial( { color: 0xffaa00, wireframe: true } ) );

Expand Down
11 changes: 7 additions & 4 deletions src/renderers/WebGLShaders.js
Expand Up @@ -391,21 +391,24 @@ THREE.ShaderChunk = {

"#endif",

"vec4 totalLight = vec4( ambient, opacity );",
"vec4 totalDiffuse = vec4( vec3( 0.0 ), opacity );",
"vec4 totalSpecular = vec4( ambient, opacity );",

"#if MAX_DIR_LIGHTS > 0",

"totalLight += dirDiffuse + dirSpecular;",
"totalDiffuse += dirDiffuse;",
"totalSpecular += dirSpecular;",

"#endif",

"#if MAX_POINT_LIGHTS > 0",

"totalLight += pointDiffuse + pointSpecular;",
"totalDiffuse += pointDiffuse;",
"totalSpecular += pointSpecular;",

"#endif",

"gl_FragColor = gl_FragColor * totalLight;"
"gl_FragColor = gl_FragColor * totalDiffuse + totalSpecular;"

].join("\n"),

Expand Down

0 comments on commit 05b2879

Please sign in to comment.