]> git.tdb.fi Git - libs/gl.git/blob - builtin_data/_sky_transmittance.glsl
Add support for storage images in shaders
[libs/gl.git] / builtin_data / _sky_transmittance.glsl
1 import flat_effect;
2 import _sky;
3
4 #pragma MSP stage(fragment)
5 layout(location=0) out vec3 frag_color;
6 void main()
7 {
8         float height = texcoord.x*texcoord.x*atmosphere_thickness;
9         float z = texcoord.y;
10         float r = sqrt(1.0-z*z);
11         vec3 look_dir = vec3(r, 0.0, z);
12         frag_color = exp(-raymarch_path(height, look_dir).optical_depth);
13 }