1
0

__shdBulbThreshold.fsh 348 B

123456789101112131415
  1. varying vec2 v_vTexcoord;
  2. varying vec4 v_vColour;
  3. uniform vec2 u_vThreshold;
  4. float Luminance(vec3 color)
  5. {
  6. return dot(color, vec3(0.2126, 0.7152, 0.0722));
  7. }
  8. void main()
  9. {
  10. gl_FragColor = v_vColour * texture2D(gm_BaseTexture, v_vTexcoord);
  11. gl_FragColor.rgb *= smoothstep(u_vThreshold.x, u_vThreshold.y, Luminance(gl_FragColor.rgb));
  12. }