Rendering Implicit Surfaces and Distance Fields: Sphere Tracing——Introduction

keywords: distance fields, implicit functin, sphere tracing, CGS, contructive solid geometry, ray marching, implicit surfaces, gradient, level surface, level sets, blobbies, soft objects meatballs.

this lesson is only an introduction to the topic of distance fields and rendering distance fileds using sphere-tracing. once u have read the lesson u can find a lot of complementry material on the web to continue your personal exploration with this technique. do not hesitate to share your results with us!

we did not plan to write a lesson on rendering distance fileds so quickly but this topic is useful to introduce some of the concepts we will be using in the next lesson devoted to ray-marching and volume rendering. furthermore this is a topic quite popular among video game developers. we thought it would be great to explain this technique and the maths behind it in the “scatchapixel way”: with simple words, some nice illustrations and of course a fully functional example.

first, when was this technique introduced to the computer graphics community? it is hard to know exactly who and when the technique was introduced to the CG community, but in 1996, John Har published an important paper on this topic entitled Sphere Tracing: a geometric method for the antialiased ray tracing of implicit surfaces. few people before him had already made some research on rendering implicit surfaces and distance fields (an implicit surface is a distance filed, but not all distance fields can be defined as implicit surfaces). note that the technique described by Hart is not the only possible method for rendering distance fields and/or implicit surfaces but it is one of the most popular (ray-marching is another one).

second what is about ? some mathematical shapes can easily be described with equations. this is the case of spheres for example. in the lesson A minimal Ray-Tracer: rendering simple shapes (sphere, cube, disk, plane, etc.) we explained that spheres could be defined using the following equation:

在这里插入图片描述
in other words, if u take the coordinates of a point on sphere of radius r and raise them to the power of two, then their sum will be equal to the sphere’s radius raised to the power of two. simple. the advantage of using an equation to describe a 3D shape is that we can use mathematics or at least mathematical methods to compute the intersection point between a ray (a line) and these shapes (it can be a sphere, a cone, a torus, a plane, etc.), which in ray-tracing is what we are interested in. in the aforementioned lesson, we solve the ray-sphere intersection problem with an analytic method in which we equate the parametric equation with the sphere equation and slove for t, the ray parametric distance.
在这里插入图片描述
where O is the ray origin and R the ray direction. the sphere equation belongs to a family of equations called quadric functions and the roots (in other words the solutions) of

发布了610 篇原创文章 · 获赞 96 · 访问量 33万+

猜你喜欢

转载自blog.csdn.net/wodownload2/article/details/104069077
今日推荐