feat: gamma functionality on windows64
This commit is contained in:
6 files changed
+327
-6
No files matched your search
@@ -26,6 +26,11 @@ cbuffer cbuff : register(b4)
|
||||
float4 clearColour;
|
||||
};
|
||||
|
||||
cbuffer gammaBuff : register(b6)
|
||||
{
|
||||
float4 gammaParams;
|
||||
};
|
||||
|
||||
SamplerState screen_sampler_s : register(s0);
|
||||
Texture2D<float4> screen_texture : register(t0);
|
||||
|
||||
@@ -37,4 +42,12 @@ float4 PS_ScreenSpace(float4 position : SV_POSITION, float2 texcoord : TEXCOORD0
|
||||
float4 PS_ScreenClear(float4 position : SV_POSITION) : SV_TARGET
|
||||
{
|
||||
return clearColour;
|
||||
}
|
||||
|
||||
float4 PS_ScreenGamma(float4 position : SV_POSITION, float2 texcoord : TEXCOORD0) : SV_TARGET
|
||||
{
|
||||
float4 colour = screen_texture.Sample(screen_sampler_s, texcoord);
|
||||
float invGamma = gammaParams.x;
|
||||
colour.rgb = pow(saturate(colour.rgb), invGamma);
|
||||
return colour;
|
||||
}
|
||||
Reference in new issue
Block a user