Advertisement
Guest User

Pixel art fireball visualization shader

a guest
Dec 29th, 2016
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. varying vec2 v_vTexcoord;
  2.  
  3. uniform sampler2D texture_material_1;
  4. uniform vec2 texel_size;
  5.  
  6. void main() {
  7. float reaction_coordinate = texture2D(gm_BaseTexture, floor(v_vTexcoord / (texel_size * 2.0)) * (texel_size * 2.0)).w;
  8. gl_FragColor = vec4(mix(vec3(1.0, 0.58, 0.0), vec3(1.0, 0.7, 0.4), (((reaction_coordinate - 0.55) * 10.0 + 0.5) * 2.0)), reaction_coordinate);
  9. gl_FragColor.rgb = vec3(1.0, 0.2, 0.0);
  10. if (gl_FragColor.a > 0.37) gl_FragColor.rgb = vec3(1.0, 0.8, 0.0);
  11. if (gl_FragColor.a > 0.65) gl_FragColor.rgb = vec3(1.0, 1.0, 1.0);
  12. gl_FragColor.a = float(gl_FragColor.a > 0.1);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement