toolpaths_cog.fs 473 B

12345678910111213141516171819
  1. #version 110
  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. varying vec2 intensity;
  8. varying vec3 world_position;
  9. void main()
  10. {
  11. vec3 delta = world_position - world_center;
  12. vec4 color = delta.x * delta.y * delta.z > 0.0 ? BLACK : WHITE;
  13. gl_FragColor = vec4(vec3(intensity.y) + color.rgb * (intensity.x + emission_factor), 1.0);
  14. }