CodeWalker/CodeWalker.Shaders/PPLumBlendCS.hlsl

16 lines
340 B
HLSL
Raw Normal View History

2017-09-21 18:33:05 +08:00
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);
}