No Description

offscreen.frag 392B

12345678910111213141516
  1. #version 450
  2. #extension GL_ARB_separate_shader_objects : enable
  3. #extension GL_ARB_shading_language_420pack : enable
  4. layout (location = 0) out float outFragColor;
  5. layout (location = 0) in vec4 inPos;
  6. layout (location = 1) in vec3 inLightPos;
  7. void main()
  8. {
  9. // Store distance to light as 32 bit float value
  10. vec3 lightVec = inPos.xyz - inLightPos;
  11. outFragColor = length(lightVec);
  12. }