Game Development Community

Screwed lightmaps when Alt-Tabing and Caching is off.

by Stefan Lundmark · in Torque Game Engine · 11/14/2004 (8:05 am) · 34 replies

This problem applies to 1.2.2 (haven't tried it on 1.3 yet but there are no changes made that suggest that this have been fixed).

If you alt-tab out of your game, and go back in.. the game won't render any lightmaps at all. Putting a relight command in the code when you maximize the game again, solves the problem. The console also reports an error that lightmaps cannot be loaded.

This does only happen when you have caching set to off, as far as our testing has shown, anyway.
Page «Previous 1 2
#1
11/14/2004 (1:09 pm)
Mysterious. That's certainly a bug. :)

What change did you make to turn caching off?
#2
11/14/2004 (1:28 pm)
@ client/prefs.cs
$pref::sceneLighting::cacheLighting = 0;

The lighting file is generated but always kept 0 bytes.
The lighting works when you execute the game, but not when you get back from minimizing it.

Hope this helps.
#3
11/14/2004 (10:15 pm)
Wild. Let me know what you find out. Maybe it's not keeping the GBitmaps around to reupload to the video card?
#4
11/15/2004 (4:35 am)
Ya, that seems like the case. It doesn't keep the lightmaps in memory after they have been rendered for when initializing the game. The texture manager doesn't have them, that's for sure.

But why are they deleted when you alt-tab out and back in? Sounds odd.

I guess that's why it works when you cache them, because they are there for the texture manager to pick each time.

#1086 @ SceneLighting.cc
if(flags.test(LoadOnly))
      {
         Con::errorf(ConsoleLogEntry::General, "Failed to load mission lighting!");
         return(false);
      }

At least, that's where it stops.
#5
11/15/2004 (10:45 am)
Is there any particular reason why you have to have caching off?
#6
11/15/2004 (1:43 pm)
No, it was to test the loading sequence we made.. and the longer loading the better, just to test.

I don't think this is really a big problem, just wanted to point it out as it might had been easy to fix. I have no opinion on that, you know ;)
#7
11/15/2004 (2:30 pm)
Ahh, gotcha. I wasn't sure if you were blocking on the problem or not. :)

I'll add this to my list of Stuff To Look At.
#8
08/09/2005 (1:08 am)
Can't reproduce it. :(
#9
08/09/2005 (3:15 am)
I'll see if I can find the old build on one of the backups and start it.

Okay, here we go. At first, I thought it had disappeared but I managed to reproduce it in 1.3 Stock.

Make sure you're running fullscreen, caching off. Then delete the .ml files for that mission.
Go inside the mission, alt-tab out.. alt-tab back in. Woala, lightmaps gone and a little red error message in the console.
#10
08/09/2005 (4:28 pm)
Wait... so you're saying that if you delete a .ml file out from under Torque while it's running, you'll get weird behavior?
#11
08/09/2005 (4:52 pm)
No. Delete them before you enter the game at all.

When you alt-tab out, the lightmaps are dropped from memory (I guess). Then when you head back in, the game looks for the .ml file to read the lightmaps from, but it can't find it. Thus shows the error and gives you nice white buildings :)
#12
08/09/2005 (9:57 pm)
Can't seem to get this to reproduce... Can anyone else?
#13
08/10/2005 (4:06 am)
Odd. I can reproduce it on two different computers here running Stock 1.3.

OpenGL. Fullscreen. Caching off. Delete .ml files before executing the game.

Edit: You really only have to delete the .ml files once and it will behave this way every time you start it, after that.
#14
08/10/2005 (4:20 am)
Does CVS HEAD exhibit the same problem?
#15
08/10/2005 (5:06 am)
I'll have to checkout HEAD then. Give me a few.

Quote:
Does CVS HEAD exhibit the same problem?

It does.
#16
08/10/2005 (6:03 am)
I cant reproduce this either Stefan !
I do like this ,cachelightning = 0 , delete the .ml files ,start the mission,press ALT-Tab
back in to the game and the lightmaps still are there.
leaving game checking the .ml file that is 0kb ,restarting the game and ALT-Tab again and it still works every time.
Is this the way you do to test this ?
#17
08/10/2005 (6:09 am)
Yup, that's precisely the way I'm testing it. Very odd!

I even switched GPU from my GeForce 6800 to my old TNT and the same problem is there.

Are you guys really running in fullscreen by the way? :) The lightmaps don't get flushed in Windowed, I think.
#18
08/10/2005 (6:13 am)
Yup fullscreen ,winxp pro, 2 diff comps , with 2 diff graphicCards GeForce.
#19
08/10/2005 (6:24 am)
That's so odd! This is what I get:

Quote:
Failed to load mission lighting!

'Before' and 'After' screenshots:

www.innercircledev.net/before.jpgwww.innercircledev.net/after.jpg
Edit: Corrected quote tag.

Second Edit:

I tried looking around main.cc and WinOGLvideo.cc and tried to switch off the KillTextureManager and Resurrect calls, but it didn't make any difference.

But if this only happens on the two workstations here, then I guess they are incorrectly configured :S
#20
08/10/2005 (6:48 am)
You are right here Stefan
Tested with Head from 0507 and got the same thing as shown on your screens.
I was first testing this in my own version with some fixes from Clint.S.Brewer and then i couldn't reproduce it.
So i cant say if this is the interior fix from clint that makes this work.
I try to add Clints interiorfix to head and see if this make any differens.
Page «Previous 1 2