Jump to content

ObjectGrass drastical fps drop while using mask


photo

Recommended Posts

Hello

 

 

We have the following problem while using ObjectGrass:

 

We created an ObjectGrass with a mask for it (4097x4097, total size 48 Mb).

While walking on the terrain with the PlayerSpectator the game engine stops for 1 second and fps goes nearly 0.

There is no frame update and it seems engine is freezing for this moment.

 

We searched for hours what could be the cause of this. Then we removed the mask image and the problem was gone.

I think in some intervals the engine reloads the mask image and causes a lock while waiting for an i/o-operation.

 

If you need the scene to test, we can upload it somewhere.

 

 

Greets

Manuel

Link to comment
  • 3 weeks later...

Quick-and-dirty work-around to avoid render stalls caused by grass mask unload/reload until availability of better UNIGINE solution.

 

Add following UNIGINE script code to your world update() method

int update() {
.....
   ObjectGrass grass = node_cast(engine.editor.getNodeByName("grass"));

   if( grass != 0 )
   {
       grass.getMaskImage(); // this will 'touch' mask image and avoid unloading
   }
.....
}

Same approach can be used for locking WorldClutter and WorldOccluderTerrain images.

Link to comment

Quick-and-dirty work-around to avoid render stalls caused by grass mask unload/reload until availability of better UNIGINE solution.

 

Add following UNIGINE script code to your world update() method

int update() {
.....
   ObjectGrass grass = node_cast(engine.editor.getNodeByName("grass"));

   if( grass != 0 )
   {
       grass.getMaskImage(); // this will 'touch' mask image and avoid unloading
   }
.....
}

Same approach can be used for locking WorldClutter and WorldOccluderTerrain images.

 

After a first test it seems to work!

Thank you so much for the solution :)

Link to comment
×
×
  • Create New...