PPSSRResolve.bsl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. #include "$ENGINE$\PPBase.bslinc"
  2. #include "$ENGINE$\GBufferInput.bslinc"
  3. #include "$ENGINE$\PerCameraData.bslinc"
  4. #define TEMPORAL_LOCAL_VELOCITY 0
  5. #define TEMPORAL_SEARCH_NEAREST 0
  6. #define TEMPORAL_BLEND_FACTOR 8
  7. #include "$ENGINE$\TemporalResolve.bslinc"
  8. technique PPSSRStencil
  9. {
  10. mixin PPBase;
  11. mixin PerCameraData;
  12. mixin TemporalResolve;
  13. code
  14. {
  15. [internal]
  16. cbuffer Input
  17. {
  18. float2 gSceneDepthTexelSize;
  19. float2 gSceneColorTexelSize;
  20. float gManualExposure;
  21. }
  22. #if MSAA
  23. Texture2DMS gSceneDepth;
  24. Texture2DMS gSceneColor;
  25. Texture2DMS gPrevColor;
  26. #else
  27. Texture2D gSceneDepth;
  28. Texture2D gSceneColor;
  29. Texture2D gPrevColor;
  30. SamplerState gPointSampler;
  31. SamplerState gLinearSampler;
  32. #endif
  33. #if EYE_ADAPTATION
  34. Texture2D gEyeAdaptationTex;
  35. #endif
  36. float3 fsmain(VStoFS input) : SV_Target0
  37. {
  38. float exposureScale;
  39. #if EYE_ADAPTATION
  40. exposureScale = gEyeAdaptationTex.Load(int3(0, 0, 0)).r;
  41. #else
  42. exposureScale = gManualExposure;
  43. #endif
  44. #if MSAA
  45. return temporalResolve(gSceneDepth, gSceneColor, gPrevColor,
  46. exposureScale, input.uv0, input.screenPos, 0);
  47. #else
  48. return temporalResolve(
  49. gSceneDepth, gPointSampler, gSceneDepthTexelSize,
  50. gSceneColor, gPointSampler, gSceneColorTexelSize,
  51. gPrevColor, gLinearSampler, gSceneColorTexelSize,
  52. exposureScale, input.uv0, input.screenPos, 0);
  53. #endif
  54. }
  55. };
  56. };