mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 06:53:43 +00:00
32-bit color support
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#include "DrawQuad.h"
|
||||
#include "DrawQuadPixelConstants.h"
|
||||
#include "Functions.h"
|
||||
|
||||
SamplerState surfaceSampler : register(s0);
|
||||
Texture2D<float3> surfaceTexture : register(t0);
|
||||
@@ -8,11 +10,24 @@ struct SDrawQuadPixelOutput
|
||||
float4 color : SV_TARGET;
|
||||
};
|
||||
|
||||
float3 SamplePixel(int2 texCoord)
|
||||
{
|
||||
return surfaceTexture.Load(int3(texCoord, 0));
|
||||
}
|
||||
|
||||
SDrawQuadPixelOutput PSMain(SDrawQuadPixelInput input)
|
||||
{
|
||||
float3 surfaceColor = surfaceTexture.Load(int3(input.texCoord.xy, 0)).rgb;
|
||||
|
||||
SDrawQuadPixelOutput result;
|
||||
result.color = float4(surfaceColor, 1.0);
|
||||
int2 pixelCoordinate = int2(floor(input.texCoord.xy));
|
||||
result.color = float4(SamplePixel(int2(floor(input.texCoord.xy))), 1.0);
|
||||
result.color *= constants_Modulation;
|
||||
result.color = ApplyFlicker(pixelCoordinate, constants_FlickerStartThreshold, constants_FlickerEndThreshold, result.color * constants_Modulation);
|
||||
result.color = ApplyDesaturation(constants_Desaturation, result.color);
|
||||
|
||||
if (result.color.a <= 0.0)
|
||||
discard;
|
||||
|
||||
result.color.rgb = AppleRGBToSRGBLinear(result.color.rgb);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
Reference in New Issue
Block a user