Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by dusted on Thursday May 02, 2024 @06:52AM
(#40234712)
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.
[ Parent
| on HN ]
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by T_MacThrowFace on Thursday May 02, 2024 @06:57AM
(#40234742)
only if you look past the uncount(ed|able) lines of plain C it would take to make it usable on any device, by everyone with a web browser
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by shiandow on Thursday May 02, 2024 @09:13AM
(#40235833)
Except for the people using firefox (stable), or any mobile device.
With freeglut it's fairly doable to make a version that has wider support than this webpage. Though I definitely prefer this post's syntax to OpenGL.
Not sure if that matters though, given that this is clearly meant as a tutorial for WebGPU, but there's still a ways to go before WebGPU can claim to have broad support.
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by pjmlp on Thursday May 02, 2024 @11:56AM
(#40237684)
Only if using legacy pre-OpenGL Core profile, in terms of lines of code, to come back to original point of this thread.
Additionally, while I tend to bash WebGL and WebGPU lagging behind native counterparts, they are in one thing, being 3D APIs designed specifically for managed languages.
Also Firefox does WebGL, and if they would have used Threejs or BabylonJS, it would be used instead.
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by pjmlp on Thursday May 02, 2024 @10:04AM
(#40236465)
Tell us that you never used Vulkan, without telling us.
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by ramon156 on Thursday May 02, 2024 @02:29PM
(#40239791)
You're saying vulkan isn't using thousands of lines under the hood?
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by nox101 on Thursday May 02, 2024 @10:48AM
(#40236940)
Show us ... I think you'll find you're wrong
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by dusted on Thursday May 02, 2024 @05:14PM
(#40241432)
Hm, does this count? https://github.com/DusteDdk/bounceball/blob/master/main.cpp
Re:From 0 to glTF with WebGPU: Basic Materials and Textures
by Jasper_ on Thursday May 02, 2024 @05:23PM
(#40241514)
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
by nox101 on Sunday May 05, 2024 @08:03PM
(#40269800)
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