Crystal Space
Welcome, Guest. Please login or register.
September 01, 2014, 09:17:10 am

Login with username, password and session length
Search:     Advanced search
9009 Posts in 2043 Topics by 8369 Members
Latest Member: Riripark
* Home Help Search Login Register
+  Crystal Space
|-+  Crystal Space Development
| |-+  Support
| | |-+  Polygon z-fighting issues
« previous next »
Pages: [1] Print
Author Topic: Polygon z-fighting issues  (Read 1076 times)
eventhorizon5
Jr. Member
**
Posts: 53


View Profile WWW
« on: December 10, 2009, 05:18:19 am »

Hi,

I'm having an issue with polygons z-fighting when they're placed at positions usually further than 1500 units in any direction, with the camera always at the same distance from the polygons (this is not related to view distance).  In an example test, two polygons are spaced 0.01 units apart (let's say the camera's 10 units away from them), and if they're centered at 0,0,0, they look fine.  But if you move both their mesh and the camera to an X position of 1500 for example, the polygons start overlapping, seemingly due to some sort of position rounding.  This doesn't seem to be related to the internal vertex compression (unless compression is performed each time the meshes are moved).  I'm thinking of possibly changing the unit scale to deal with this issue (right now 1 3D unit is 1 foot - should probably use something like 10 meters instead).  Has anyone else experienced this issue?

-eventhorizon
Logged
res
Develazyoper
CS Developer
Full Member
*****
Posts: 206


View Profile Email
« Reply #1 on: December 10, 2009, 12:55:59 pm »

Z-fighting is a technical limitation you have to work with. CS 1.9 gives you some more flexibility as you can control the perspective matrix with it manually (and hence choose a matrix with a more limited depth range, but better 'separation' at distance) but fundamentally the problem won't go away.
Logged
eventhorizon5
Jr. Member
**
Posts: 53


View Profile WWW
« Reply #2 on: December 11, 2009, 08:09:29 pm »

Z-fighting is a technical limitation you have to work with. CS 1.9 gives you some more flexibility as you can control the perspective matrix with it manually (and hence choose a matrix with a more limited depth range, but better 'separation' at distance) but fundamentally the problem won't go away.

Thanks for that info - yesterday I made an internal coordinate rescaler to deal with that problem, and it worked (at least with the distant positions that are currently used - currently rescales at a 5:1 ratio, the 1 being a single GL coordinate unit).  One issue I've noticed with high ratios is that the frustum culling seems to go crazy - I tried finding a way to change/rescale the view frustum, but couldn't find anything.  I'm attaching a pic showing what things look like at a 100:1 ratio (everything near the camera is clipped).

-eventhorizon


* issue.jpg (31.5 KB, 641x481 - viewed 144 times.)
Logged
Pages: [1] Print 
« previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.2 | SMF © 2006-2007, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 6.228 seconds with 16 queries.