You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
732 B

  1. #version 450 core
  2. #pragma include ./shared.glsl
  3. #pragma include ../misc/glow.glsl
  4. #pragma include ../misc/global.glsl
  5. const GlowArgs GLOW_ARGS = {
  6. /* step0 */ 0.100,
  7. /* step1 */ 0.900,
  8. /* pulseSize0 */ 0.050,
  9. /* pulseSize1 */ 0.100,
  10. /* pulseTime */ 2.000,
  11. };
  12. in FragmentData fragmentData;
  13. flat in int textureId;
  14. uniform sampler2D uTexture[3];
  15. out vec4 outColor;
  16. void main() {
  17. float alpha = glow(GLOW_ARGS, fragmentData.texCoords, uGlobal.time);
  18. vec4 glow = vec4(fragmentData.color, GLOW_ALPHA * alpha);
  19. vec4 tex = texture(uTexture[textureId], 0.5 * GLOW_SIZE * fragmentData.texCoords + vec2(0.5));
  20. outColor = tex * tex.a + glow * (1.0 - tex.a);
  21. }