CodeWalker/Shaders/PPLumBlendCS.hlsl
2018-03-13 22:24:18 -04:00

16 lines
340 B
HLSL

StructuredBuffer<float> Target : register( t0 );
RWStructuredBuffer<float> Current : register( u0 );
cbuffer cb0
{
float BlendFactor;
float3 pad;
}
[numthreads(1, 1, 1)]
void main( uint3 DTid : SV_DispatchThreadID )
{
float t = max(Target[0],0);
float c = max(Current[0],0);
Current[0] = c + ((t - c) * BlendFactor);
}