Author Topic: Loss of data due to sleep or ctrl-alt-delete (Windows)  (Read 103 times)

tim b   «   on: August 18, 2012, 02:51:01 PM »
Hi

I'm working on a game using Flare3D (http://timbudds.info/armis).  I know that when a user's computer 'sleeps' (at least in Windows) or when (s)he presses ctrl-alt-delete (again in Windows) the Context3D can get lost, and has to be recreated afterwards.  I'm finding a small amount of visual disruption when this happens - specifically, one mouseover function which adds a filter to a game piece's material;  after a context3d loss event, sometimes the material doesn't render at all and the piece becomes invisible when mouseover'ed.  I can't see anything in the function which would make it unusual and lead to this behaviour.  Nothing else seems to be affected.  I've tried listening for a CONTEXT3D_CREATE event, which does fire, and recreating materials after that, but that doesn't help.  I'm just wondering if there's any information on what data gets lost when you lose a Context3D like this.  Thanks.

Ivan Vodopiviz   «   Reply #1 on: August 21, 2012, 12:16:22 PM »
This is unfortunately a known issue. Since your material is only used during mouse over, it might happen that it isn't attached to any object, it might not get restored when the context itself is recreated. This is already solved for the next Flare3D version, but for the time being, you can re-upload the material by hand whenever you get a CONTEXT3D_CREATE event. Just call:

material.upload( scene );

And your problem should be solved. Please note that there's no need to actually recreate the materials themselves since those are preserved by Flare3D no matter what, you just need to reupload the problematic ones by hand to the GPU.

Cheers,