|
@@ -138,8 +138,6 @@ Sky.SkyShader = {
|
|
uniform float mieDirectionalG;
|
|
uniform float mieDirectionalG;
|
|
uniform vec3 up;
|
|
uniform vec3 up;
|
|
|
|
|
|
- const vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );
|
|
|
|
-
|
|
|
|
// constants for atmospheric scattering
|
|
// constants for atmospheric scattering
|
|
const float pi = 3.141592653589793238462643383279502884197169;
|
|
const float pi = 3.141592653589793238462643383279502884197169;
|
|
|
|
|
|
@@ -169,7 +167,7 @@ Sky.SkyShader = {
|
|
|
|
|
|
void main() {
|
|
void main() {
|
|
|
|
|
|
- vec3 direction = normalize( vWorldPosition - cameraPos );
|
|
|
|
|
|
+ vec3 direction = normalize( vWorldPosition - cameraPosition );
|
|
|
|
|
|
// optical length
|
|
// optical length
|
|
// cutoff angle at 90 to avoid singularity in next formula.
|
|
// cutoff angle at 90 to avoid singularity in next formula.
|