googlecodelabs / feedback

Provide feedback to our codelabs by filing an issue here
18 stars 22 forks source link

[your-first-webgpu-app] #1440

Open jahmezz opened 3 weeks ago

jahmezz commented 3 weeks ago

Draw A Grid

Your example is confusing because it currently talks about the bottom-right corner, when it should say bottom-left.

In the "Manipulate geometry in the shader" section.

One way you could fix this is to update the square's vertex buffer. By shifting the vertices so that the bottom-left corner is at, for example, (0.1, 0.1) instead of (-0.8, -0.8), you'd move this square to line up with the cell boundaries more nicely. But, since you have full control over how the vertices are processed in your shader, it's just as easy to simply nudge them into place using the shader code!

ChatGPT also provided me with a graph showing what you mean. output (1)

jahmezz commented 3 weeks ago

If "Manage Cell State" (Section 7) used VertexInput for "Read the storage buffer in the shader" parameter 1, then it would be more consistent and easier to follow.

It currently uses the non-struct approach of pos and instance_index.

beaufortfrancois commented 3 weeks ago

Your example is confusing because it currently talks about the bottom-right corner, when it should say bottom-left.

Thank you for reporting this issue @jahmezz! It is now fixed in https://codelabs.developers.google.com/your-first-webgpu-app?hl=en#4

If "Manage Cell State" (Section 7) used VertexInput for "Read the storage buffer in the shader" parameter 1, then it would be more consistent and easier to follow.

@toji What do you think?

beaufortfrancois commented 2 weeks ago

@toji (gentle ping)