Page 1 of 2

pageswap fog problem

PostPosted: Mon Nov 23, 2009 12:55 pm
by Justintime9
Now that I've fixed my waveset reflection, I've noticed that there's an annoying black fog on the horizon of my age. As many of you know, my age uses a page swap. There are two separate fog settings, one for each page. In order to change to black fog in the daytime to blue (to blend the sky and water on the horizon), I changed the daytime fog settings, but left the nighttime fog black (the sky is black so it'll blend right in.)

There was only one problem, when I changed the fog settings for the day, and linked back in, the fog in the daytime was still black, as well as the night. Now, there are fog setting in both of the two python files; "MyAge.py" and "SwapButton.py"

Here's the fog settings for the "MyAge.py" file:

Code: Select all
# emacs-mode: -*- python-*-
from Plasma import *
from PlasmaTypes import *
SDLName = 'SwapPageZefora'
sPages = ('ZeforaDay',
 'ZeforaNight')
sFog = ([1,
  1000,
  1],
 [1,
  1000,
  1])
sColors = ([0.106,
  0.176,
  0.193],
 [0.0,
  0.0,
  0.0])
sWavesets = ('RpondWav',
 'RpondWavN')


Here's the fog settings from my "SwapButton.py" file:

Code: Select all
 'ZeforaNight')
sFog = ([1,
  1000,
  1],
 [1,
  1000,
  1])
sColors = ([0.106,
  0.176,
  0.193],
 [0.0,
  0.0,
  0.0])

Re: pageswap fog problem

PostPosted: Tue Nov 24, 2009 5:23 am
by D'Lanor
In order to see the fog color you need to have fog first. The default values in this script are the PyPRP defaults which do not create any visible fog effect. The fact that you can see the horizon is further evidence that there is no fog.

Re: pageswap fog problem

PostPosted: Tue Nov 24, 2009 10:07 am
by dendwaler
Have you checked your "init" settings?
In the next example you can see for 2000 blender units after that distance the objects will turn to black .
If your age is bigger then change the value "2000" to what ever is needed.

example:
#--Fog settings--
#Graphics.Renderer.SetYon float yon
#Visibility distance
Graphics.Renderer.SetYon 6000

#Graphics.Renderer.Fog.SetDefLinear float start, float end, float density
#Fog depth
Graphics.Renderer.Fog.SetDefLinear 1 2000 1
#Graphics.Renderer.Fog.SetDefExp2 float end, float density
#Graphics.Renderer.Fog.SetDefExp2 100000 20

#Graphics.Renderer.Fog.SetDefColor float r, float g, float b
Graphics.Renderer.Fog.SetDefColor 0 0 0

#Graphics.Renderer.SetClearColor float r, float g, float b
Graphics.Renderer.SetClearColor 0 0 0

Re: pageswap fog problem

PostPosted: Sun Nov 29, 2009 9:11 am
by Justintime9
D'Lanor wrote:In order to see the fog color you need to have fog first. The default values in this script are the PyPRP defaults which do not create any visible fog effect. The fact that you can see the horizon is further evidence that there is no fog.


Well, when I first started my age (before the pageswap was added) there was a blue fog on the horizon by default, but after I added the pageswap, it turned black. But if that's not fog (you said by default there is no visible fog), then what is it that's on the horizon?

@ denwaler, I changed it to 2000, but all that did was make the amount of fog less.

Re: pageswap fog problem

PostPosted: Sun Nov 29, 2009 10:16 am
by D'Lanor
Justintime9 wrote:But if that's not fog (you said by default there is no visible fog), then what is it that's on the horizon?

Perhaps a transparency (or a hole) in your skydome which shows the underlying clear color of your age. The pageswap script does make the clear color the same as the fog color though.

Your color [0.106, 0.176, 0.193] is still a dark shade of gray so you wouldn't really see much difference with black.

Maybe you should investigate what your settings actually do before you ask for advice. The offline KI has /fogcolor and /fogdensity commands to preview your settings in real time.

Re: pageswap fog problem

PostPosted: Mon Nov 30, 2009 3:41 pm
by Justintime9
Ah, I took at closer look at my daytime fog and it is indeed different than the night (Gray rather than black.) I did a bit of testing as density goes, and found the correct settings.

My only question now is how to get the exact color I want for the horizon. I got my [0.106, 0.176, 0.193] triplet by taking a screenshot of my age, and in MS paint, using the eyedrop tool to find the color I want, and then checking the RGB of it.
Is there an easier way to figuring it out? Apparently that was wrong, because my supposed blue color came out dark gray :P

Re: pageswap fog problem

PostPosted: Mon Nov 30, 2009 5:35 pm
by D'Lanor
I found a small free tool that can show RGB values in the 0 to 1 range. Just Color Picker

Choose RGB [0,1] from the dropdown box and hover your cursor over the color you need.

Re: pageswap fog problem

PostPosted: Tue Dec 01, 2009 2:59 am
by Jojon
Justin: Is it possible that you did not even know that the fog settings require normalised values? It kind of looks like you've inserted the integer values you got out of MSPaint as they were, with a "0." prepended.
To make a 0-to-255 range 0-to-1, you'll have to divide the RGB values by 255, giving you: 0.416, 0.69, 0.757, which is still not a saturated blue, but more so than the dark colour you had first. :7

Re: pageswap fog problem

PostPosted: Tue Dec 01, 2009 2:11 pm
by Justintime9
That seemed to have done the trick. (that program will come in very handy :D)
@ Jojon, that must've been the main thing I was missing. Where did you guys learn to "normalize" the values? It isn't in the tutorials...

Re: pageswap fog problem

PostPosted: Tue Dec 01, 2009 7:27 pm
by Paradox
Justintime9 wrote:That seemed to have done the trick. (that program will come in very handy :D)
@ Jojon, that must've been the main thing I was missing. Where did you guys learn to "normalize" the values? It isn't in the tutorials...


There are a few ways of representing colours in the computer world. One is with RGB values from 0-255 in decimal, another is using hexadecimal notation ranging from 0-FF (common on webpages),and another is using floating point number ranging from 0.0-1.0 (common in games and graphics).

Plasma expects all colours to be floating point values ranging from 0.0 - 1.0.