PostFX_Distortion.scrapeh 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //////////////////////////////////////////////////////////////////////////////
  2. // ©2007 Electronic Arts Inc
  3. //
  4. // Scrape script for distortion post effect
  5. //////////////////////////////////////////////////////////////////////////////
  6. #ifndef SCRAPE_SCRIPT_POSTFX_DISTORTION_SCRAPEH
  7. #define SCRAPE_SCRIPT_POSTFX_DISTORTION_SCRAPEH
  8. //
  9. // Distortion
  10. //
  11. var texture DistortionOffsetTexture $PostEffect.FrameBufferSize.x $PostEffect.FrameBufferSize.y A8R8G8B8
  12. var shader PostEffectDistortionShader PostFX_Distortion.fx
  13. proc PostEffectDistortion
  14. if PostEffect Distortion.IsEnabled
  15. beginevent UpdatePostFXDistortion
  16. callproc copyFrameBufferToTexture
  17. setclearcolor 0.5 0.5 1 1
  18. clearcolor // leave z unchanged!
  19. renderbin Distorter
  20. renderbin Distorter BinCommand_RenderParticles
  21. renderDistortionLasers
  22. //TODO: renderDistortionStreams
  23. #if defined(EA_PLATFORM_XENON)
  24. resolve DistortionOffsetTexture
  25. #else
  26. if WW3D IsUsingFrameRenderTarget
  27. stretchrect FrameRenderTarget DistortionOffsetTexture
  28. else
  29. stretchrect FrameBuffer DistortionOffsetTexture
  30. endif
  31. #endif
  32. settexture PostEffect FrameBufferTexture PostEffectFrameBufferTexture
  33. settexture PostEffect Distortion.DistortionOffsetTexture DistortionOffsetTexture
  34. setshader PostEffectDistortionShader
  35. renderquad
  36. endevent UpdatePostFXDistortion
  37. endif
  38. endproc
  39. #endif // SCRAPE_SCRIPT_POSTFX_DISTORTION_SCRAPEH