CGTalk > Techniques > Lighting and Shaders
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
Thread Tools Search this Thread Display Modes
Old 07-27-2013, 04:18 AM   #1
Farifield, USA
Join Date: Feb 2010
Posts: 36
maya shader that blends with light direction

Im trying to create a planet shader where areas that are illuminated by a directional light show one material, and the areas not illuminated use a different material (Day/night).

I'm using vray. I've been trying all sorts of combinations with the blendColors, lightDirection, SampleInfo, Surf.Luminance nodes with no luck.

Ideally, I'd like to have a shader that will actively blend between the Day and Night materials depending on the angle the light hits the surface. The only other method I can think of to at least show the blending is to do it in post, but wheres the challenge in that?
Old 07-27-2013, 01:04 PM   #2
Simon Bunker
Shader Writer / TD
Join Date: Jan 2003
Posts: 1,040
Can you use the outColor from a white lambert shader to use as the blend?

Old 07-27-2013, 07:19 PM   #3
Farifield, USA
Join Date: Feb 2010
Posts: 36
To connect the outColor of the lambert to the blend factor, you'd first have to use an RGBtoLuminance to convert it to a single value. Even so, it would work exactly the same as the blend factor by itself (white 1, black 0)

What I need is something that would sample the surface luminance and use that value to control the blend.

....Just after writing that, I tried the Surf.Luminance node using the default connection, and it works! Apparently the effect doesnt show in IPR rendering. Heres a successful test image of the blend from day to night:

Thanks for the response though. Good team work!
Old 07-27-2013, 07:20 PM   #4
CGTalk Moderation
CGTalk Forum Leader
Join Date: Sep 2003
Posts: 1,066,478
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 05:14 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.