Merge branch 'master' into vulkan
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
Texture2D<float4> xe_texture : register(t0);
|
||||
Texture2D<float3> xe_texture : register(t0);
|
||||
Texture1D<float3> xe_gamma_ramp : register(t1);
|
||||
SamplerState xe_sampler_linear_clamp : register(s0);
|
||||
cbuffer XeStretchGammaRootConstants : register(b0) {
|
||||
@@ -6,14 +6,15 @@ cbuffer XeStretchGammaRootConstants : register(b0) {
|
||||
};
|
||||
|
||||
float4 main(float2 xe_texcoord : TEXCOORD) : SV_Target {
|
||||
float4 color =
|
||||
float3 color =
|
||||
xe_texture.SampleLevel(xe_sampler_linear_clamp, xe_texcoord, 0.0f);
|
||||
// The center of the first texel of the LUT contains the value for 0, and the
|
||||
// center of the last texel contains the value for 1.
|
||||
color.rgb = color.rgb * (1.0f - xe_gamma_ramp_inv_size) +
|
||||
(0.5 * xe_gamma_ramp_inv_size);
|
||||
color =
|
||||
color * (1.0f - xe_gamma_ramp_inv_size) + (0.5 * xe_gamma_ramp_inv_size);
|
||||
color.r = xe_gamma_ramp.SampleLevel(xe_sampler_linear_clamp, color.r, 0.0f).r;
|
||||
color.g = xe_gamma_ramp.SampleLevel(xe_sampler_linear_clamp, color.g, 0.0f).g;
|
||||
color.b = xe_gamma_ramp.SampleLevel(xe_sampler_linear_clamp, color.b, 0.0f).b;
|
||||
return color;
|
||||
// Force alpha to 1 to make sure the surface won't be translucent.
|
||||
return float4(color, 1.0f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user