Hacker News new | past | comments | ask | show | jobs | submit login
Raymarching with Fennel and LÖVE (andreyorst.gitlab.io)
70 points by forgotpwd16 on Oct 20, 2020 | hide | past | favorite | 3 comments



If you have 6 hours to kill, check this shadertoy that uses ray marching: https://www.shadertoy.com/view/3lsSzf

And the video that goes through its creation step by step: https://www.youtube.com/watch?v=Cfe5UQ-1L9Q&ab_channel=Inigo...


I am a little confused by this article. Since real 3d objects are used why not use ray tracing (ray surface intersection)?

As far as I know raymarching shines for scenes without real 3d objects. Rays are marched because a function determines if something should be rendered at some point along the way.

But still a useful article with a lot of good info.


The mathematics of SDFs are arguably easier to define then that of ray intersections, even for boxes and spheres. For arbitrary surfaces the intersection may not even have analytic solutions (true for >5 order polynomial surfaces), perhaps you'd need iterative solvers, so SDFs generalize and facilitate this intersection problem. You can even raymarch really exciting objects like fractals!

You can of course triangulate your surfaces into tiny triangles and use raytracing or rasterization. But then you're plagued by inevitable little edges unless you have at least as many pixels as triangles, at which point your performance gets really poor. So SDFs are really exciting for extremely accurate (photographic quality) reproduction of mathematically-defined objects.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: