Explosion.h 726 B

1234567891011121314151617181920212223
  1. /*-----------------------------------------------------------.
  2. / Explosion /
  3. '-----------------------------------------------------------*/
  4. /*
  5. */
  6. float4 ExplosionPass( float4 colorInput, float2 tex )
  7. {
  8. // -- pseudo random number generator --
  9. float2 sine_cosine;
  10. sincos(dot(tex, float2(12.9898,78.233)),sine_cosine.x,sine_cosine.y);
  11. sine_cosine = sine_cosine * 43758.5453 + tex;
  12. float2 noise = frac(sine_cosine);
  13. tex = (-Explosion_Radius * pixel) + tex; //Slightly faster this way because it can be calculated while we calculate noise.
  14. colorInput.rgb = myTex2D(s0, (2.0 * Explosion_Radius * pixel) * noise + tex).rgb;
  15. return colorInput;
  16. }