jack1232 / WebGPU-Step-By-Step

WebGPU Tutorial: Step-by-step graphics programming with WebGPU - the next-generation graphics API for the web.
480 stars 48 forks source link

Pass vec4 to a fragment wgsl #3

Open eduardfossas opened 2 years ago

eduardfossas commented 2 years ago

Hello, I am following your examples in the book and the videos on youtube and I see you decided to go for a template string inside a typescript file instead of using wgsl extension. I have two questions regarding this:

Thank you very much for sharing your experience.

jack1232 commented 2 years ago

no performance impact. wgsl file will be converted to string in the pipeline. starting from video series 42, I started to use wgsl extension to write shader code because it it easier to code that the string.

use uniform buffer to pass vec4 to shader.