Harbor

branch main
showing the latest snapshot on main
derivatives_test.glsl 380 B · Plain text
shader/tests/golden/derivatives_test.glsl 0644 Raw
#version 450

layout(set = 0, binding = 0) uniform sampler2D albedo_tex;

layout(location = 0) in vec2 in_uv;
layout(location = 0) out vec4 out__value;

void main() {
	vec4 color = texture(albedo_tex, in_uv);
	float dx = dFdx(color.r);
	float dy = dFdy(color.r);
	float fw = fwidth(color.r);
	float edge = step(0.1, fw);
	out__value = vec4((color.rgb * (1.0 - edge)), color.a);
}