24 lines
466 B
Plaintext
24 lines
466 B
Plaintext
float4 shadeVideo(ShaderContext context)
|
|
{
|
|
float2 uv = clamp(context.uv + offset, float2(0.0, 0.0), float2(1.0, 1.0));
|
|
float4 color = sampleVideo(uv);
|
|
|
|
color.rgb *= brightness;
|
|
color *= tint;
|
|
|
|
if (invert)
|
|
color.rgb = 1.0 - color.rgb;
|
|
|
|
if (mode == 1)
|
|
{
|
|
float luma = dot(color.rgb, float3(0.2126, 0.7152, 0.0722));
|
|
color.rgb = float3(luma, luma, luma);
|
|
}
|
|
else if (mode == 2)
|
|
{
|
|
color.rgb = floor(color.rgb * 4.0) / 4.0;
|
|
}
|
|
|
|
return saturate(color);
|
|
}
|