Add example showing how to use SpecializedMeshPipeline#14370
Conversation
tychedelia
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.