Atlas terrain texture looks strange on mission load
by Josef Froschauer · in Technical Issues · 05/04/2009 (7:01 am) · 4 replies
Hi,
I added an ATLAS terrain to my mission, but every time I load the mission, the ground textures look really strange. When I hit F11 twice (for opening and closing the editor) everything looks fine again. Here are 2 screenshots so you can understand what I mean.
http://www.itchy-feet.org/wp-content/gallery/itchy-feet/shot1.jpg
http://www.itchy-feet.org/wp-content/gallery/itchy-feet/shot2.jpg
Does anybody know, why this is?
I added an ATLAS terrain to my mission, but every time I load the mission, the ground textures look really strange. When I hit F11 twice (for opening and closing the editor) everything looks fine again. Here are 2 screenshots so you can understand what I mean.
http://www.itchy-feet.org/wp-content/gallery/itchy-feet/shot1.jpg
http://www.itchy-feet.org/wp-content/gallery/itchy-feet/shot2.jpg
Does anybody know, why this is?
#2
http://www.oinobareion.at/files/forum2.jpg
http://www.oinobareion.at/files/forum1.jpg
05/26/2009 (2:23 am)
In the beginning I thought there may be a problem with the size of the Atlas terrain. So i downsized it to 2048x2048, but the problem is still there. At least the detail textures work now :-) Here are 2 new screenshots. Does anybody know how to solve this problem?http://www.oinobareion.at/files/forum2.jpg
http://www.oinobareion.at/files/forum1.jpg
#3
For some reason the initial clipmap fill screws up. Investigating in this direction would be how to start properly solving this.
05/26/2009 (9:03 am)
Can't really help with a solution but triggering a second clipmap refill usually makes the problem go away--which is why switching to the editor clears this (GFX triggers a device reset). There's a purgeClipmap method on AtlasInstances which can be used to manually trigger that. Just stick it in some post-loading code and maybe this disappears.For some reason the initial clipmap fill screws up. Investigating in this direction would be how to start properly solving this.
#4
One thing you can do is set the global variable $forceFullClipmapPurgeEveryFrame to true in script.
This will force the clipmap to refill the clipmap with texture data every frame.
Keep in mind this tends to take a hit on the frames per second.
Alternatively you can set forceFullClipmapPurgeEveryFrame to true at the beginning of the mission then schedule it to set to false after a certain amount of time say 15-20 seconds to give the clipmap time to get the texture right.
However keep in mind the root cause of the issue is when the clipmap gets recentered a great distance like from the center to the edge in one frame. So if you have multiple atlas files tiled together then most likely when you cross the boundary from one to the other the clipmap texture will get messed up.
This is also a problem for games that move across the terrain real fast like flight sims.
05/26/2009 (10:20 am)
I traced this to a problem in the way atlas pages data into the clipmap a while back but I haven't looked into it for a while.One thing you can do is set the global variable $forceFullClipmapPurgeEveryFrame to true in script.
This will force the clipmap to refill the clipmap with texture data every frame.
Keep in mind this tends to take a hit on the frames per second.
Alternatively you can set forceFullClipmapPurgeEveryFrame to true at the beginning of the mission then schedule it to set to false after a certain amount of time say 15-20 seconds to give the clipmap time to get the texture right.
However keep in mind the root cause of the issue is when the clipmap gets recentered a great distance like from the center to the edge in one frame. So if you have multiple atlas files tiled together then most likely when you cross the boundary from one to the other the clipmap texture will get messed up.
This is also a problem for games that move across the terrain real fast like flight sims.
Associate Tom Eastman (Eastbeast314)
Didn't realize that opening and closing the editor helps, though. I've just been moving my player's spawn position around to hide the loading oddity, but it looks like that's not as attractive an option for you (my player starts in the air).