Harbor

branch main
showing the latest snapshot on main
derivatives_test.hlsl 599 B · Plain text
gpu/shader/tests/golden/derivatives_test.hlsl 0644 Raw
Texture2D albedo_tex_tex : register(t0, space0);
SamplerState albedo_tex_samp : register(s1, space0);

struct _fs_main_Input {
	float4 _sv_position : SV_Position;
	float2 uv : TEXCOORD0;
};

struct _fs_main_Output {
	float4 _value : SV_Target0;
};

_fs_main_Output fs_main(_fs_main_Input input) {
	_fs_main_Output __luma_output;
	float4 color = albedo_tex_tex.Sample(albedo_tex_samp, input.uv);
	float dx = ddx(color.r);
	float dy = ddy(color.r);
	float fw = fwidth(color.r);
	float edge = step(0.1, fw);
	__luma_output._value = float4((color.rgb * (1.0 - edge)), color.a);
	return __luma_output;
}