2023-02-08 14:40:15 +01:00
|
|
|
#version 450
|
|
|
|
|
|
2023-02-21 14:06:58 +01:00
|
|
|
#include "std/math.glsl"
|
2023-02-08 14:40:15 +01:00
|
|
|
|
|
|
|
|
uniform sampler2D envmap;
|
2024-08-15 20:29:14 +02:00
|
|
|
uniform vec4 envmap_data_world; // angle, sin(angle), cos(angle), strength
|
2023-02-08 14:40:15 +01:00
|
|
|
|
|
|
|
|
in vec3 normal;
|
2024-08-15 20:29:14 +02:00
|
|
|
out vec4 frag_color;
|
2023-02-08 14:40:15 +01:00
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
|
vec3 n = normalize(normal);
|
2024-08-15 20:29:14 +02:00
|
|
|
frag_color.rgb = texture(envmap, envmap_equirect(-n, envmap_data_world.x)).rgb * envmap_data_world.w;
|
|
|
|
|
frag_color.a = 0.0; // Mark as non-opaque
|
2023-02-08 14:40:15 +01:00
|
|
|
}
|