Flicker back with ATI Radeon9000
by Brandon Maness · in Torque Game Engine · 04/28/2005 (5:24 pm) · 13 replies
The flicker that occurs when outside on the terrain and moving faster than a slow nudge has returned. It is shadow and terrain related because it does not happen when inside. Another interesting note is that it only happens when the detain level is 1 thru 6. At the minimum level there is no flicker.
Also this is an openGL driver issue with an ATI Radeon9000 card as the DirectX driver does not flicker. This would be great, but in DirectX mode the cursor lags alot.
I traced the detail level setting changes to sgLightManager.cc and have started poking around to see if there was something different from previous versions. What makes me curious is that in previous versions the shadowing was equivilant to about a detail setting of 3 and had no problems. Now all shadow detail settings except the lowest cause the terrain flicker.
Any help pointing me in the general dirrection or insight would be helpful.
Thanks,
Brandon.
Also this is an openGL driver issue with an ATI Radeon9000 card as the DirectX driver does not flicker. This would be great, but in DirectX mode the cursor lags alot.
I traced the detail level setting changes to sgLightManager.cc and have started poking around to see if there was something different from previous versions. What makes me curious is that in previous versions the shadowing was equivilant to about a detail setting of 3 and had no problems. Now all shadow detail settings except the lowest cause the terrain flicker.
Any help pointing me in the general dirrection or insight would be helpful.
Thanks,
Brandon.
About the author
#2
console log
I initially had problems with the flicker in TGE 1.3 and the original lighting pack, but I updated drivers and resolved the issue. I'm currently using catalyst 5.3 from DNA. I went back and checked all versions I have, and found no flickers in any other versions. I also checked the openGL dll's. I noticed the openGL2d3d.dll was slightly larger, so just for fun I copied the previous lighting packs dll in there. To my surprise it didn't crash, but still had the flicker.
I have spent some time browsing through the code in shadow.cc, sgLighting.cc, etc.. At first I thought I would find a call to a different openGL routine when compared to the old version, but no luck.
Here is what I have noticed so far:
1. If you tap forward and move slowly it will not flicker.
2. spinning around in 3rd person won't create the flicker, only movement.
3. When it does flicker, only the segment of the shadow bitmap flickers, and only when the model is touching the ground. Also during the flicker all of the underlying terrain texture is there and visible, just dark, but less dark than the actual shadow.
4. Running at lowest detail stops flicker.
5. When it does start to flicker it lasts for about half a second if you stop moving. I played around with seeing how fast I could move the character without causing the flicker so that I could see if the models continued movement was a part of the problem. I don't think it is.
With that in hand here were my thoughts:
When shadow.cc creates the temp shadow bitmap and registers it with the texture manager something must be happening to the shadow texture to screw with the alpha from it to darken it.
The shape of the flicker is consistent with the temp bitmap created for the shadow, and not the terrain shape itself.
I'm sure drivers are a factor, but like you it would be nice to at least find the culprit of this bug!! I hope that helps, I'm gonna keep poking around the code to see if I can learn more.
Let me know if ya have any advice, or need anything.
Brandon.
04/28/2005 (9:12 pm)
Thanks for the quick reply! Here is what I've got:console log
I initially had problems with the flicker in TGE 1.3 and the original lighting pack, but I updated drivers and resolved the issue. I'm currently using catalyst 5.3 from DNA. I went back and checked all versions I have, and found no flickers in any other versions. I also checked the openGL dll's. I noticed the openGL2d3d.dll was slightly larger, so just for fun I copied the previous lighting packs dll in there. To my surprise it didn't crash, but still had the flicker.
I have spent some time browsing through the code in shadow.cc, sgLighting.cc, etc.. At first I thought I would find a call to a different openGL routine when compared to the old version, but no luck.
Here is what I have noticed so far:
1. If you tap forward and move slowly it will not flicker.
2. spinning around in 3rd person won't create the flicker, only movement.
3. When it does flicker, only the segment of the shadow bitmap flickers, and only when the model is touching the ground. Also during the flicker all of the underlying terrain texture is there and visible, just dark, but less dark than the actual shadow.
4. Running at lowest detail stops flicker.
5. When it does start to flicker it lasts for about half a second if you stop moving. I played around with seeing how fast I could move the character without causing the flicker so that I could see if the models continued movement was a part of the problem. I don't think it is.
With that in hand here were my thoughts:
When shadow.cc creates the temp shadow bitmap and registers it with the texture manager something must be happening to the shadow texture to screw with the alpha from it to darken it.
The shape of the flicker is consistent with the temp bitmap created for the shadow, and not the terrain shape itself.
I'm sure drivers are a factor, but like you it would be nice to at least find the culprit of this bug!! I hope that helps, I'm gonna keep poking around the code to see if I can learn more.
Let me know if ya have any advice, or need anything.
Brandon.
#3
The footstep decal fading in seems related... I remember reading that somewhere around here, so it is also true in this case.
Also, I updated to the 5.4 catalyst with no change across the board.
*** When I load a mission I have created with my custom terrain I get no flicker.?.? Figure that out! :) Too weird!
B--
04/28/2005 (9:42 pm)
Another note:The footstep decal fading in seems related... I remember reading that somewhere around here, so it is also true in this case.
Also, I updated to the 5.4 catalyst with no change across the board.
*** When I load a mission I have created with my custom terrain I get no flicker.?.? Figure that out! :) Too weird!
B--
#4
What platform are you running (Windows or Linux)? I'll upload the old 1.3 demo to the Synapse Gaming site, so you can try it out to see if it also had the bug.
Is the problem happening when the player shadow is near a dynamic light, or anywhere on the terrain (does it happen in the unaltered TGE demo mission shipped with the Lighting Pack)?
Oh, and it's happening with the orc player provided in the Lighting Pack, right?
04/29/2005 (9:03 am)
Ok, I'm confused you originally posted something about the scripts being a problem, should I ignore that info, because I don't see it anymore? If so is it happening all of the time with the Lighting Pack 1.3.2 binaries, even the pre-compiled demos? What platform are you running (Windows or Linux)? I'll upload the old 1.3 demo to the Synapse Gaming site, so you can try it out to see if it also had the bug.
Is the problem happening when the player shadow is near a dynamic light, or anywhere on the terrain (does it happen in the unaltered TGE demo mission shipped with the Lighting Pack)?
Oh, and it's happening with the orc player provided in the Lighting Pack, right?
#5
I'm running WinXP, and the flicker happens when outside with the sun as the primary light source and the Orc player as the model.
Here is what has me baffled:
To start with everything is stock (TGE & Lighting pack & Orc village mission)
I updated my video drivers to the new 5.4 Catalyst
---> This updated driver causes the flicker to return to all prior versions of TGE and lighting pack, the old drivers I had installed only flickered with the new lightning pack but here is the reason I stuck with them...
If you create a new mission with a custom terrain file the flicker goes away.?.? So I've been trying to figure out what exactly the difference is.
I've tried starting with the Orc Village mission and changing the terrain, but it still flickers. (I also saved and reloaded the mission to make sure that it just didn't need to be restarted).
Then I created a new mission with the same custom terrain I applied to the Orc Village and it had no flicker. So then I went in and pasted all the objects from the Orc Village into the new mission and still had no flicker. I then lowered all the objects in the new mission to the ground and did a relight and still had no flicker.
No matter what I try it seems like the terrain file with the Orc mission is a factor in the flickering (at least with the latest ati drivers 5.4)
What I can't seem to figure out is why a new mission with custom terrain does not flicker, but the Orc mission with the same custom terrain applied does flicker...
For testing purposes I had everything as stock as possible.
The good news is when you make a new mission with custom terrain the flicker goes away. (at least on this system)
Any ideas why?
Brandon.
04/29/2005 (10:41 am)
John: I erased the script post because after pasting everything across I discovered it was not the scripts but the mission file.I'm running WinXP, and the flicker happens when outside with the sun as the primary light source and the Orc player as the model.
Here is what has me baffled:
To start with everything is stock (TGE & Lighting pack & Orc village mission)
I updated my video drivers to the new 5.4 Catalyst
---> This updated driver causes the flicker to return to all prior versions of TGE and lighting pack, the old drivers I had installed only flickered with the new lightning pack but here is the reason I stuck with them...
If you create a new mission with a custom terrain file the flicker goes away.?.? So I've been trying to figure out what exactly the difference is.
I've tried starting with the Orc Village mission and changing the terrain, but it still flickers. (I also saved and reloaded the mission to make sure that it just didn't need to be restarted).
Then I created a new mission with the same custom terrain I applied to the Orc Village and it had no flicker. So then I went in and pasted all the objects from the Orc Village into the new mission and still had no flicker. I then lowered all the objects in the new mission to the ground and did a relight and still had no flicker.
No matter what I try it seems like the terrain file with the Orc mission is a factor in the flickering (at least with the latest ati drivers 5.4)
What I can't seem to figure out is why a new mission with custom terrain does not flicker, but the Orc mission with the same custom terrain applied does flicker...
For testing purposes I had everything as stock as possible.
The good news is when you make a new mission with custom terrain the flicker goes away. (at least on this system)
Any ideas why?
Brandon.
#6
04/29/2005 (10:47 am)
Can you post both of the mission files? I want to look at the differences to see if anything stands out.
#7
Here is the .ter file and blank mission that does not flicker. I had pasted all of the objects form the orc village into it to see if it would flicker, but it did not.
mission and terrain file
I have noticed that the stock .ter file used by the orc village demo has a ground level quite a bit higher than if you make one form scratch. If someone knew where the original .bmp or .png file was that made the .ter file used in the orc village it would be interesting to remake it with the updated engine to see if the flicker would stop.
Brandon.
04/29/2005 (1:11 pm)
John: The first mission file is the one that comes with your lighting pack. I could not get it to stop flickering unles I replaced the .ter file.Here is the .ter file and blank mission that does not flicker. I had pasted all of the objects form the orc village into it to see if it would flicker, but it did not.
mission and terrain file
I have noticed that the stock .ter file used by the orc village demo has a ground level quite a bit higher than if you make one form scratch. If someone knew where the original .bmp or .png file was that made the .ter file used in the orc village it would be interesting to remake it with the updated engine to see if the flicker would stop.
Brandon.
#8
If you have an ATI Radeon card and want to see if this makes the flicker go away, simply go to your windows\system32 folder and rename your existing file to atioglxxoriginal.dll and then copy the dll you got from the link to the same location. You can always delete the one you tried, and rename your original file back to its original name. I Hope this helps anyone who is annoyed with the flicker!
Note: attempt this at your own risk! It does not require a reboot, and should be a piece of cake, but as always, attempt at your own risk. Here is the dll that worked for me.
ATI openGL driver file
Brandon.
05/02/2005 (1:04 pm)
Update: Here is the atioglxx.dll driver file I have found that eliminates the flicker, it is located in the windows\system32 folder. The is version # 6.14.10.3541If you have an ATI Radeon card and want to see if this makes the flicker go away, simply go to your windows\system32 folder and rename your existing file to atioglxxoriginal.dll and then copy the dll you got from the link to the same location. You can always delete the one you tried, and rename your original file back to its original name. I Hope this helps anyone who is annoyed with the flicker!
Note: attempt this at your own risk! It does not require a reboot, and should be a piece of cake, but as always, attempt at your own risk. Here is the dll that worked for me.
ATI openGL driver file
Brandon.
#9
I'll keep you posted on my progress.
05/02/2005 (2:13 pm)
I'm still trying to create the flicker. :) I'm going to upgrade my drivers to see if that's causing the problem, then from there it should be easy to tweak the shadow code to eliminate it. I suspect that the issue is related more to other code not properly setting the default OpenGL states, and not the shadow code itself, because the shadow rendering code is identical to the TGE code only the code that generates the shadow texture was updated.I'll keep you posted on my progress.
#10
As an update for you: I made a mistake when I told you the new version caused the flicker bug to return. Here is what happened:
Months ago I purchased the TGE and noticed the flicker. I played around with numerous driver dll files until I found one that got rid of the flicker. Then I started developing with TGE. I used my own terrain file, so progress has been ongoing since then. About a month ago I updated video drivers, and did not notice the flicker returning (remember: I was using my own terrain file in the project). Then you released your lighting pack update, and I noticed the flicker. I loaded my other .exe versions of TGE and did not see the flicker, but these previous versions were running my terrain file, so then I loaded my mission with custom terrain into your new .exe it also had no flicker.
The only reason the new exe caused the flicker for me was because all other versions of TGE I had were running my custom terrain. When I replaced the stronghold.ter file with my custom .ter the flicker stopped.
When I went back and loaded the previous TGE versions with the default mission terrain the flicker was there. The only reason I thought it was not is was because I was running my custom terrain files on those previous versions.
So what I have discovered so far is this:
1. For stock TGE missions like Stronghold with the stock stronghold.ter file a dll swap fixes the problem.
2. Custom terrain files fix the flicker problem without a driver swap.
I'm not so sure your update or any part of TGE is the problem here... After a few days of testing I think it is ATI driver related, that is why I posted the update and the version of atioglxx.dll that worked for me.
Hope that helps explain what I've learned over the last few days. I do think it is odd why the stock terrain that ships with TGE causes flicker, but any custom terrain you create does not cause the flicker.
Brandon.
05/02/2005 (2:38 pm)
@John: In regards to creating the flicker: What type of video card do you have?As an update for you: I made a mistake when I told you the new version caused the flicker bug to return. Here is what happened:
Months ago I purchased the TGE and noticed the flicker. I played around with numerous driver dll files until I found one that got rid of the flicker. Then I started developing with TGE. I used my own terrain file, so progress has been ongoing since then. About a month ago I updated video drivers, and did not notice the flicker returning (remember: I was using my own terrain file in the project). Then you released your lighting pack update, and I noticed the flicker. I loaded my other .exe versions of TGE and did not see the flicker, but these previous versions were running my terrain file, so then I loaded my mission with custom terrain into your new .exe it also had no flicker.
The only reason the new exe caused the flicker for me was because all other versions of TGE I had were running my custom terrain. When I replaced the stronghold.ter file with my custom .ter the flicker stopped.
When I went back and loaded the previous TGE versions with the default mission terrain the flicker was there. The only reason I thought it was not is was because I was running my custom terrain files on those previous versions.
So what I have discovered so far is this:
1. For stock TGE missions like Stronghold with the stock stronghold.ter file a dll swap fixes the problem.
2. Custom terrain files fix the flicker problem without a driver swap.
I'm not so sure your update or any part of TGE is the problem here... After a few days of testing I think it is ATI driver related, that is why I posted the update and the version of atioglxx.dll that worked for me.
Hope that helps explain what I've learned over the last few days. I do think it is odd why the stock terrain that ships with TGE causes flicker, but any custom terrain you create does not cause the flicker.
Brandon.
#11
Thanks for the update, that makes a lot more sense though the custom terrain thing is a little weird.
I'm concerned that the issue (even if it is ATI's drivers) will make supporting your game more difficult for you, so I'll continue to look into the problem.
Can you do me a favor there's a line of code you can alter to adjust the shadow depth, and I'm curious to see how far the value needs to go for the bad drivers to work correctly.
The code is in 'game/shadow.cc' at line 541:
Can you continue to adjust both -2s lower until the flickering goes away, and then let me know what the final value is?
Also, do dynamic lights look ok with the bad driver?
Thanks!
-John
05/04/2005 (3:21 am)
Hi Brandon,Thanks for the update, that makes a lot more sense though the custom terrain thing is a little weird.
I'm concerned that the issue (even if it is ATI's drivers) will make supporting your game more difficult for you, so I'll continue to look into the problem.
Can you do me a favor there's a line of code you can alter to adjust the shadow depth, and I'm curious to see how far the value needs to go for the bad drivers to work correctly.
The code is in 'game/shadow.cc' at line 541:
glPolygonOffset(-2,-2);
Can you continue to adjust both -2s lower until the flickering goes away, and then let me know what the final value is?
Also, do dynamic lights look ok with the bad driver?
Thanks!
-John
#12
Well, I changed the offset values about a dozen times ranging from from 0,0 to -24, -24 with no change, except anything above -2 caused lines in the shadow, but there was still a flicker in the area encompassing the shadow.
There doesn't seem to be any probems with dynamic lights in interiors, I'm not sure about dynamic lights on the terrain, because it flickers all the time there.
I have noticed that the footsteps already on the terrain don't cause flicker, but at the moment when a new footstep decal is added to the terrain you get about 40 flickers lasting 1 second. That makes me want to poke around the footstep decal routine and see if it isn't temporarily changing a setting that would contribute to the problem.?.?
Also another interesting note is that if your walking through the edge transparency of the water the flicker stops and the shadow looks great on the water showing through to the ground with the footstep decals. As soon as you leave the edge of the water the flicker returns. That makes me wonder what the edge of the water code is doing to fix the flicker?
Hope that helps point you in the right direction. If you still have not been able to produce the flicker, you might want to try changing your atioglxx.dll in your system32 folder. If you need different versions of it I have about 5 or 6. Oddly enough, it's the oldest one that fixes the flicker.
Brandon.
05/04/2005 (9:15 am)
John:Well, I changed the offset values about a dozen times ranging from from 0,0 to -24, -24 with no change, except anything above -2 caused lines in the shadow, but there was still a flicker in the area encompassing the shadow.
There doesn't seem to be any probems with dynamic lights in interiors, I'm not sure about dynamic lights on the terrain, because it flickers all the time there.
I have noticed that the footsteps already on the terrain don't cause flicker, but at the moment when a new footstep decal is added to the terrain you get about 40 flickers lasting 1 second. That makes me want to poke around the footstep decal routine and see if it isn't temporarily changing a setting that would contribute to the problem.?.?
Also another interesting note is that if your walking through the edge transparency of the water the flicker stops and the shadow looks great on the water showing through to the ground with the footstep decals. As soon as you leave the edge of the water the flicker returns. That makes me wonder what the edge of the water code is doing to fix the flicker?
Hope that helps point you in the right direction. If you still have not been able to produce the flicker, you might want to try changing your atioglxx.dll in your system32 folder. If you need different versions of it I have about 5 or 6. Oddly enough, it's the oldest one that fixes the flicker.
Brandon.
#13
The old atioglxx.dll still fixes the flicker and keeps the foot puffs, so... I'm currently looking around the emmiter section of code.
B--
05/04/2005 (5:16 pm)
@John: Update for ya; I traced the flicker down to the foot puff emitter. That is why it lasted for about a second: the time it took for the emitter to go away. That also explains why the flicker stopped when on the edge of water. And my custom levels did not have foot puffs, so it was not the terrain, but the emmiter.The old atioglxx.dll still fixes the flicker and keeps the foot puffs, so... I'm currently looking around the emmiter section of code.
B--
Torque Owner John Kabus (BobTheCBuilder)
Do you have updated drivers, I develop on two 9600XT cards (on Windows and Mac). My driver versions are Catalyst: 5.1 and Package: 8.09-041221m-020455c (whatever that means :).
This has been a huge bug in TGE for a while, so it would be very cool to track this down. Here's a few questions:
You're sure it worked before (with Lighting Pack 1.3)?
Does the demo of 1.3.2 have the same problem?
Can you grab the info from your console.log (size, bitdepth, ..., I'd like to compare the same settings here)?
Thanks!
-John