-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Add example showing how to use SpecializedMeshPipeline #14370
Add example showing how to use SpecializedMeshPipeline #14370
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ty!! so helpful to have more of these mid-level examples
|
||
@fragment | ||
fn fragment(in: VertexOutput) -> @location(0) vec4<f32> { | ||
return vec4(in.color, 1.0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could this use world position? even if a bit silly like dividing the color by the position or smth
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to keep the shader as simple as possible. I think people using that level of api are able to figure that out. I could maybe rotate the camera a bit to show that it's all already correctly placed in the world.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should probably add a few comments about the world position and instance_index though.
This seems very helpful, I did not know this functionality existed! However, based on the comments in the example I'm still slightly confused what the use cases and limitations are and when to use it. |
It's a bit hard to explain if, for example, using the material apis was enough for your use case. This api is useful when you want to have more control over how a mesh is rendered than is possible with the material api. And I guess the limitations are that's it's very verbose? It's also still made with rendering meshes in mind, if you want to make other effects that don't necessarily work with meshes directly then this isn't for you. |
Ah yep, that seems useful information to add to the example! They're often a bit short on information as to why to do things, I find. |
This has subtle merge conflicts with #14273 that need to be fixed manually <3 |
Objective
Solution
SpecializedMeshPipeline
.Testing
Showcase
The examples just spawns 3 triangles in a triangle pattern.