About Store Forum Documentation Contact
Donations:
364$/mo



Post Reply 
How to set 2 suns
Author Message
FireMan Offline
Member

Post: #1
How to set 2 suns
Hi.
I'm going to set 2 suns to my project.
I use: "Day Night Cycle.cpp"

1st look on picture:

[Image: daynight.jpg]

Moon is my 2dt sun. I going to set low light at night for better shadow.

How to do that?
(This post was last modified: 09-20-2011 03:48 PM by FireMan.)
09-20-2011 03:47 PM
Visit this user's website Find all posts by this user Quote this message in a reply
BlackHornet Offline
Member

Post: #2
RE: How to set 2 suns
Maybe this helps you a bit: http://www.esenthel.com/community/showth...p?tid=4208

I didn't tried it in code yet tbh

Urbanity Online: http://www.facebook.com/pages/Urbanity-Online/162454237136358
Join the Esenthel IRC Channel @ Freenode: http://webchat.freenode.net/?channels=##Esenthel
09-20-2011 04:11 PM
Visit this user's website Find all posts by this user Quote this message in a reply
FireMan Offline
Member

Post: #3
RE: How to set 2 suns
I add LightDIr, but... it's not good idea.
09-20-2011 04:36 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Zervox Offline
Silver Supporter

Post: #4
RE: How to set 2 suns
Why not? Basically you could just disable the moon/sun light as when they go below ground. level.
(This post was last modified: 09-20-2011 04:40 PM by Zervox.)
09-20-2011 04:39 PM
Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #5
RE: How to set 2 suns
Run the "04 - Astronomical Objects" tutorial. Then use the code from the "Day Night Cycle" to animate the position of the Astro object, just like you would the Sun.

Light is disabled on the moon in the tutorial via moon.light_color.zero(); but you can enable it by setting it to any other value (i.e. moon.light_color = Vec(1, 0, 0);).

And, actually, you can add a second sun like so:

Code:
SunClass sun;
sun.image = Images("gfx/sky/sun.gfx");
sun.pos = !Vec(-1,1,-1);
sun.light_color = Vec(0, 0, 1);
Astros.add(sun);
09-20-2011 07:10 PM
Find all posts by this user Quote this message in a reply
FireMan Offline
Member

Post: #6
RE: How to set 2 suns
(09-20-2011 07:10 PM)Driklyn Wrote:  Run the "04 - Astronomical Objects" tutorial. Then use the code from the "Day Night Cycle" to animate the position of the Astro object, just like you would the Sun.

Light is disabled on the moon in the tutorial via moon.light_color.zero(); but you can enable it by setting it to any other value (i.e. moon.light_color = Vec(1, 0, 0);).

And, actually, you can add a second sun like so:

Code:
SunClass sun;
sun.image = Images("gfx/sky/sun.gfx");
sun.pos = !Vec(-1,1,-1);
sun.light_color = Vec(0, 0, 1);
Astros.add(sun);

TH, it's good, but how to set light only in night ?
sun.light_color = Vec(0, 0, 1); <-- I add this into "Bool Update".

I add: LightDir(!Vec(1, -1, 1), Vec(0.015, 0.015, 0.015)).add(); ,but i have less FPS.... How to optimalize light ??
(This post was last modified: 09-24-2011 10:12 AM by FireMan.)
09-24-2011 10:05 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply