Why are curves so hard in RT?

Discussion in 'Console Technology' started by Dungeonscaper, Jun 8, 2010.

  1. Dungeonscaper

    Newcomer

    Joined:
    Feb 12, 2010
    Messages:
    89
    Likes Received:
    0
    Location:
    Australia
    Wouldn't it be easy enough to implement perfect looking circles by giving it a formula and determining its size and position in the world, same with curves. Spheres too, all you'd need is some nice shading on the 2D sphere to give it the effect.

    My calculator can do this! I know tessellation can achieve a similar thing, but why not just draw from a formula and calculate it with enough accuracy to look perfect at 720p?

    I've made 2d games that can be infinitely zoomed into curves and all preserving curve detail in *caugh* java and I can squish them horizontally to simulate a 3D rotation.

    Why do I see blocky looking barrels, balls, and bullets in all games today?
     
  2. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,455
    Location:
    Budapest, Hungary
    Because there are very few perfect spheres and cylinders in any game world, and once you start to combine them into more complex forms, it gets more and more complicated to draw them without using triangles. They you need 3D lighting and shading, textures, deformation... So it just isn't worth the time.

    So Tron's light cycles for how such a 3D model would look like.
     
  3. Grall

    Grall Invisible Member
    Legend

    Joined:
    Apr 14, 2002
    Messages:
    10,801
    Likes Received:
    2,175
    Location:
    La-la land
    The reason what you propose isn't done is because of what Laa says; it's really really hard to represent real-world objects and imagery in a realistic way with this type of mathematical modelling. Much harder than by using polygons.

    Furthermore, today's development software is made for polys, not for complex mathematical surfaces, so creating assets would be even more difficult than just the issues created by this new modeling system creates. Not to mention our GPUs, which expect to be fed polygons and nothing else.
     
  4. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,455
    Location:
    Budapest, Hungary
    Modeling software is only a problem in that you can't construct 99% of the real and imaginary worlds (except Tron) from procedural primitives. Doesn't matter what tools are provided if the task is impossible :)

    NURBS is implicit as well, but quite problematic too, almost completely gone now from anywhere except from CAD/CAM.
     
  5. ERP

    ERP Moderator
    Moderator Veteran

    Joined:
    Feb 11, 2002
    Messages:
    3,669
    Likes Received:
    49
    Location:
    Redmond, WA
    Because direct algebraic solutions don't exist for general curves of degree 3 and higher.
    For normals to look smooth accross a continuous curved surface you need at least a cubic curve, and in most cases modelling packages use degree 5 or higher (or subdivision surfaces which don't even have algebraic representations).

    You can use itterative solutions for raytracing arbitrary curves, but they tend to be numerically unstable. There is a mechanism called bezier clipping, which is numerically stable, but IME is more expensive than brute force tessalation.

    Trimming also makes the problem considerably worse.
     
  6. flynn

    Regular

    Joined:
    Jan 8, 2009
    Messages:
    400
    Likes Received:
    0
    Oh yes, texturing NURBS is a lot of fun. I remember when Centropolis was working on Godzilla and Softimage was putting out almost daily patches to fix all the bugs in the NURBS code.
     
  7. Shifty Geezer

    Shifty Geezer uber-Troll!
    Moderator Legend

    Joined:
    Dec 7, 2004
    Messages:
    43,576
    Likes Received:
    16,034
    Location:
    Under my bridge
    This IMO is the real reason HOS hasn't progressed. Hardware went the tesselation route with good reason, and now it's a zillion times faster to render object with triangles rather than solve equations. Even in games designed specifically for CSGs where modelling isn't an issue, performance will still be poor versus tesselated versions of those beautiful mathematical functions.

    Thus the only place for HOS in games is as part of a tesselated solution, with objects+displacement maps being converted to triangles to be rendered. But that'll work well enough.
     
  8. Billy Idol

    Legend Veteran

    Joined:
    Mar 17, 2009
    Messages:
    6,032
    Likes Received:
    873
    Location:
    Europe
    Isn't this idea of drawing mathematical function, i.e. perfect curves when zoomed in, exactly what people want to approximate with tesselation, i.e. increase the polycount when zooming in?
    So here you have your solution to the problem! Maybe you can use the mathematical functions (NURBS) to get boundaries for the tesselation...
     
  9. Grall

    Grall Invisible Member
    Legend

    Joined:
    Apr 14, 2002
    Messages:
    10,801
    Likes Received:
    2,175
    Location:
    La-la land
    It's not really a problem that needs a solution, as this technique has already been used a number of times. :) For example, some PS2 racing game whose name I can't remember stored the road surface as a mathematical representation rather than a 3D mesh, and tesselated it out in realtime. Saved some memory that way I believe. Height maps can also be stored this way - like the ground in games like World of Warcraft. Of course, you can't have inclinations greater than vertical with this technque, so no caves, overhangs etc...

    The big problem with this idea - like described previously in the thread - is the number of objects you can reasonably describe with these surfaces is limited. So you don't really gain anything, you'll just create extra headaches for yourself this way. :)

    Also, tesselation today is more about creating additional detail when approaching a detail (through displacement mapping) - and in the reverse, removing details when the object recedes, than making curves smoother...
     
  10. Dungeonscaper

    Newcomer

    Joined:
    Feb 12, 2010
    Messages:
    89
    Likes Received:
    0
    Location:
    Australia
    still why can't polygon-nurb hybrids exist peacefully? You only use mathematical curves when you need them?
     
  11. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,455
    Location:
    Budapest, Hungary
    In the same model?? How??
     
  12. Danalys

    Regular

    Joined:
    Dec 8, 2005
    Messages:
    373
    Likes Received:
    1
    What I don't get is that when there are objects with rotational symmetry why they can't model a pie slice of it in more detail then just draw it in however many places it needs to be drawn.
     
  13. MfA

    MfA
    Legend

    Joined:
    Feb 6, 2002
    Messages:
    7,374
    Likes Received:
    713
    Do modeling programs really make it difficult to combine patches with tris? Algorithmically it's trivial.

    Any way, a lot of it seems inertia to me ... (low) poly modeling needs to die already ... excellent rendering primitive, stupid modeling primitive.
     
  14. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,455
    Location:
    Budapest, Hungary
    Poly modeling is pretty f***** cool for modeling, thank you very much.
     
  15. Arwin

    Arwin Now Officially a Top 10 Poster
    Moderator Legend

    Joined:
    May 17, 2006
    Messages:
    18,488
    Likes Received:
    2,221
    Location:
    Maastricht, The Netherlands
    I guess I agree with Grall here - right now its probably far more feasible to provide mathematical hints for the tesselator to improve detail accuracy, than to really blend the two approaches.

    One option that's a bit of a long shot that I'm wondering about is whether or not you can teach some kind of AA algorithm (something like MLAA) to AA tesselated curves in such a way that they look even smoother?

    However, I personally do wonder also whether or not a hybrid approach may be possible. I'm sure we'll find out within 5 years. :) The more detail the 3D world gets, the more you win by modelling some aspects of it with a formula. And once that becomes more common, the more room there will be for a new way of rendering them.
     
  16. Laa-Yosh

    Laa-Yosh I can has custom title?
    Legend Subscriber

    Joined:
    Feb 12, 2002
    Messages:
    9,568
    Likes Received:
    1,455
    Location:
    Budapest, Hungary
    But most of the things in nature aren't perfectly smooth and curved at all! A realistic living creature is as lumpy and bumpy as it gets, even man made objects have plenty of imperfections.

    That mathematical precision is the very CG look everyone wants to get rid of, aiming for it is useless.
     
  17. Shifty Geezer

    Shifty Geezer uber-Troll!
    Moderator Legend

    Joined:
    Dec 7, 2004
    Messages:
    43,576
    Likes Received:
    16,034
    Location:
    Under my bridge
    In theory that's a good idea. You could weight the averages so instead of being a linear interpolation, you approximate a curve. However, I doubt if the single pixel depth of curvature is going to change much to the final image when the triangular edge is still clearly visible.
     
  18. MfA

    MfA
    Legend

    Joined:
    Feb 6, 2002
    Messages:
    7,374
    Likes Received:
    713
    As an approximation smooth and curved is better than piecewise flat though ... the error is equally distributed, whereas with polygons most of it is at the edges.

    You can get closer to a natural surface by adding detail and creases to a HOS. But you can't really make a polygon round with a detail layer.
     
  19. Danalys

    Regular

    Joined:
    Dec 8, 2005
    Messages:
    373
    Likes Received:
    1
    Wheels, manholes, arches, tunnels, pipes, tubes and domes are quite common in games. Unrealistically perfectly smooth is probably the best we could hope for until small little imperfections could be added.
     
    #19 Danalys, Jun 9, 2010
    Last edited by a moderator: Jun 9, 2010
  20. Dungeonscaper

    Newcomer

    Joined:
    Feb 12, 2010
    Messages:
    89
    Likes Received:
    0
    Location:
    Australia
    Most things in nature aren't naturally blocky and triangular either. Looking outside nature though I can see mathematical renderings very useful in modeling machines though would you agree? Perhaps perfect mathematical spiral springs, sockets, wheels and LEDs. The cg look isn't for everything as you say but I think it has many uses
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...