Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Narrow SDF #20

Open
yutannihilation opened this issue Feb 20, 2022 · 0 comments
Open

Narrow SDF #20

yutannihilation opened this issue Feb 20, 2022 · 0 comments

Comments

@yutannihilation
Copy link
Owner

Currently, this vertex shader includes the whole screen, but only the area around circle is needed. Not sure about the performance gain by this, though.

@stage(vertex)
fn vs_main(
model: VertexInput,
instance: InstanceInput,
) -> VertexOutput {
var out: VertexOutput;
out.coords = vec4<f32>(model.pos, instance.z, 1.0);
// Y-axis is opposite
out.center = vec2<f32>(instance.center.x, globals.resolution.y - instance.center.y);
out.radius = instance.radius;
out.stroke_width = instance.stroke_width;
out.fill_color = instance.fill_color;
out.stroke_color = instance.stroke_color;
return out;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant