Sign in to follow this  
Sfpiano

Creating large scale objects using Bezier patches

Recommended Posts

Sfpiano    126
Is the only way to create detailed objects to use series of 4x4 patches connected together? Or is there a way to create patches larger than 4x4 effectively?

Share this post


Link to post
Share on other sites
Toji    535
For larger patches higher order curve equations are required. The bigger they are, the slower they are, so staying small is a good thing. Plus, you can make the same shapes with careful patch placement, so why bother?

It's like polygons on a 3D card at some point every single polygon out there can be broken down into triangles, so it's rather pointless for the card to try an accelerate anything else.

Share this post


Link to post
Share on other sites
jyk    2094
Just adding a couple things to Toji's comments. First of all, when trying to model arbitrary shapes with Bezier patches it is useful to use triangular patches as well as square. They are a bit harder to code, though.

You can think about patch flexibility in terms of the polynomial functions that represent them. A quadratic can only 'change direction' once. Similarly, 4x4 patches can only curve back on themselves twice (in either dimension), but no more. This creates significant limitations when it comes to modelling. Added to that is the difficulty of enforcing continuity where patches are joined. NxN patches with N > 4 are more difficult to work with, and I don't know that I've heard of them being used in practice.

There are alternatives to Bezier patches that might be more suitable for arbitrary models. NURBS are one such alternative. Another very useful technique is subdivision surfaces, with which you can take a more or less arbitrary base mesh (with some restrictions) and 'smooth it out' to an arbitrary level of detail.

Share this post


Link to post
Share on other sites
NURBS are more of a modelling primitive than a rendering one ... better to convert them to rational bezier form for rendering. Better to avoid them altogether though. Subdivision surfaces seem the most appropriate solution. Trying to model with higher order patches would be a needless headache.

Share this post


Link to post
Share on other sites
Sfpiano    126
Well I'd mainly be using the patches for terrain rendering as opposed to character or shape modeling. So it seems that linking a series of bezier patches would work well?

Share this post


Link to post
Share on other sites
Toji    535
Yeh, it would work fine.

A good example of using patches like this would be the Quake 3 engine. If you look at q3dm1, that giant mouth/tounge at the back of the level is made entirely of 3x3 bezier patches, so obviously you can get some very fine detail out of them if needs be. On something like landscapes, though, where you generally don't need many small details or extreme curves, it would be very easy to implement.

Share this post


Link to post
Share on other sites
ajas95    767
sfpiano,
I think the simplest thing to accomplish what you're talking about is to use Catmull-Rom patches. It's the same extension from splines to patches as it is for bezier, just a slightly different coefficient matrix. But then you can have NxN size patches that interpolate (pass through) all the points that you specify.

Share this post


Link to post
Share on other sites
y2kiah    2031
Catmull-Rom gives some pretty undesirable results when the slope of the curve changes dramatically through a control point. The surface will "dip" slightly just before rising through the control point, this means the edge of every cliff or mountain will have a lowered ridge around it. Plus using catmull-rom does not easily lend itself to creating bounding volumes for the terrain for frustum or occlusion culling. I suggest using bi-cubine (B-Spline) patches. The control points will be approximated rather than interpolated but that is ok, you can still get the results you want, plus the control points can be used as a bounding volume.

Share this post


Link to post
Share on other sites
Sfpiano    126
So if I understand this correctly if I wanted to make an 8x8 patch using B-Splines, all I would do is use 4 4x4 patches calculated using the B-Spline matrix, and string them together sharing 4 'anchor' rows or columns?

Share this post


Link to post
Share on other sites
y2kiah    2031
Yes, your control points can be stored in the same fashion as a heightmap. In this case however you will need 2 extra points for each row and column, so if you want 128x128 patches in your terrain, you will need a map of 131x131 control points. 4x4 points will be used to approximate a single patch within the area of the center points of that patch. Here is an example of a 2x2 terrain, and the 5x5 control points needed. Of course you only draw one patch at a time using the appropriate 16 control points surrounding it, precomputing the [B-Spline matrix]*[control-point matrix] and tesselating the patch using the matrix.


* * * * *


* *-----*-----* *
| | |
| | |
* *-----*-----* *
| | |
| | |
* *-----*-----* *


* * * * *


The highest and lowest points within the 16 control points of a patch are guaranteed to contain the geometry of the patch, so it is a loose fitting but easy to find bounding volume, which should also be pre computed and stored.

[Edited by - y2kiah on May 31, 2005 6:29:58 PM]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this