A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: A nifty sort+occlusion idea

  1. #1
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230

    A nifty sort+occlusion idea

    So, I was thinking of this idea where one could receive information on covered planes and the order the planes appear in one nifty algorithm. Tell me if you can find some major holes in this idea:

    First you get all your vertices and translate them to camera space/view space. Now project them onto the screen (this is assuming you have frustrum culled).

    Now, we create segments of each edge of each plane on our 2D projected surface. Each segment stores which face it was associated with and likewise the vertices associated with each face. Now we perform a super efficient line sweep and get all of the intersections with our segments.

    Now we shoot rays at all of the intersections and at all of the vertices in our viewspace (of course the rays would be going in the direction as would be following the viewers line of sight from that intersections pixel).

    We then collect the order the rays intersect through the planes for sorting. The intersection formula would not have to be calculated for every present plane. Since we organized which planes are where in relation to each other in the 2D space during our line sweep, we can narrow down the intersections considerably. Especially since we have each segment and vertex storing which faces they're associated with.

    Also since we have organized the triangles with the line sweep, we can see in the 2D space which faces are covered by other faces entirely so we can eliminate rendering them. (I havn't devised a sweet little method for this trick yet. But I'm working on it)

    So, let me know your thoughts on the subject. It should be a little bit of a challenge to implement but it might yield some interesting results. If you find problems with this please let me know so I don't waste several hours trying to implement a broken idea XP

  2. #2
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Ah nevermind. Scratch the idea. Look up BSP trees. This is the way to do it. Those suckers handle waaaay more than my idea ever could and waaaay more efficiently too. Though they are fairly complicated to understand.

  3. #3
    supervillain gerbick's Avatar
    Join Date
    Jul 2000
    Location
    undecided.
    Posts
    18,986
    Dude, you were setting yourself up for a complexity hell like no other. You'd have to track point of view, and hide what's not visible in such a realtime manner that you'd lose your religion almost.

    I can see it being done, but you'd be hitting the CPU like no other.

    But damn... I would have loved to have seen this done.

    [ Hello ] | [ gerbick ] | [ Ω ]

  4. #4
    Palindrome emordnilaP Diniden's Avatar
    Join Date
    Feb 2008
    Posts
    230
    Haha, it still does pique my interest to try out this method. I can see this method actually working only if it provided more information and it might. I just havn't figured out what that information is yet. If you can think of some interesting info this would provide, lemme know.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center