Sign in to follow this  

How to deal with coplaner polygons w/ same normal in csg union?

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I am trying to do csg union on all the brushes I have, and I'm a bit confused on what to do when two coplaner polygons have the same normal. If I just allow them z fighting occurs and for some reason the entire intersection gets clipped if I push the polygon on the back, down the bsp tree. I've found only one resource on this subject, and it doesn't explain very good what to do in this case. Any help is appreciated. *edited for terminology used* [Edited by - cmptrgy412 on June 15, 2006 8:01:12 PM]

Share this post


Link to post
Share on other sites
If you have two coplanar planes with the same normal, you don't have two planes - you have two copies of one plane. In that instance, just delete one of them and you're golden.

However, that's a little too trivial, so I'm guessing you're actually talking about a more specific scenario, e.g. with clipped (non-infinite) planes -- or something else?

Share this post


Link to post
Share on other sites
Yes, sorry, I used wrong terminology. They're actually two polygons that are coplaner. I was in a bit of a hurry.

Here's a screenshot. I removed the polygon closest to the viewer, and as you can see there are 4 border polygons that remain.

http://img154.imageshack.us/img154/2007/coplanerpolys4sa.jpg

Now what I'm confused about is should these be clipped or well, ok if split the polygon, which I haven't shown in the screen shot, so that there are the same polygons. Which do keep? If they were the same texture, I don't think it matters, but if the level editor has 2 different textures, which do I know to remove.

Share this post


Link to post
Share on other sites
AFAIK the usual solution is to elect a winner; this can be done really any way you like that makes sense. Surface area is usually a reasonably effective candidate, but it might screw up detailed areas; for best results make that configurable or whatever.

Once a winner is elected, clip all polygons in the winner's plane by the polygon itself - that is, subtract the winning polygon from each of the "losing" polygons in that plane, using a standard CSG subtraction. That ensures no Z-fighting occurs between overlapping polygons, without getting into extremely complicated (and sometimes unsolvable) polygon merges.

Share this post


Link to post
Share on other sites

This topic is 4200 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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