Replies: 3 comments 2 replies
-
AFAIK there is no such step mode on the GPU. What would it do if you were using If you want to do your own indexing then pass in your vertices as storage buffers and use For flat shading you can also possibly use Here's an example of deriving the normals from derivatives |
Beta Was this translation helpful? Give feedback.
-
Alternatively if its just for this cube, you can store normals in there own buffer, than do something |
Beta Was this translation helpful? Give feedback.
-
Thank you all! I'm not searching for a solution. I understand webgpu is built on top of vulkan, metal, directx backends. IF they don't support this, it's difficult for webgpu to support it. I'm mainly curious why gpu doesn't support this mode, given there seem to be enough use-cases. I want to know what the difficulty is? |
Beta Was this translation helpful? Give feedback.
-
this is a potentially stupid question.
I'm trying to draw a cube with flat shader, for which I need to duplicate vertex positions in the vertex buffer, because of different normals. For example, a vertex at a corner has 3 different normal directions. I hence have to duplicate the vertex to pair with the 3 different normals.
This is a redundancy. What if I can define 2 vertex buffers, one for vertices, one for normals. And the normal buffer's step mode is per triangle? i.e. the normal value will only change when we switching to a new triangle.
right now the step mode supports only "vertex" and "instance", why not a "triangle" mode too? The pipeline has to do rasterization anyway, it must know vertex connectivity?
Beta Was this translation helpful? Give feedback.
All reactions