PDA

View Full Version : Shader Frustration -Need nightside Lights


calmasacow
06-05-2006, 10:58 PM
I'm completley frustrated. I'm trying to figure out how to make a a shader for makeing the light "texture" map only light up on the dark side of the planet. I have a ramp shader with the ramp made set to light angle. I have the lightmap as one of the colors on the ramp and the other one set to black but I'mI have tried dozens of ways to do this and nothing is working.

victor
06-05-2006, 11:26 PM
You'd probably be better off making that ramp shader just go from black (light side) to white (dark side), and then connect the outcolor to the color gain of your texture, and then connect the texture to the incandescence of your planet's surface.

victor
06-05-2006, 11:57 PM
Or better yet (and since I don't like the ramp shader much), you can use the shdaer in this file. It's a bit simpler, and can work with multiple lights.

calmasacow
06-06-2006, 12:10 AM
it says bad attatchment

victor
06-06-2006, 01:12 AM
Hmm. Works fine for me. Try this one.

chriswaner
06-06-2006, 03:14 AM
Create a Blend Colors node in the Hypershade. Plug in the texture map of the planet in the light into color 1 of the Blend Colors. Plug the color of the planet in the dark into color 2 of the Blend Colors (Note: You should create a texture map of the entire planet in the light and the dark).

Then plug the Out Value of a Surface Luminance Node into the Blender slot of the Blend Colors node....this will return color 1 (the light side of the planet) where light hits the planet and return color 2 (the dark side of the planet) where no light hits the planet. This way you can rotate the planet and the dark side will always remain lit by the terrestrial lights.

Here is an example I did for a project a while back (first clip in demo reel):

http://www.chriswaner.com/downloads/shadingReel.htm

Hope that helps.

Chris

calmasacow
06-06-2006, 06:59 PM
thanx that last one worked quite well.

the other seemed to work unless I tryied to incorperate them into my network.


But the surface illumination node does the trick but man I'm getting lights on way up on the side where it is partially lit and it is a bit much.
is there anyway to offset the value before passing it on?

victor
06-07-2006, 04:37 AM
is there anyway to offset the value before passing it on?Yeah. Connect the surface illuminance to the V coord of a ramp, and then use the out color from that after modifying the ramp to where you want the edge. If you use the surface illuminance alone, the lights will fade towards the light part, but what you want is probably more of a sharper edge. The ramp allows you to get that.

Basically, that's the same as what I suggested. I just did it with a lambert and luminance instead of the single surface illuminance.

pixelmonk
06-07-2006, 05:27 PM
what's the best way to do the atmosphere? I was using a ramp with a sampler info (facing ratio) because it was "easy". Would the surf luminance work with 2 ramps (1 for transparency and one for incandecence) or will it not really work?

pixelmonk
06-08-2006, 11:08 AM
bump.........

calmasacow
06-08-2006, 09:28 PM
Ok I will try that victor. Hey I would really appriciate if I could get you imput on this other problem I have

http://forums.cgsociety.org/showthread.php?p=3613527#post3613527

thanks for all the help guys

one other thing I'm having an issue where I'm getting some light on the clouds on the back of the planet and I can't figure out where it is comming from


http://www.digipixelstudios.com/User/bad_cloud_light.jpg


there is only one directional light in the scene. what is lighting the back?

calmasacow
06-10-2006, 05:32 AM
Never mind I got the light off of the back I has to turn off double sided.

I used the ramp and it worked much better. However, I'm getting a area near brightest point on the surface where the lights seem to come back on in the one area what is up with that?

http://www.digipixelstudios.com/User/light_problem.jpg

calmasacow
06-12-2006, 06:54 PM
Hey vik the nest step I need to accomplish is this effect
http://www.digipixelstudios.com/User/sunglow_effect.jpg


See how when the sun is almost at 180 degrees the highlight changed to a golden color.

Any input would be great.

CGTalk Moderation
06-12-2006, 06:54 PM
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.