PDA

View Full Version : 10 Digit Color Value?



gecko
September 28th, 2012, 21:06
Hey folks,

I was wondering if any of you knew what to make of the "fogColor" value present in all the weather files. As an example:


<Weather Name="Clear">
<BackgroundWeather skyboxCloudType="NoClouds" fogColor="4287204752" Windspeed="0"


windDir="0" >
</BackgroundWeather>
</Weather>


I've found that changing it effects the color of the haze on the horizon and also the water color, allowing variation based on the weather conditions, e.g. darker stormier water with overcast and brighter water on sunny days. The problem is I have no idea what those numbers actually mean in order to more precisely select the colors. Any pointers are much appreciated. Thanks.


Daniel

hairyspin
September 29th, 2012, 00:40
I'd suggest trying convert to hexadecimal. 4287204752 comes out as FF898D90 which could be four 16-bit hex numbers for say, red FF h (255 decimal), green 89 h (137), blue 8Dh (141) and possibly opacity/alpha 90h (144). So what you wind up with is:-


Red 255
Green 137
Blue 141
alpha 144 in normal numbers(!)

A certain amount of contrary-propellorheadedness is needed when working with these. This (http://www.statman.info/conversions/hexadecimal.html) might also be useful.

gecko
September 29th, 2012, 08:08
Thanks! It seems like it works pretty well, but I'm a bit foggy on how to get the alpha information in there. For example, I take a medium light blue (hex 0094FF) and convert it, getting 38143 as the decimal value. This creates the correct color in game, but I'm pretty sure the above hex code does not include any alpha information. How is that added?

hairyspin
September 29th, 2012, 11:17
I'm just making a stab at this Daniel, but it seem you're missing the first hex number from that. The medium light blue is 0094FF (0,148,255 in decimal) but the example from the weather file is FF898D90 (255,137,141,144 in decimal), so yours is (by default) 000094FF or 0,0,148,255.

Some experimentation is needed. I'd suggest varying the first hex number of the four to see what happens, eg

00 00 94 FF (38143 decimal) - as you've tried
80 00 94 FF (2147521791 decimal)
FF 00 94 FF (4278228223 decimal)



I notice the name is fogColor which suggests a link with fog, duh. Try setting up for foggy weather and see what happens: should the fog take on the density of concrete at some stage you'll know the effect is slightly overdone. I do notice looking at various weather files that the first hex number is often FF.

gecko
September 29th, 2012, 13:26
This shot shows the effect I'm working with. For illustrative purposes I made it RBG 255, 0, 0 (16711680 in the file). So it's not actually a cloud, but more the hazy effect used to blend with the skybox at the horizon. It also effects the water and clouds that appear outside a certain radius from the player. If you compare shots of the weather in OFF vs CFS3 you'll see that they have made this quite pronounced. I'm going for something in between and better matching with skybox and weather than we presently have.

I'll try to experiment as you've suggested and see what I can get though this is all pretty foggy to me - no pun intended!

ndicki
September 30th, 2012, 00:50
We had a long discussion about these values a couple of years ago, but I can't for the life of me remember what we finally found. Try searching the forum?

gecko
September 30th, 2012, 21:34
Did a search Nigel, but didn't turn up anything. After some more experimentation I am tentatively concluding that the alpha channel/transparency is not active in this effect. I think OFF uses some well crafted clouds that blend into the horizon haze to bring the effect closer in. Anyway, I'm pretty well able to make it whatever color I want now, which was the main thing I was after. Thanks for your help!