Top
Best
New

Posted by imagiro 4 days ago

I'm making a game engine based on dynamic signed distance fields (SDFs) [video](www.youtube.com)
412 points | 64 commentspage 3
cubefox 1 day ago|
Almost every 3D game uses textured polygons almost everywhere (except sometimes for fog or clouds), so this SDF engine is nice to see.

However, he doesn't mention animations, especially skeletal animations. Those tend to work poorly or not at all without polygons. PS4 Dreams, another SDF engine, also had strong limitations with regards to animation. I hope he can figure something out, though perhaps his game project doesn't need animation anyway.

Boxxed 23 hours ago||
I'm not super familiar with this area so I don't follow... Why is animation any more difficult? I would think you could attach the basic 3D shapes to a skeleton the same way you would with polygons.
dahart 22 hours ago||
There are lots of reasons you don’t see a lot of SDF skeletal rigging & animation in games. It’s harder because the distance evaluations get much more expensive when you attach a hierarchy of warps and transforms, and there are typically a lot of distance evaluations when doing ray-marching. This project reduces the cost by using a voxel cache, but animated stuff thwarts the caching, so you have to limit the amount of animation. Another reason it’s more difficult to rig & animate SDFs is because you only get a limited set of shapes that have analytic distance functions, or you have primitives and blending and warping that break Lipschitz conditions in your distance field, which is a fancy way of saying it’s easy to break the SDF and there are only limited and expensive ways to fix it. SDFs are much better at representing procedural content than the kind of mesh modeling involved in character animation and rendering.
MITSardine 13 hours ago||
One possibility, a little backwards maybe, is to produce a discrete SDF from e.g. a mesh, by inserting it in an octree. The caching becomes the SDF itself, basically. This would let rendering be done via the SDF, but other logic could use the mesh (or other spatial data structure).

Or could the engine treat animated objects as traditional meshed objects (both rendering and interactions)? The author says all physics is done with meshes, so such objects could still interact with the game world seemingly easily. I imagine this would be limited to characters and such. I think they would look terrible using interpolation on a fixed grid anyways as a rotation would move the geometry around slightly, making these objects appear "blurry" in motion.

Jarmsy 11 hours ago||
Sampling an implicit function on a grid shifts you to the world of voxel processing, which has its own strengths and weaknesses. Further processing is lossy (like with raster image processing), storage requirements go up, recovering sharp edges is harder...
MITSardine 10 hours ago||
But isn't this what the author is doing already? That's what I got from the video. SDF is sampled on a sparse grid (only cells that cross the level set 0) and then values are sampled by interpolating on the grid rather than full reevaluation.
01HNNWZ0MV43FF 22 hours ago||
His SDF probably puts out a depth buffer, so with some effort (shadows might be hard?) you can just mix it with traditional polygons. The same way raytracing and polygons mix in AAA games.

He's using the SDFs to fill a space sort of like Unreal's Nanite virtual geometry. Nanite also doesn't support general animation. They only recently added support for foliage. So you'd use SDF / Nanite for your "infinite detail" / kit-bashing individual pebbles all the way to the horizon, and then draw polygon characters and props on top of that.

In fact I was surprised to see that Nanite flipped from triangle supremacy to using voxels in their new foliage tech. So maybe the two technologies will converge. The guy who did the initial research for Nanite (his talk also cites Dreams ofc) said that voxels weren't practical. But I guess they hit the limits of what they can do with pixel-sized triangles.

cubefox 15 hours ago||
I think they do now support skeletal meshes with virtual geometry: https://dev.epicgames.com/documentation/en-us/unreal-engine/...

Though it says "experimental". Unclear what that means in practice.

This also mentions "skinning": https://dev.epicgames.com/documentation/en-us/unreal-engine/... I believe thats just another term for skeletal meshes / "bones".

DetroitThrow 23 hours ago||
Such impressive demos and great explanations in the video. Mike, if you're reading this, keep making videos!
matt3210 1 day ago||
Dang! Very nice!
Keyframe 22 hours ago||
really cool! CSG: The Game!
doctorpangloss 17 hours ago||
how does this compare to MudBun?
andybak 10 hours ago|
Mudbun renders using raymarching - the video explains why he has avoided doing this.
darubedarob 1 day ago||
[dead]
andrewstuart 16 hours ago|
There’s game developers who develop games.

And there’s game developers who develop game engines thinking they are developing games.

21asdffdsa12 11 hours ago|
Nothing wrong with that - Engine developers often have "defining" titles - aka tech demos they work on to push the field
mikkupikku 4 hours ago||
Townscaper is a nice one like this; it has very few features or gameplay, just a sandbox tech demo for a very cool take on model synthesis / "wave function collapse" on an irregular grid. The game is mostly carried by the novelty of this mechanic (and also the pleasant art.)