Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

30 lignes
784 B

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