|
@@ -5,7 +5,7 @@ export default /* glsl */`
|
|
|
|
|
|
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
#ifdef ENVMAP_TYPE_CUBE_UV
|
|
|
|
|
|
|
|
- vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
|
|
|
|
|
|
|
+ vec3 worldNormal = transformNormalByInverseViewMatrix( normal, viewMatrix );
|
|
|
|
|
|
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
|
|
|
|
|
|
|
@@ -28,7 +28,7 @@ export default /* glsl */`
|
|
|
// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.
|
|
// Mixing the reflection with the normal is more accurate and keeps rough objects from gathering light from behind their tangent plane.
|
|
|
reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
|
|
reflectVec = normalize( mix( reflectVec, normal, pow4( roughness ) ) );
|
|
|
|
|
|
|
|
- reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
|
|
|
|
|
|
|
+ reflectVec = transformDirectionByInverseViewMatrix( reflectVec, viewMatrix );
|
|
|
|
|
|
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
|
|
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
|
|
|
|
|
|