FireMan
Member
|
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:
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 |
|
BlackHornet
Member
|
RE: How to set 2 suns
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 |
|
FireMan
Member
|
RE: How to set 2 suns
I add LightDIr, but... it's not good idea.
|
|
09-20-2011 04:36 PM |
|
Zervox
Member
|
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 |
|
Driklyn
Member
|
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 |
|
FireMan
Member
|
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 |
|