Archived

This topic is now archived and is closed to further replies.

haro

Simple Visibility Ordering Question

Recommended Posts

haro    502
I have a ROAM implementation. I want to implement a correct far to near visibility ordering. Here is how I am currently doing it: I start with the root nodes, I simply determine which node I am in. I render the other one first. As I traverse the tree I: 1. Take the current isoscelese right triangle. I treat the imaginary line which runs down the triangle from the apex to the midpoint of left/right vertices as a plane of 2 dimensions. I am assuming Y values should not matter. 2. Now I simply take the imaginary line and determine which side I lie on. If I lie on the side representing the left child of the original triangle, then I render the right child first, otherwise I render the left first. This is not working. What's the typical method for visibility ordering in ROAM type datastructures? [edited by - haro on March 29, 2004 4:13:06 AM]

Share this post


Link to post
Share on other sites
haro    502
I just developed another method. I take each triangle I am rendering. I then take the relative distance ( ie- no sqrt ) from the player position to the centroid that would be created from each triangle's children. I then return the difference of distance1-distance2. This determines if the player is closer to d1 or d2 depending on the sign. I use this to create a visibility ordering.

EDIT: This creates a near perfect visibility ordering, but its still wrong.

[edited by - haro on March 29, 2004 4:36:39 AM]

Share this post


Link to post
Share on other sites
haro    502
UPDATE: The centroid method works perfectly fine for ordering calculations. I made a few silly mistakes when I coded the algorithm at 4am.


[edited by - haro on March 29, 2004 8:38:28 PM]

Share this post


Link to post
Share on other sites
haro    502
quote:
Original post by JohnBolton
If you are using ROAM, then you have a binary triangle tree, which is a BSP tree. There is no need to compare distances.


I tried using the base plane as the partitioning plane, I also tried using the line which will split each node as the partitioning plane. Neither of these methods worked flawlessly which was my original question. Nobody mentioned the general method which was why I switched to the centroid method.

The centroid method also only requires a total of 8 subtractions and 4 multiplications.

Share this post


Link to post
Share on other sites
Contrast    122
As a general rule, I find that you will have more correct results with visibility ordering if you do it with only the pseudodepth (z-value of a projected vertex). After all, this is the only depth that the z-buffer cares about.

Share this post


Link to post
Share on other sites