November 30, 2020, 01:59:42 AM

Author Topic: Flickering Meshes at extreme distance.  (Read 2320 times)

Offline MagosDomina

  • Full Member
  • ***
  • Posts: 121
    • Aspiring game developer website.
Flickering Meshes at extreme distance.
« on: September 21, 2017, 01:29:00 AM »
Usually such an anomaly is caused by two faces of a mesh occupying either the same location or if they are in very close proximity to each other. I have it now occasionally happening when a large amount of meshes are drawn on screen. Its not any of my meshes themselves as I was very careful to trim out an unneeded faces that would never be shown to the player.

What I am observing is the lighting and occasionally mesh itself flickering, as if it cannot decide if its in the foreground or not.

Can a large draw distance affect the lighting? This seems a bit strange to me since I only use a single world Light. What about scaling? Is the 3d engine working too hard to calculate accurate lighting? I wonder if implementing a culling system would solve this? I know Blitz3d only draws what is seen and a basic LOD system but something is still not working right here. Is there an easy way to change the color of the void? Which by default is black.

I may be answering my own question here but I always enjoy insight provided by others. My theory is that my simulation is having trouble with calculating the extreme distances, as I have not implemented any sort of Homecoming solution yet. Meaning the world needs to move around the player, with everything re-positioning itself correctly since the player character technically never leaves location 0,0,0.

To the best of my knowledge almost every (if not all) flight simulators are coded in such a way. Am I on the right track here or totally off?
Central hub for my Game Design related activities.
http://www.magosdomina.com/

Windows 7 PRO 64-bit, 48Gb RAM, CPU: Dual Hexacore Intel Xeon 3.33 GHZ, Nvidia Quadro 5800FX 4Gb x 2 SLI.

Offline RonTek

  • Sr. Member
  • ****
  • Posts: 357
Re: Flickering Meshes at extreme distance.
« Reply #1 on: September 21, 2017, 03:35:58 AM »
You can try reducing your camera near range say 0.001 and/or scale your scene and models down. A decent far range also would be better afaik.

Offline Xaron

  • Sr. Member
  • ****
  • Posts: 313
Re: Flickering Meshes at extreme distance.
« Reply #2 on: September 21, 2017, 06:37:35 PM »
That's a pretty common problem. Graphic cards, especially not the latest ones have a z buffer with floating point precision which means that you simply have rounding issues which can lead to that unwanted behavior.

Offline MagosDomina

  • Full Member
  • ***
  • Posts: 121
    • Aspiring game developer website.
Re: Flickering Meshes at extreme distance.
« Reply #3 on: September 22, 2017, 03:52:13 AM »
I figured out the cause after noticing the flickering happened much less often without Vsync enabled. The ground layer was competing with the CameraCLSColor. When I got rid of the ground layer I could fly as high and far as I wanted with no meshes glitching. Setting the ground layer Entity Order to 1 to match the skybox allowed me to have the ground back without the anomaly as described above.

To clarify I wasn't talking about the usual artifacts you get within the Z buffer. The issue that was occurring was the meshes appeared to be flickering in and out of existence at far distances.
Central hub for my Game Design related activities.
http://www.magosdomina.com/

Windows 7 PRO 64-bit, 48Gb RAM, CPU: Dual Hexacore Intel Xeon 3.33 GHZ, Nvidia Quadro 5800FX 4Gb x 2 SLI.

Offline RemiD

  • Hero Member
  • *****
  • Posts: 1077
Re: Flickering Meshes at extreme distance.
« Reply #4 on: November 13, 2017, 05:32:29 PM »
Yes, i have seen a similar issue, and sometimes you have to use entityorder for far way meshes like a skybox, terrainbox, horizonfog, sun, moon...

If you want to have a far view range, a good approach is to render the scene in several passes, this way the camerarange "ratio" stays small enough (for example : one render with a camerarange of 100->100 000 (ratio=1000) and then one render with a camera range of 0.1->100 (ratio=1000))

DualCore AMD E-450, 1646 MHz - 6 Go DDR3 1333 SDRAM - AMD Radeon HD 6320 Graphics (384 Mo) - Windows 7 Home Premium - DirectX 11.0

Offline col

  • Sr. Member
  • ****
  • Posts: 466
Re: Flickering Meshes at extreme distance.
« Reply #5 on: November 18, 2017, 07:46:51 PM »
This link more than likely explains the real reason ;)
https://developer.nvidia.com/content/depth-precision-visualized
To be is to be perceived.

https://github.com/davecamp

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal