Live data from Hacker News

From 0 to glTF with WebGPU: Basic Materials and Textures

willusher.io

11–13 of 13 posts

Re: From 0 to glTF with WebGPU: Basic Materials and Textures

#11
post #8
post #2

It's quite impressive how many more lines of javascript and shading is required to show this in a browser, than it requires to bring a window on the screen and show a texture on it using plain C.

Show us ... I think you'll find you're wrong

Hm, does this count? https://github.com/DusteDdk/bounceball/blob/master/main.cpp

Re: From 0 to glTF with WebGPU: Basic Materials and Textures

#12
post #11
post #8

Earlier quoted context omitted.

Show us ... I think you'll find you're wrong

Hm, does this count? https://github.com/DusteDdk/bounceball/blob/master/main.cpp

Kinda. SDL_renderer is a level on top of the raw GPU API, which is what WebGPU is targeted at. Feel free to use Canvas2DRenderingContext or any other rendering libraries (e.g. Phaser, Pixi.js) to achieve a similar line count to what you're seeing with SDL_renderer.

Also, you might struggle to implement glTF and PBR materials with the same line count with SDL_renderer.

Re: From 0 to glTF with WebGPU: Basic Materials and Textures

#13
post #11
post #8

Earlier quoted context omitted.

Show us ... I think you'll find you're wrong

Hm, does this count? https://github.com/DusteDdk/bounceball/blob/master/main.cpp

no, no rendering code is shown. The code is calling into some class called Ball whuch itself is using a library. if you're going to rely on a library then there are plenty of js libraries that will abstract to few lines or you could even use canvas 2d
Post reply on HN