File tree Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Expand file tree Collapse file tree 2 files changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -1838,7 +1838,7 @@ class RendererGL extends Renderer {
1838
1838
this . sphereMapping . setUniform ( "uFovY" , this . states . curCamera . cameraFOV ) ;
1839
1839
this . sphereMapping . setUniform ( "uAspect" , this . states . curCamera . aspectRatio ) ;
1840
1840
this . sphereMapping . setUniform ( "uNewNormalMatrix" , this . scratchMat3 . mat3 ) ;
1841
- this . sphereMapping . setUniform ( "uSampler " , img ) ;
1841
+ this . sphereMapping . setUniform ( "uEnvMap " , img ) ;
1842
1842
return this . sphereMapping ;
1843
1843
}
1844
1844
Original file line number Diff line number Diff line change 2
2
3
3
precision highp float ;
4
4
5
- uniform sampler2D uSampler ;
5
+ uniform sampler2D uEnvMap ;
6
6
uniform mat3 uNewNormalMatrix;
7
7
uniform float uFovY;
8
8
uniform float uAspect;
@@ -11,7 +11,6 @@ varying vec2 vTexCoord;
11
11
12
12
void main() {
13
13
float uFovX = uFovY * uAspect;
14
- vec4 newTexColor = texture2D (uSampler, vTexCoord);
15
14
float angleY = mix (uFovY/ 2.0 , - uFovY/ 2.0 , vTexCoord.y);
16
15
float angleX = mix (uFovX/ 2.0 , - uFovX/ 2.0 , vTexCoord.x);
17
16
vec3 rotatedNormal = vec3 ( angleX, angleY, 1.0 );
@@ -22,6 +21,6 @@ void main() {
22
21
vec2 suv;
23
22
suv.y = 0.5 + 0.5 * (- rotatedNormal.y);
24
23
suv.x = atan (rotatedNormal.z, rotatedNormal.x) / (2.0 * PI) + 0.5 ;
25
- newTexColor = texture2D (uSampler , suv.xy);
24
+ vec4 newTexColor = texture2D (uEnvMap , suv.xy);
26
25
gl_FragColor = newTexColor;
27
26
}
You can’t perform that action at this time.
0 commit comments