Ogre-Next prevent mesh texture flickering when creating scene

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Lax
Gnoll
Posts: 665
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 64

Ogre-Next prevent mesh texture flickering when creating scene

Post by Lax »

Hi,

When I create a scene, I often observe blank items (without texture) and after a short amount of time the items will be covered asynchronously with textures. Is there a way to wait with the scene rendering, until preparation of all visual objects is finished?

What I also can observe is, that when I start a particle effect in realtime, the first time I also see first unpainted particle effect, which also will be covered with the proper texture after short amount of time. This always happens just the first time.

Best Regatds
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5476
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1358

Re: Ogre-Next prevent mesh texture flickering when creating scene

Post by dark_sylinc »

You can call textureGpuManager->waitForStreamingCompletion() every frame to prevent this.

At loading time, you can instead create a loading screen that covers everything (with a spinning circle), and instead of calling waitForStreamingCompletion() you can call every frame:

const bool bDone = textureManager->_update( true );
return bDone && textureManager->isDoneStreaming();

You can close the loading screen when bDone returns true.

Btw as a suggestion, keep a list of textures that you want to preload on startup. You don't have to wait for them, just let the texture stream in the background.

You can also speed up texture loading with the new textureGpuManager->setMultiLoadPool call (this is bleeding edge, there may be bugs, but so far I've found none or have already been fixed)

Cheers
Matias

Lax
Gnoll
Posts: 665
Joined: Mon Aug 06, 2007 12:53 pm
Location: Saarland, Germany
x 64

Re: Ogre-Next prevent mesh texture flickering when creating scene

Post by Lax »

Hi,

thanks, that will help a lot!

Best Regards
Lax

http://www.lukas-kalinowski.com/Homepage/?page_id=1631
Please support Second Earth Technic Base built of Lego bricks for Lego ideas: https://ideas.lego.com/projects/81b9bd1 ... b97b79be62