Using nodes to control blending of two maps for the colour channel

starbase1

May the sauce be with you
I'm looking to try applying the NASA Earth at Night texture to my Earth model, and I think its going to mean I have to go a lot deeper into nodes.

My starting point is how to control which image is used for the colour channel - I want the earth at night image for the dark side, and the usual colour map on the bright, (with a small zone where they blend).

My initial thought is to use a map which will target my key Sun light. Black for the night side, white for the day, and a moderately thin band for the disk / dawn areas. (Or perhaps the other way around).

Is there a node or combination of nodes that will control image selection or transparency for me in this way?
Or maybe the light-intenstity spot info could do the trick?

I suspect the same method will then let me drivve luminosity, so I can also make the lights glow on the dark side.

Nick
 

Tobian

New member
The simplest method to do this would be to use a mixer node and use a diffuse shader node (possibly with a gradient to tweak the falloff to suit), to mix the opacity blending the pair of them. You can likewise use the same output to drive the luminosity.

Just a quick example, using some procedurals in place of actual textures :)
 

Attachments

  • planet_at_night.jpg
    planet_at_night.jpg
    514.7 KB · Views: 313

starbase1

May the sauce be with you
Very helpful, many thanks for taking the time to put that together for me!

Mixer node - thats the cookie. Difficult to lok things up in the manual when you do not know what to look for.
 

Tobian

New member
Some of the maths nodes do baffle me because I am not a maths guy, but largely they are all self explanatory, if you understand what you want to do. The new search feature in 11 also makes it much easier to browse them, if you lose where they are (though I know it won't help if you don't know the correct word to use to search). I think most people get scared by nodes, because they assume they are going to be horribly complicated. In reality they are often quite simple and elegant, as long as you know what you intend to do!

Thinking about it, it might also make more sense to do it this way:

Make your 'day' image standard diffuse, but make your 'night' image just luminous, so you don't have to mess on with it's luminosity at all (plugging an image directly into the red-diffuse input would make it the same as if you had diffuse 0 luminosity 100). NB, for clarity, ignore everything I did to the left of the red line, since that's me just messing with procedurals to fake 'earth' textures :) You'd naturally be using your Nasa images instead.
 

Attachments

  • planet_at_night02.jpg
    planet_at_night02.jpg
    581.9 KB · Views: 240

starbase1

May the sauce be with you
Thanks for the tips!

Nodes almost always seem easier than I expected once I know the right key ones to use, or impossible! It's really nice the way you can build things stepwise, or disconnect a chunk while you try something different, very easy to experiment.

I attach the node map I ended up with, which seems to work well, a combination of the mixer node and dot product did the trick. Also the cuirrent state of the image.

Maybe I should start to think about a way to redden the light near the day/night boundary. Hmmm... Tricky...

Nick
 

Attachments

  • atlantic-lights.jpg
    atlantic-lights.jpg
    93.7 KB · Views: 236
  • nodes-earth.jpg
    nodes-earth.jpg
    152.7 KB · Views: 258

RebelHill

Goes bump in the night
Dot product is the Cos Angle between Vectors, multiplied by the magnitude of each vector... If you chuck a normalise (which scales mag to 1) node on each vector going into the dot node, u can do away with your mult/clamp nodes operating on the scalar output there.
 
Top Bottom