GammaCorrection.hlsl 580 B

12345678910111213141516171819202122
  1. #include "Uniforms.hlsl"
  2. #include "Transform.hlsl"
  3. #include "Samplers.hlsl"
  4. #include "ScreenPos.hlsl"
  5. #include "PostProcess.hlsl"
  6. void VS(float4 iPos : POSITION,
  7. out float4 oPos : POSITION,
  8. out float2 oScreenPos : TEXCOORD0)
  9. {
  10. float4x3 modelMatrix = iModelMatrix;
  11. float3 worldPos = GetWorldPos(modelMatrix);
  12. oPos = GetClipPos(worldPos);
  13. oScreenPos = GetScreenPosPreDiv(oPos);
  14. }
  15. void PS(float2 iScreenPos : TEXCOORD0,
  16. out float4 oColor : COLOR0)
  17. {
  18. float3 color = tex2D(sDiffMap, iScreenPos).rgb;
  19. oColor = float4(ToInverseGamma(color), 1.0);
  20. }