Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 1 of 2 12 LastLast
Results 1 to 10 of 53

Thread: Open GL should support konkave polygons directly

Hybrid View

  1. #1
    Intern Newbie
    Join Date
    Dec 2012
    Posts
    43

    Open GL should support konkave polygons directly

    Open GL should support concave polygons directly.
    I think itīs an easy algorythm which should be no problem.
    Last edited by LuisAK; 08-21-2013 at 12:30 PM.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,198
    This would be an easy enough algorithm if OpenGL was a software library.

    OpenGL is not a software library.

    If graphics hardware does not support concave polygons, then no matter how much you may want OpenGL to support concave polygons, you can't have it.

    The only way to support concave polygons is therefore to run them through a preprocessing stage that converts an arbitrary concave polygon back to multiple convex polygons. And solutions already exist for that.

    This request, coupled with your previous, demonstrates that you don't actually understand what OpenGL is. It may also be the case that you have some very specific problems, you've chosen OpenGL as a solution, and now you're finding that OpenGL is a bad fit for those problems. If that's so, then rather than wishing a bad fit was made good, you should instead be looking for a more appropriate solution.

  3. #3
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    OpenGL does already support "konkave" polygons. You can make your polygons concave all you want.

    So long as they're triangles.

    Quads and general GL_POLYGON primitives were removed in OpenGL 3.1. Yes, compatibility mode still has them around. But the ARB is not going to make any changes to OpenGL just for some compatibility-only feature.

  4. #4
    Member Regular Contributor Nowhere-01's Avatar
    Join Date
    Feb 2011
    Location
    Novosibirsk
    Posts
    251
    Quote Originally Posted by mhagain View Post
    The only way to support concave polygons is therefore to run them through a preprocessing stage that converts an arbitrary concave polygon back to multiple convex polygons. And solutions already exist for that.
    Well, OpenGL's tessellation is a hardware facility, that may be used for exactly such preprocessing. Or you can use stencil buffer. But yes, there's no native implementation of such "am easy algotythm"(i couldn't resist opening hidden OP's post. and it totally worth it) in OpenGL.

    for OP:
    Because almost no one actually needs it in realtime rendering and it requires either significant changes to rasterization pipeline or tessellation(which you can utilize yourself both software and hardware).

    Quote Originally Posted by mhagain View Post
    It may also be the case that you have some very specific problems, you've chosen OpenGL as a solution, and now you're finding that OpenGL is a bad fit for those problems. If that's so, then rather than wishing a bad fit was made good, you should instead be looking for a more appropriate solution.
    OP is not likely to be an actual OpenGL programmer. Otherwise he would be busy actually doing something, instead of searching for flaws in API. which he fails miserably at, because of absolute lack of knowledge of any graphical API and rendering in general.

  5. #5
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    490
    Quote Originally Posted by mhagain View Post
    It may also be the case that you have some very specific problems, you've chosen OpenGL as a solution, and ...
    ".... now you have two problems"

  6. #6
    Senior Member OpenGL Guru
    Join Date
    May 2009
    Posts
    4,948
    I said it before and I'll repeat - no matter how much you want it, no matter how much you think it's a "simple algorithm", if hardware cannot do it, then it's not a suitable feature.
    To be perfectly fair (even though this idea doesn't deserve it), it is entirely doable on 4.x-class hardware. The OpenGL implementation could use a compute shader to implement the division, write out the triangles to a buffer, and then feed that buffer in to the rendering pipeline.

    Now that's way too high level for OpenGL to do, and it's really stupid besides (since you can do it just once on the CPU). But it could be done.

  7. #7
    Intern Newbie
    Join Date
    Dec 2012
    Posts
    43
    ok,
    OpenGL should support concave polygons directly in the Graphics-Hardware.
    To render them is as easy as triangles.

  8. #8
    Intern Newbie
    Join Date
    Dec 2012
    Posts
    43
    OpenGL only support triangels in the hardware, because it is thought, that they
    are easylier to be renderd than concave polygons, but in fact, the concave polygons can be rendered as easy as triangles.

  9. #9
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,198
    Quote Originally Posted by LuisAK View Post
    ok,
    OpenGL should support concave polygons directly in the Graphics-Hardware.
    To render them is as easy as triangles.
    This is utterly meaningless.

    OpenGL cannot "support" anything "in the hardware". That's not the way things work.

    The way things work is roughly like this:

    Hardware has certain capabilities. These capabilities are decided by the hardware manufacturers with occasional input from others.

    OpenGL is a "software interface to graphics hardware". In other words, it provides a way to access those capabilities from software.

    Hardware manufacturers implement the OpenGL specification in their drivers. You make OpenGL calls. The driver converts those calls to something that the hardware understands, then passes them on to the hardware. The hardware executes the calls.

    But the fundamental requirement - that the hardware must support a feature - is absolutely nothing to do with OpenGL. It's entirely up to the hardware manufacturers.

    Do you see where this is going?

    There's no point whatsoever lobbying the OpenGL forums for this.
    There's no point whatsoever lobbying the ARB for this.

    The people you need to be talking to are the hardware manufacturers. You need to talk to AMD. You need to talk to NVIDIA. You need to talk to Intel. This is nothing to do with OpenGL; you need to ask the hardware manufacturers to support concave polygons in their hardware. And you need to persuade all of them to implement concave polygons in a consistent manner. Because otherwise you're just creating noise and wasting your own time. You want concave polygons? I've told you what to do. Go do it.

  10. #10
    Advanced Member Frequent Contributor
    Join Date
    Apr 2009
    Posts
    590
    I think itīs am easy algotythm which should be no problem.
    Actually it is not; triangulation of a closed non-intersecting line loop can still be tricky. I invite you to do a google search to see how deep the rabbit hole is for triangulation (admittedly triangulation of the fill of one closed line loop is much simpler than the triangulation of multiple potentially intersecting line loops). But to give you an idea, for triangulating a simple polygon, the simplest algorithm of "cutting ears" runs in O(n^2), using monotone polygons runs in O(n log n); getting faster than O(n log n) gives pretty damn complicated algorithms.

    I think the OP's issue is the following: the OP does not realize that OpenGL is not a library but rather a standardized interface to GPU's. I suspect once the OP learns that, the OP's posts won't be quite so bad.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •