r/GraphicsProgramming • u/mitrey144 • Oct 22 '24
WebGPU Renderer Devlog 3: Frustum & Occlusion Culling on Compute Shaders
Implemented frustum and occlusion culling for my WebGPU renderer. 4000 tree instances. Realtime soft shadows.
5
u/deftware Oct 23 '24
Good work! :]
For the commoners you (and everyone else) should keep in mind that to demonstrate frustum culling visually you have to include an external view of the camera looking at the scene so that they can see the culling in action. Otherwise they'll look at something like this and not have a clue as to what the big deal is.
3
u/mitrey144 Oct 23 '24
Good point, thank you
2
u/deftware Oct 23 '24
It's extra work, because it means decoupling the camera that culling is occurring relative to, and the matrices actually used as the camera pose when rendering - but it's not a super big deal, and it's a great way to debug any issues to boot!
22
u/cherrycode420 Oct 22 '24
Been trying to find disappearing Shadows/Geometry, but seems to be flawless!
On top of that, for my nooby eyes, the visuals look pretty good! (Lighting, Shadows)
7
u/Jarmund5 Oct 23 '24
This is super cool, WebGPU has a lot of potential for complex web-browser based games.
2
u/LordDaniel09 Oct 23 '24
Not only web based. From what I understand you could complie it to native apps on many platforms. It seems more like what OpenGL tried to be, or Vulkan (if Apple actually would atleast attempt supporting...). I also heard it is much cleaner to work with, I honestly have to try use it someday.
2
u/pjmlp Oct 23 '24
For native you are better off with middleware engines, WebGPU is constrained by its design to fit into a browser sandbox, and the MVP between all native APIs in 2016, when the effort started.
Middleware engines have no such constraints and expose the full capabilities of graphics cards.
Looking at how WebGL evolution went,.expect at least a decade until RT or mesh shaders come to WebGPU.
2
3
u/shadowndacorner Oct 23 '24 edited Oct 23 '24
How are you getting around the lack of DrawIndirectCount? Just issuing the max number of draw calls on the CPU and filling the indirect buffer with empty draws for anything that gets culled?