stephen-hqxu / superterrainplus

SuperTerrain+: A real-time procedural 3D infinite terrain engine with geographical features and photorealistic rendering.
MIT License
12 stars 1 forks source link

Object flickering #34

Closed stephen-hqxu closed 2 years ago

stephen-hqxu commented 2 years ago

Problem

When new chunks are being loaded, sometimes, some objects, mostly the terrain, turns black for a couple of frames before returning to normal.

Testing shows it flickers more frequently when the rendering task is heavy. To reproduce, set the FPS limit to as high as possible and turn up the atmopheric scattering quality to very high, and the objects flickers constantly.

stephen-hqxu commented 2 years ago

Fixed

It is as simple as adding a glFinish() function before swapping buffer, because I was assuming swap does implicit sync but actually it does not.