toolpaths_cog.fs 497 B

123456789101112131415161718192021
  1. #version 100
  2. precision highp float;
  3. const vec4 BLACK = vec4(vec3(0.1), 1.0);
  4. const vec4 WHITE = vec4(vec3(1.0), 1.0);
  5. const float emission_factor = 0.25;
  6. uniform vec3 world_center;
  7. // x = tainted, y = specular;
  8. varying vec2 intensity;
  9. varying vec3 world_position;
  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. gl_FragColor = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
  15. }