[Solved] Static Geometry Z-Fighting

Problems building or running the engine, queries about how to use features etc.
Post Reply
Sgw32
Greenskin
Posts: 100
Joined: Mon Aug 30, 2010 9:35 am
x 11

[Solved] Static Geometry Z-Fighting

Post by Sgw32 »

Hello!

I have a bad issue for a long time.

Image

Image

All my geometry is a single static-geometry object. I started using this feature to boost-up my performance. It helped a lot, from 4 FPS to 40 on an old computer.
Unfortunately, I experienced after all a z-fighting on many brushes on screen. The problem only appears on static geometry. Problems affects thin objects and far objects.

Near clip is 10
Far clip is 100000

Increasing nearclip is possible, but not acceptable.
Decreasing farclip is sometimes also awful.

This string in code is looking important, but I don't know is it related to such type of problem.

Code: Select all

geom->setRegionDimensions (Vector3(100000, 100000, 100000));
The effect itself is looking very annoying, making game experience too bad, but lacking such type of optimization, it's not possible to play my game on some computers.

How to solve such static geometry flickering?

Thanks in advance.
Last edited by Sgw32 on Tue Mar 15, 2016 10:37 pm, edited 1 time in total.
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: Static Geometry Z-Fighting

Post by dark_sylinc »

What is your scale? centimeters? meters? kilometers? miles? yards?

Going from centimeters to e.g. meters could just solve the problem.
Sgw32
Greenskin
Posts: 100
Joined: Mon Aug 30, 2010 9:35 am
x 11

Re: Static Geometry Z-Fighting

Post by Sgw32 »

Hello!

My scale is my problem - it has a complex formula for it, and it is something near 100 units = 2 meters. It is very difficult to change it at that moment, because of constants in the engine.
Although, my problem is solved. The key was to change string:

Code: Select all

geom->setRegionDimensions (Vector3(1000000, 1000000, 1000000));
To

Code: Select all

geom->setRegionDimensions (Vector3(100000, 100000, 100000));
It doesn't solve problem at all, but makes things times better.

Thanks.
Post Reply