Overly bright Atlas terrain
by PuG · in Torque Game Engine Advanced · 01/25/2008 (2:17 am) · 12 replies
Hi, for last few months ive been having some new problems with Atlas blended terrain becoming incredibly bright -

Now ive tracked the cause down to opacity/attributes map but not sure whats going on. Normally you would stack the RGBA layers (like in the tutorials) - but for me any overlapping white areas seems to be causing hotspots, though im sure in the passed it has worked correctly.
Effecting both a stock 1.02 & 1.03.
So, my R channel would be all white as its the base layer, G, some white splodge's and so on.
If you look at the picture above, the area on the right is the primary R channel texture, and the one on the left is the G.
Any suggestions?
(tutorial example: http://tdn.garagegames.com/wiki/Image:Terragentut_opacitychans.jpg)
Regards!

Now ive tracked the cause down to opacity/attributes map but not sure whats going on. Normally you would stack the RGBA layers (like in the tutorials) - but for me any overlapping white areas seems to be causing hotspots, though im sure in the passed it has worked correctly.
Effecting both a stock 1.02 & 1.03.
So, my R channel would be all white as its the base layer, G, some white splodge's and so on.
If you look at the picture above, the area on the right is the primary R channel texture, and the one on the left is the G.
Any suggestions?
(tutorial example: http://tdn.garagegames.com/wiki/Image:Terragentut_opacitychans.jpg)
Regards!
#2
Its all stock, this is what my opac looks like:

Red is sand, Green is beach soil/pebbles and Blue is grass & is smaller than green.
Could it be caused by G & B overlapping? but then its a layered system and shouldn't matter.
Regards,
01/25/2008 (3:46 am)
Thanks for the quick reply.Its all stock, this is what my opac looks like:

Red is sand, Green is beach soil/pebbles and Blue is grass & is smaller than green.
Could it be caused by G & B overlapping? but then its a layered system and shouldn't matter.
Regards,
#3
01/25/2008 (10:42 am)
As a work around you could try turning down the brightness manually, its something i do to shadow certain areas of my opacity maps that incidentally cuts the white/yellow glare that you feel like you getting:)
#4
01/25/2008 (10:45 am)
Whats getting me is its fine from LD3T, but only occurs when I edit my own Opacity maps - problem is I can't open the exported PNG from LD as nothing appears... Has anyone else also had similar issues like this? perhaps its my compile script?
#5
lmaceleighton@msn.com
01/26/2008 (8:10 am)
Oh the exported Opacity maps....i set it to 1(8-bit), during the export and then combine the alphas by hand in the channels....if you still can't figure it out send it too me and ill try to sort out the problem:0)lmaceleighton@msn.com
#6
I'm not sure if I understood correctly, but you mentioned that your R channel is all "white" (i.e. 255) and your green channel has also "white splodges" (I'm assuming the "splodges" also have channel strength at 255).
If this is the case, in my books it is incorrect; at any given point of the opacity map the combined total strength of all four channels (RGBA) should be exactly 255 (e.g. if R = 255, then GBA = 0). Why? The atlasBlender pixel shadere does the blending like:
OUT.col = lm * (o.r * t1 + o.g * t2 + o.b * t3 + o.a * t4);
Where "lm" is the base "brightness" of the terran (lm = lightmap, basically the grayscale image of the shadowed terrain) and the o.rgba are the channels of the opacity map and t1-4 are the textures). The formula is based on the assumption that the four channels total 1.0 (which equals 255 in 8-bit integer representation) and totaling more on the channels will start to "brighten up" the blended pixels.
LD3T forms the opacity maps correctly for atlas, but if you edit them manually in a painting program you may have hard time keeping the summed channel strengths in order.
P.S: If I misunderstood the problem or if everything I wrote was already familar to you, you are entitled to call me an ass ;)
01/26/2008 (11:00 am)
@PuGI'm not sure if I understood correctly, but you mentioned that your R channel is all "white" (i.e. 255) and your green channel has also "white splodges" (I'm assuming the "splodges" also have channel strength at 255).
If this is the case, in my books it is incorrect; at any given point of the opacity map the combined total strength of all four channels (RGBA) should be exactly 255 (e.g. if R = 255, then GBA = 0). Why? The atlasBlender pixel shadere does the blending like:
OUT.col = lm * (o.r * t1 + o.g * t2 + o.b * t3 + o.a * t4);
Where "lm" is the base "brightness" of the terran (lm = lightmap, basically the grayscale image of the shadowed terrain) and the o.rgba are the channels of the opacity map and t1-4 are the textures). The formula is based on the assumption that the four channels total 1.0 (which equals 255 in 8-bit integer representation) and totaling more on the channels will start to "brighten up" the blended pixels.
LD3T forms the opacity maps correctly for atlas, but if you edit them manually in a painting program you may have hard time keeping the summed channel strengths in order.
P.S: If I misunderstood the problem or if everything I wrote was already familar to you, you are entitled to call me an ass ;)
#7
OK, i received your email, and there are a couple of things that need attention with your opacity map that I can see.--> Remember that the white areas represent where a texture is going to be placed on your terrain, and the black areas of coarse are where there will be no textures. In this case your *Red channel is fully white saying that the texture in the red channel will cover the entire ground. The *Blue and *Green channels are covering an area essentially the same, right in the middle so so far we have three texture all in one area blending together right in the middle, and then you didn't use the Alpha channel which is I'm sure what part of your problem is kind of like leaving out a variable in an equation, remember that that particular HLSL script is expecting to be able to use that Alpha channel;).
Send me the height-maps, and i will send you an opacity map that you could use as a reference so you can see the individual layers, and the way that in my opinion they should be set up. Don't feel bad about fumbling with this!! I have been dealing with opacity maps for a number of years, i can see now that you will have this in no time, and are well on your way:0)
01/26/2008 (11:38 am)
@PuGOK, i received your email, and there are a couple of things that need attention with your opacity map that I can see.--> Remember that the white areas represent where a texture is going to be placed on your terrain, and the black areas of coarse are where there will be no textures. In this case your *Red channel is fully white saying that the texture in the red channel will cover the entire ground. The *Blue and *Green channels are covering an area essentially the same, right in the middle so so far we have three texture all in one area blending together right in the middle, and then you didn't use the Alpha channel which is I'm sure what part of your problem is kind of like leaving out a variable in an equation, remember that that particular HLSL script is expecting to be able to use that Alpha channel;).
Send me the height-maps, and i will send you an opacity map that you could use as a reference so you can see the individual layers, and the way that in my opinion they should be set up. Don't feel bad about fumbling with this!! I have been dealing with opacity maps for a number of years, i can see now that you will have this in no time, and are well on your way:0)
#8
@Bob, well you can input a Jpeg, which would then only have three channels anyhow? but will try!
Regards!
01/26/2008 (2:20 pm)
Thanks for the replies! I think what Henri suggested on the the problem makes sense, will try it out shortly and post the findings. @Bob, well you can input a Jpeg, which would then only have three channels anyhow? but will try!
Regards!
#9
01/26/2008 (4:36 pm)
What did I say about JPEG? i would use PNG...and what i mentioned above is the problem because i reproduced it, and then made a different opacity file with the alpha used and the problem went away:)
#10
If their is a chance of a opac map to look at would be most grateful.
Will try what you suggested Henri.
01/27/2008 (1:35 am)
Right, I tried using all four layers, R,G,B,A and still the same issue but not quiet so bright as G,B,A are offset.If their is a chance of a opac map to look at would be most grateful.
Will try what you suggested Henri.
#11
Still would like to take a look at an opacity map just to double check.
Regards!
01/27/2008 (1:57 am)
@Henri - their you go! its working as it should I believe, comes to a total of 255.Still would like to take a look at an opacity map just to double check.
Regards!
#12
01/27/2008 (7:41 am)
Sorry should have read Henri post cause were on the same page, i just wasn't telling you the reason like he did, just method Im glad you problem is fixed:)
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft