Engine, adapter and tools without game data
This commit is contained in:
commit
e2ede736f3
3500 changed files with 1640229 additions and 0 deletions
19
engine/third_party/SDL3/test/testgpurender_effects_grayscale.frag.hlsl
vendored
Normal file
19
engine/third_party/SDL3/test/testgpurender_effects_grayscale.frag.hlsl
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
Texture2D u_texture : register(t0, space2);
|
||||
SamplerState u_sampler : register(s0, space2);
|
||||
|
||||
struct PSInput {
|
||||
float4 v_color : COLOR0;
|
||||
float2 v_uv : TEXCOORD0;
|
||||
};
|
||||
|
||||
struct PSOutput {
|
||||
float4 o_color : SV_Target;
|
||||
};
|
||||
|
||||
PSOutput main(PSInput input) {
|
||||
PSOutput output;
|
||||
float4 color = u_texture.Sample(u_sampler, input.v_uv) * input.v_color;
|
||||
float gray = color.r * 0.2126 + color.g * 0.7152 + color.b * 0.0722;
|
||||
output.o_color = float4(gray, gray, gray, color.a);
|
||||
return output;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue