|
@@ -42,8 +42,8 @@
|
|
|
rayleigh: 3,
|
|
|
mieCoefficient: 0.005,
|
|
|
mieDirectionalG: 0.7,
|
|
|
- inclination: 0.49, // elevation / inclination
|
|
|
- azimuth: 0.25, // Facing front,
|
|
|
+ inclination: 0.02, // elevation / inclination
|
|
|
+ azimuth: 0, // Facing front
|
|
|
exposure: renderer.toneMappingExposure
|
|
|
};
|
|
|
|
|
@@ -55,12 +55,12 @@
|
|
|
uniforms[ "mieCoefficient" ].value = effectController.mieCoefficient;
|
|
|
uniforms[ "mieDirectionalG" ].value = effectController.mieDirectionalG;
|
|
|
|
|
|
- const theta = Math.PI * ( effectController.inclination - 0.5 );
|
|
|
+ const theta = 0.5 * Math.PI * ( 1 - effectController.inclination );
|
|
|
const phi = 2 * Math.PI * ( effectController.azimuth - 0.5 );
|
|
|
|
|
|
- sun.x = Math.cos( phi );
|
|
|
- sun.y = Math.sin( phi ) * Math.sin( theta );
|
|
|
- sun.z = Math.sin( phi ) * Math.cos( theta );
|
|
|
+ sun.x = Math.sin( theta ) * Math.sin( phi );
|
|
|
+ sun.y = Math.cos( theta );
|
|
|
+ sun.z = Math.sin( theta ) * Math.cos( phi );
|
|
|
|
|
|
uniforms[ "sunPosition" ].value.copy( sun );
|
|
|
|
|
@@ -75,7 +75,7 @@
|
|
|
gui.add( effectController, "rayleigh", 0.0, 4, 0.001 ).onChange( guiChanged );
|
|
|
gui.add( effectController, "mieCoefficient", 0.0, 0.1, 0.001 ).onChange( guiChanged );
|
|
|
gui.add( effectController, "mieDirectionalG", 0.0, 1, 0.001 ).onChange( guiChanged );
|
|
|
- gui.add( effectController, "inclination", 0, 1, 0.0001 ).onChange( guiChanged );
|
|
|
+ gui.add( effectController, "inclination", -1, 1, 0.0001 ).onChange( guiChanged );
|
|
|
gui.add( effectController, "azimuth", 0, 1, 0.0001 ).onChange( guiChanged );
|
|
|
gui.add( effectController, "exposure", 0, 1, 0.0001 ).onChange( guiChanged );
|
|
|
|