Guest User

motion blur - fixed function

a guest
Mar 28th, 2013
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. Motion Blur
  4. Authors: hunterk, cgwg
  5.  
  6. This program is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published by the Free
  8. Software Foundation; either version 2 of the License, or (at your option)
  9. any later version.
  10. -->
  11. <shader language="GLSL">
  12. <vertex><![CDATA[
  13.  
  14. void main()
  15. {
  16. gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
  17. gl_TexCoord[0].xy = gl_MultiTexCoord0.xy;
  18. }
  19. ]]></vertex>
  20. <fragment><![CDATA[
  21. uniform sampler2D rubyTexture;
  22. uniform sampler2D rubyPrev6Texture;
  23. uniform sampler2D rubyPrev5Texture;
  24. uniform sampler2D rubyPrev4Texture;
  25. uniform sampler2D rubyPrev3Texture;
  26. uniform sampler2D rubyPrev2Texture;
  27. uniform sampler2D rubyPrev1Texture;
  28. uniform sampler2D rubyPrevTexture;
  29.  
  30. void main()
  31. {
  32. vec4 color = texture2D(rubyPrev6Texture, gl_TexCoord[0].xy);
  33. color = (color + texture2D(rubyPrev5Texture, gl_TexCoord[0].xy)) / 2.0;
  34. color = (color + texture2D(rubyPrev4Texture, gl_TexCoord[0].xy)) / 2.0;
  35. color = (color + texture2D(rubyPrev3Texture, gl_TexCoord[0].xy)) / 2.0;
  36. color = (color + texture2D(rubyPrev2Texture, gl_TexCoord[0].xy)) / 2.0;
  37. color = (color + texture2D(rubyPrev1Texture, gl_TexCoord[0].xy)) / 2.0;
  38. color = (color + texture2D(rubyPrevTexture, gl_TexCoord[0].xy)) / 2.0;
  39. color = (color + texture2D(rubyTexture, gl_TexCoord[0].xy)) / 2.0;
  40.  
  41. gl_FragColor = color;
  42. }
  43. ]]></fragment>
  44. </shader>
Advertisement
Add Comment
Please, Sign In to add comment