PPSSRResolve.bsl 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.position.xy, input.uv0, input.screenPos, 0);
  42. #else
  43. col.rgb = temporalResolve(
  44. gSceneDepth, gPointSampler, gSceneDepthTexelSize,
  45. gSceneColor, gLinearSampler, gSceneColorTexelSize,
  46. gPrevColor, gLinearSampler, gSceneColorTexelSize,
  47. gManualExposure, input.uv0, input.uv0, input.screenPos, 0);
  48. #endif
  49. col.a = gSceneColor.Sample(gLinearSampler, input.uv0).a;
  50. return col;
  51. }
  52. };
  53. };