Skip to content

Commit 4d602ce

Browse files
committed
rayleigh: fix fast shader
1 parent b835085 commit 4d602ce

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

data/shaders/opengl/rayleigh_fast.shaderdef

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
Shader rayleigh_fast
55

6+
Texture sampler2D scatterLUT
7+
68
Buffer LightData binding=0
79
Buffer DrawData binding=1
810
Buffer BaseSphereData binding=2

data/shaders/opengl/rayleigh_fast.vert

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "rayleigh.glsl"
88

99
uniform int NumShadows;
10+
uniform sampler2D scatterLUT;
1011

1112
out vec4 varyingEyepos;
1213
out vec4 vertexColor;
@@ -41,7 +42,7 @@ void main(void)
4142
vec3 lightPosAU = uLight[i].position.xyz / AU;
4243
float intensity = 1.f / dot(lightPosAU, lightPosAU); // magic to avoid calculating length and then squaring it
4344

44-
specularHighlight += calculateAtmosphereColor(planet, atmosphere, toLinear(uLight[i].diffuse), lightDir, vec3(0.0), eyenorm, uneclipsed) * intensity;
45+
specularHighlight += calculateAtmosphereColor(planet, atmosphere, toLinear(uLight[i].diffuse), lightDir, vec3(0.0), eyenorm, uneclipsed, scatterLUT) * intensity;
4546

4647
}
4748
#endif

0 commit comments

Comments
 (0)