3 ms·
Tl;dr: SDFs are really slow but cool because they can compactly define complex stuff; demoscene uses it. Sort of the functional programming to trad renderings O
by refulgentis 8mo ago
Tl;dr: SDFs are really slow but cool because they can compactly define complex stuff; demoscene uses it. Sort of the functional programming to trad renderings OOP. Would be cool if it was faster. Optimizing an algorithm for CPU rendering using recursive divide and conquer, 1 core with one object gets 50 fps. 100 fps if you lerp a 10x10 pixel patch instead of doing 1 pixel. Algorithm isn’t optimized, fully. Also, turns out the author’s idea is previously known but somewhat obscure, it is referred to as “cone marching”
- kg 8mo agoSDFs can be pretty fast if you do the work to optimize around them. Unreal Engine has lots of features based on SDFs that are used to great effect in games that run on consumer hardware. You don't need bleeding edge hardware or software either. The game I'm working on generates a new SDF every frame for the scene (using the GPU's fragment units to rasterize the distance data for the objects in the scene into a scratch buffer) and then does cone traces through the generated SDF per-pixel to do realtime soft shadow casting and lighting, and that performs just fine even on an old laptop from 2015.
- naasking 8mo agoSDFs can be made fast: https://www.youtube.com/watch?v=il-TXbn5iMA https://www.youtube.com/watch?v=il-TXbn5iMA