Skip to content

Commit 0b0a7d7

Browse files
Use cameraPosition uniform instead of world origin (#26766)
1 parent 217e20e commit 0b0a7d7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Diff for: examples/jsm/objects/Sky.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,6 @@ Sky.SkyShader = {
138138
uniform float mieDirectionalG;
139139
uniform vec3 up;
140140
141-
const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );
142-
143141
// constants for atmospheric scattering
144142
const float pi = 3.141592653589793238462643383279502884197169;
145143
@@ -169,7 +167,7 @@ Sky.SkyShader = {
169167
170168
void main() {
171169
172-
vec3 direction = normalize( vWorldPosition - cameraPos );
170+
vec3 direction = normalize( vWorldPosition - cameraPosition );
173171
174172
// optical length
175173
// cutoff angle at 90 to avoid singularity in next formula.

0 commit comments

Comments
 (0)