disappear.fsh 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. uniform sampler2D TextureSampler;
  2. uniform sampler2D OverlaySampler;
  3. uniform vec2 OverlayScroll;
  4. void main()
  5. {
  6. vec4 tex = gl_Color * texture2D(TextureSampler, gl_TexCoord[0].xy);
  7. vec4 tex2 = gl_Color * texture2D(OverlaySampler, OverlayScroll + gl_TexCoord[0].xy);
  8. float fadeSpeed = tex2.x; //texture2D(OverlaySampler, OverlayScroll + gl_TexCoord[1].xy).x;
  9. vec4 color = tex;
  10. color *= clamp((tex.a - fadeSpeed) * 2.5 + 1.0,0.0,1.0);
  11. gl_FragColor = color; //gl_Color * tex; //texture2D(TextureSampler, gl_TexCoord[0].xy);
  12. }
  13. //float2 OverlayScroll;
  14. //sampler TextureSampler : register(s0);
  15. //sampler OverlaySampler : register(s1);
  16. //float4 main(float4 color : COLOR0, float2 texCoord : TEXCOORD0) : COLOR0
  17. //{
  18. //// Look up the texture color.
  19. //float4 tex = tex2D(TextureSampler, texCoord);
  20. // Look up the fade speed from the scrolling overlay texture.
  21. //float fadeSpeed = tex2D(OverlaySampler, OverlayScroll + texCoord).x;
  22. // Apply a combination of the input color alpha and the fade speed.
  23. //tex *= saturate((color.a - fadeSpeed) * 2.5 + 1);
  24. //return tex;
  25. //}