Page 1 of 1

sunlight

Posted: October 24th, 2011, 7:23 pm
by Captain_Ahab
I found a couple of interesting things while poking around the src.

sunlight R B G to set the color of the sunlight, much like settling the color of the skylight.
sunlightscale 0, 1, 16 is a multiplier of the color values... I don't see much point in changing this from the default value of '1'. Maybe there might be a couple of lighting effects that can use this.
sunlightyaw 0, 0, 360 to set the location of the sun light-source's position in degrees on a compass. I'm assuming '0' and '360' are "north"
sunlightpitch -90, 90, 90 to set the angle of the sun light-source with respect to the horizon.

This just seems like a nice way to set the position of the sun, rather than fiddling with the placement of a light entity within the cube volume.

Of course, sunlightpitch and sunlightyaw set the direction of the sun in a vector sunlightdir.
It might be neat to set a script to increase glare* as the player's line-of-sight direction gets closer and closer to the sunlightdir... then decrease the amount of glare more slowly over time as eyes adjust again; nothing like looking directly at the sun to screw up your eyesight.


For sunlightscale, sunlightyaw and sunlightpitch, the 3 numbers shown are the minimum, default and maximum values allowed.

* it looks like there are a number of variables for playing with glare, too

Re: sunlight

Posted: October 24th, 2011, 8:17 pm
by java.x.beast
Thanks! I really needed a way to change the color of the sky to mysterious/dark red. It's going to look SICK! This was really helpful. I like the way you post about anything you find that would be helpful to a lot of Sandboxers ( everybody :D ). If you continue doing this, you'll be recognized and given an award for "Most Helpful Sandboxer That's Not On The Support Team Already" otherwise known as the "MHSTNOTSTA" Award! Really though, on behalf of the whole Sandbox community ( I hope they agree with me ), I would like to thank you, and wildflower (for her very helpful 2.7 RPG Scripting Tutorial :D ). Thanks, so much, you're very kind. (Last sentence was from the "Cat in the Hat" T.V. show :D 8-) :D 8-) :D )

-Java

Re: sunlight

Posted: October 25th, 2011, 12:58 am
by Hirato
Just to add to the sunlight thing, there is a helpful little alias called "getsundir" that will automatically set the yaw and pitch for sunlight based on where you're looking.
In other words, look directly at the sun, execute the alias and the sun will come from there! hooray.
If you continue doing this, you'll be recognized and given an award for "Most Helpful Sandboxer That's Not On The Support Team Already" ...
Don't be silly, he's on the actual team, at least he was before he took a hiatus.
Speaking of which...
RICHARD! Y U NO IRC!

Re: sunlight

Posted: October 26th, 2011, 6:58 pm
by chocolatepie33
Hirato wrote:Don't be silly, he's on the actual team, at least he was before he took a hiatus.
do you plan on restoring his position, or no?

also, is the sunlight command a new feature for 2.7, or is it an SVN thing now? just quickly wondering