2
0
Эх сурвалжийг харах

Fix for specular component of Phong and normal map materials. Hope so.

Thanks to @fazeaction for spotting this.
alteredq 14 жил өмнө
parent
commit
256f9a671a

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
build/Three.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
build/custom/ThreeExtras.js


Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 0 - 0
build/custom/ThreeWebGL.js


+ 1 - 1
examples/webgl_geometry_large_mesh.html

@@ -142,7 +142,7 @@
 
 				if ( render_gl ) {
 					try {
-						webglRenderer = new THREE.WebGLRenderer();
+						webglRenderer = new THREE.WebGLRenderer( { antialias: true } );
 						webglRenderer.setSize( SCREEN_WIDTH, SCREEN_HEIGHT );
 						webglRenderer.domElement.style.position = "relative";
 						container.appendChild( webglRenderer.domElement );

+ 2 - 2
src/extras/ShaderUtils.js

@@ -202,7 +202,7 @@ THREE.ShaderUtils = {
 						"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
 
 							"vec3 pointVector = normalize( vPointLight[ i ].xyz );",
-							"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + vViewPosition );",
+							"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
 							"float pointDistance = vPointLight[ i ].w;",
 
 							"float pointDotNormalHalf = dot( normal, pointHalfVector );",
@@ -229,7 +229,7 @@ THREE.ShaderUtils = {
 							"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
 
 							"vec3 dirVector = normalize( lDirection.xyz );",
-							"vec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );",
+							"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
 
 							"float dirDotNormalHalf = dot( normal, dirHalfVector );",
 							"float dirDiffuseWeight = max( dot( normal, dirVector ), 0.0 );",

+ 2 - 2
src/renderers/WebGLShaders.js

@@ -336,7 +336,7 @@ THREE.ShaderChunk = {
 		"for ( int i = 0; i < MAX_POINT_LIGHTS; i ++ ) {",
 
 			"vec3 pointVector = normalize( vPointLight[ i ].xyz );",
-			"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + vViewPosition );",
+			"vec3 pointHalfVector = normalize( vPointLight[ i ].xyz + viewPosition );",
 			"float pointDistance = vPointLight[ i ].w;",
 
 			"float pointDotNormalHalf = dot( normal, pointHalfVector );",
@@ -364,7 +364,7 @@ THREE.ShaderChunk = {
 			"vec4 lDirection = viewMatrix * vec4( directionalLightDirection[ i ], 0.0 );",
 
 			"vec3 dirVector = normalize( lDirection.xyz );",
-			"vec3 dirHalfVector = normalize( lDirection.xyz + vViewPosition );",
+			"vec3 dirHalfVector = normalize( lDirection.xyz + viewPosition );",
 
 			"float dirDotNormalHalf = dot( normal, dirHalfVector );",
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно