About Store Forum Documentation Contact



Post Reply 
Questions after playing around with day/night cycle tutorial
Author Message
Gian-Reto Offline
Member

Post: #1
Questions after playing around with day/night cycle tutorial
After playing around I have a question:

1) How can I change the actual light color of the Sun? Changing Sun.light_color doesn't seem to do much, as it only affects the brightness it seems.

I would really like to get a redshift effect during dusk and dawn.
03-11-2011 03:04 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #2
RE: Questions after playing around with day/night cycle tutorial
If you check sun.h (sky.h?) you would have answer.
03-11-2011 04:32 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #3
RE: Questions after playing around with day/night cycle tutorial
Which I did


Code:
Vec light_color    ; // light      color   , (0,0,0)..(1,1,1), default=(0,0,0), value of (0,0,0) disables light casting
   Flt light_vol      , // volumetric amount  ,       0..Inf    , default=0.0
       light_vol_exp  , // volumetric exponent,       0..Inf    , default=1.0
       light_vol_steam; // volumetric steam   ,       0..1      , default=0.5

I tried different values for light_color, but nothing besides the last value in the vector had any effect (which did turn down the brightness if set to a value lower than 1).... the first and second value in the vector had no effect (no visible one at least).

Maybe I'm doing it all wrong, but I can't find anything else that could help in the Sun.h header file.

In the sky.h I see methods to change the color of the sky and the horizon, but nothing that changes the sunlight.
03-11-2011 04:45 PM
Find all posts by this user Quote this message in a reply
menajev Offline
Member

Post: #4
RE: Questions after playing around with day/night cycle tutorial
rays_color?
03-11-2011 05:23 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #5
RE: Questions after playing around with day/night cycle tutorial
nope....

tried it, rays_color doesn't change the color of the rays, the rays just get brighter (which in turn has nothing to do with the light emitting)...

I can make the sun image red, which also doesn't change the emitted light. I get the impression changing the sun color was never intended with the sun class and I have to write my own......
03-11-2011 10:56 PM
Find all posts by this user Quote this message in a reply
Tottel Offline
Member

Post: #6
RE: Questions after playing around with day/night cycle tutorial
Well, it *should* work since the colour changes already in the default tutorial (gets darker and darker when it's evening, and brighter when it's morning. Maybe you could check how he did that?
03-11-2011 10:58 PM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #7
RE: Questions after playing around with day/night cycle tutorial
Yep, that works. Thats the point: all the "color" changes is the brightness.... its the last value in the Vector that does that, and the two first values doesn't seem to do anything.

With the rays, all the values in the vector seem to be just adjusting the brightness of the rays, you also can't change the color....

Could this be a bug? Or am I just not understanding how the color values should work (which could very well be the case smile )?
03-11-2011 11:14 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
RE: Questions after playing around with day/night cycle tutorial
Are you using values between 0 and 1, and not values between 0 and 255?

Seems to be working for me. For instance, "Sun.light_color = Vec(1, 0, 0);" makes everything be red.
03-12-2011 02:30 AM
Find all posts by this user Quote this message in a reply
Gian-Reto Offline
Member

Post: #9
RE: Questions after playing around with day/night cycle tutorial
Great! That was my mistake!

C++ is not my friend it seems. Adding the Type "Vec" before the parentheses did the trick.

Thanks a lot! Not a Bug at all, just me being the C++ newb I am smile
03-12-2011 08:33 AM
Find all posts by this user Quote this message in a reply
Post Reply