Skip to content

Commit

Permalink
Use cameraPosition uniform instead of world origin (mrdoob#26766)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrandedKitty authored Sep 18, 2023
1 parent 217e20e commit 0b0a7d7
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions examples/jsm/objects/Sky.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,6 @@ Sky.SkyShader = {
uniform float mieDirectionalG;
uniform vec3 up;
const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );
// constants for atmospheric scattering
const float pi = 3.141592653589793238462643383279502884197169;
Expand Down Expand Up @@ -169,7 +167,7 @@ Sky.SkyShader = {
void main() {
vec3 direction = normalize( vWorldPosition - cameraPos );
vec3 direction = normalize( vWorldPosition - cameraPosition );
// optical length
// cutoff angle at 90 to avoid singularity in next formula.
Expand Down

0 comments on commit 0b0a7d7

Please sign in to comment.