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

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值