2022-03-21 12:10:47 +00:00
|
|
|
#version 140
|
|
|
|
|
|
|
|
const vec4 BLACK = vec4(vec3(0.1), 1.0);
|
|
|
|
const vec4 WHITE = vec4(vec3(1.0), 1.0);
|
|
|
|
|
|
|
|
const float emission_factor = 0.25;
|
|
|
|
|
|
|
|
uniform vec3 world_center;
|
|
|
|
|
|
|
|
// x = tainted, y = specular;
|
|
|
|
in vec2 intensity;
|
|
|
|
in vec3 world_position;
|
|
|
|
|
2022-03-24 13:45:59 +00:00
|
|
|
out vec4 out_color;
|
|
|
|
|
2022-03-21 12:10:47 +00:00
|
|
|
void main()
|
|
|
|
{
|
|
|
|
vec3 delta = world_position - world_center;
|
|
|
|
vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
|
2022-03-24 13:45:59 +00:00
|
|
|
out_color = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
|
2022-03-21 12:10:47 +00:00
|
|
|
}
|