raytracing bezier patches.. back
Board:
Home
Board index
Raytracing
General Development
(L) [2013/11/07] [tby AlbusDumbledore] [raytracing bezier patches..] Wayback!You know the Newell teapot (also called a utah teapot), somewhat ugly thing, but good as an example of object. As far as I know it originally was designed as a set of bezier patches or something (about 25 or something like that).
What exactly is the best kind ot 'patch' tu use here? is it a bezier path based on
rank 3 bezier curves? How many floats is needet to make such patch?  Is it very hard to wrote raytracer for that? Patch-ray intersection test routine would be needed.
I had read here one man who wrote a raytracer for quadrics but quadrics as I understand are not to much good here it would be need to get rank 3 patches i think..
(L) [2013/11/07] [tby friedlinguini] [raytracing bezier patches..] Wayback!It's typically defined as a set of bicubic Bezier patches, which is about as simple as general-use parametric patches get. The easiest way to deal with them is to tessellate the patches into triangles and render those. Alternatively you could try tracing the patches directly. There are a few ways to do this, but they generally involve recursively subdividing the patch.
For example, you could find the bounding box of the sixteen control points of the patch. If your ray misses the box, then it is guaranteed to miss the patch. If it hits the box, and the box is smaller than some threshold, then treat it as a hit, and you find the normal from one of the corner control points and its two neighbors. If you hit the box, but the box is larger than the tolerance, then subdivide the patch into 4 smaller patches using de Casteljau subdivision, and then repeating on the four smaller boxes.
There are a lot of variations on these themes (subdivide to some level on demand, then tessellate, define the ray as two intersecting planes, and then split based on whether the control points of a patch straddle both planes, etc.). Personally, I'd get a spatial subdivision structure implemented--you mentioned in another thread that you didn't have one yet--and just go with the triangles.
(L) [2013/11/07] [tby graphicsMan] [raytracing bezier patches..] Wayback!Google is your friend [SMILEY :)]  There are research papers describing how to ray tracing bezier patches and NURBS surfaces.  The order of the patches can be 3 or anything else you decide.  3 ensures C^2 continuity across the patch, and it is possible to model many surfaces such that you can achieve that continuity at patch boundaries (by aligning nieghboring patch knot vectors).  I think that going much higher than 3 will not yield visible differences, but I've never seen a perception study about that.  Going less than 3 will probably yield artifacts.
(L) [2013/11/07] [tby ginkgo] [raytracing bezier patches..] Wayback!The Newell teapot is composed of 32 bicubic bezier patches.
You can find the original dataset [LINK http://www.sjbaker.org/teapot/teaset.tgz here]. It's a simple text format that should be easy to parse. It also contains a spoon and teacup model.
(L) [2013/11/10] [tby hobold] [raytracing bezier patches..] Wayback!Bezier spline patches have been in use in graphics for a while, so they are well understood. I wouldn't say that they are the best known type of curved surface, because "best" can mean different things to different people. If you are starting from scratch, you might want to look into subdivision surfaces as well. They intuitively behave much like Bezier patches, but have fewer restrictions on the placement of their control points.
GraphicsMan's points about the degree of smoothness (i.e. how often the mathematical representation can be continuously differentiated) are important for the visual appearance. Surface models that are not continuously differentiable (C^0, e.g. the usual flat triangles) result in objects that are obviously faceted, so they can look somewhat crystalline.
Surfaces that are differentiable once (C^1) will look much smoother (their silhouettes in particular), but still have obvious weird artifacts especially with highlights and other reflections:
[IMG #1 Image]
Starting with twice differentiable (C^2), surfaces will begin to mostly flow harmoniously, and only exhibit subtle flaws under specific, rare circumstances.
[IMG #1]:
(L) [2014/08/09] [tby hobold] [raytracing bezier patches..] Wayback!Pardon the late reply. Finally got around to doing an illustration of surface smoothness, showing the range from piecewise constant to twice continuously differentiable. Lighting and texturing also have strong effects on perceived smoothness that are being shown. If you are interested see:
[LINK http://vectorizer.org/boar/smoothness.html]
back