Gamestudio Links
Zorro Links
Newest Posts
Blobsculptor tools and objects download here
by NeoDumont. 03/28/24 03:01
Issue with Multi-Core WFO Training
by aliswee. 03/24/24 20:20
Why Zorro supports up to 72 cores?
by Edgar_Herrera. 03/23/24 21:41
Zorro Trader GPT
by TipmyPip. 03/06/24 09:27
VSCode instead of SED
by 3run. 03/01/24 19:06
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (Quad, aliswee), 835 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
sakolin, rajesh7827, juergen_wue, NITRO_FOREVER, jack0roses
19043 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Complementary Color Equation, Light Color, Shadow Color! RGB #470842
02/08/18 16:49
02/08/18 16:49
Joined: Apr 2002
Posts: 1,246
ny
jumpman Offline OP
Serious User
jumpman  Offline OP
Serious User

Joined: Apr 2002
Posts: 1,246
ny
Hello friends,

Im looking to homogenize the different shaders in my game, due to each of them currently having hard coded light and shadow values. But what if one level has a dull white moonlight, compared to another level's bright yellow sunlight?

So, I can pass the level's sun color vector to each FX file, and this light will bathe the surface in that light. But when it comes to shadow, in real life, if the light source has a color thats not white, the shadow color has a tint of the color thats complementary to the light color!






What kind of equation can I come up with, using RGB values to always make the shadow color the complementary color to the light color?

Re: Complementary Color Equation, Light Color, Shadow Color! RGB [Re: jumpman] #470847
02/08/18 23:11
02/08/18 23:11
Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
Kartoffel Offline
Expert
Kartoffel  Offline
Expert

Joined: Jun 2009
Posts: 2,210
Bavaria, Germany
if all you're looking for are complemetary colors:
color_comp = 1.0 - color

That being said, you might want to make the effect a bit less intense. I'm pretty sure using complete opposite colors will give a way too strong effect.

Also, in real life, light vs shadow colors don't have to be complementary. Though, in your case (sunlight) you're right, since the sky adds some blue ambient light while the sun is mostly white-yellow-orange-ish which is complementary to the blue.
You also get a similar effect with neutral ambient light (like grey) and a colored light source (since visual perception is somewhat relative) but I don't want to bring up too much of the theory stuff here.


POTATO-MAN saves the day! - Random

Moderated by  Blink, Hummel, Superku 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1