PPSSRResolve.bsl 1.5 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. #define TEMPORAL_SMOOTH_NEIGHBORHOOD 0
  8. #define MSAA_COLOR 0
  9. #include "$ENGINE$\TemporalResolve.bslinc"
  10. technique PPSSRResolve
  11. {
  12. mixin PPBase;
  13. mixin PerCameraData;
  14. mixin TemporalResolve;
  15. code
  16. {
  17. [internal]
  18. cbuffer Input
  19. {
  20. float2 gSceneDepthTexelSize;
  21. float2 gSceneColorTexelSize;
  22. float gManualExposure;
  23. }
  24. #if MSAA
  25. Texture2DMS<float> gSceneDepth;
  26. #else
  27. Texture2D gSceneDepth;
  28. #endif
  29. Texture2D gSceneColor;
  30. Texture2D gPrevColor;
  31. SamplerState gPointSampler;
  32. SamplerState gLinearSampler;
  33. float4 fsmain(VStoFS input) : SV_Target0
  34. {
  35. float4 col;
  36. #if MSAA
  37. col.rgb = temporalResolve(
  38. gSceneDepth,
  39. gSceneColor, gLinearSampler, gSceneColorTexelSize,
  40. gPrevColor, gLinearSampler, gSceneColorTexelSize,
  41. gManualExposure, input.uv0, input.screenPos, 0);
  42. col.a = gSceneColor.Sample(gLinearSampler, input.uv0 * gSceneColorTexelSize).a;
  43. #else
  44. col.rgb = temporalResolve(
  45. gSceneDepth, gPointSampler, gSceneDepthTexelSize,
  46. gSceneColor, gLinearSampler, gSceneColorTexelSize,
  47. gPrevColor, gLinearSampler, gSceneColorTexelSize,
  48. gManualExposure, input.uv0, input.screenPos, 0);
  49. col.a = gSceneColor.Sample(gLinearSampler, input.uv0).a;
  50. #endif
  51. return col;
  52. }
  53. };
  54. };