BloomExtract.fx 1.0 KB

123456789101112131415161718192021222324252627282930
  1. ///-------------------------------------------------------------------------------------------------
  2. /// <remarks>
  3. /// Charles Humphrey, 12/07/2025.
  4. /// Fixes for DX implementation.
  5. /// </remarks>
  6. ///-------------------------------------------------------------------------------------------------
  7. #include "PPVertexShader.fxh"
  8. sampler TextureSampler : register(s0);
  9. float BloomThreshold;
  10. ///-------------------------------------------------------------------------------------------------
  11. /// <summary> Function now uses correct vertex input structure for both OGL and DX </summary>
  12. ///
  13. /// <remarks> Charles Humphrey, 12/07/2025. </remarks>
  14. ///-------------------------------------------------------------------------------------------------
  15. float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
  16. {
  17. float4 c = tex2D(TextureSampler, input.TexCoord);
  18. return saturate((c - BloomThreshold) / (1 - BloomThreshold));
  19. }
  20. technique BloomExtract
  21. {
  22. pass Pass1
  23. {
  24. PixelShader = compile PS_SHADERMODEL PixelShaderFunction();
  25. }
  26. }