toolpaths_cog.fs 481 B

123456789101112131415161718192021
  1. #version 140
  2. const vec4 BLACK = vec4(vec3(0.1), 1.0);
  3. const vec4 WHITE = vec4(vec3(1.0), 1.0);
  4. const float emission_factor = 0.25;
  5. uniform vec3 world_center;
  6. // x = tainted, y = specular;
  7. in vec2 intensity;
  8. in vec3 world_position;
  9. out vec4 out_color;
  10. void main()
  11. {
  12. vec3 delta = world_position - world_center;
  13. vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
  14. out_color = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
  15. }