View Full Version : Surf. Luminance, exclude shadow from object?
03-10-2012, 04:31 AM
I'm shading my Earth and I've stumbled upon a problem. My scene consists of a sphere, which is the Earth, and a directional light. I'm using the Surf. Luminance node to calculate which side of the Earth should get the day texture and which side should get my night texture. But because the clouds cast shadows, which also includes the side with the day texture, areas of the side that should receive the day texture receive the night, which is not what I want. How can I only have the dark side of the Earth receive the night texture?
Here's an image which shows the problem: http://www10.pic-upload.de/09.03.12/mj6555ilt8nu.jpg
And here's an old render I photoshopped a bit, it's what I'd like to achieve, sort of: http://www10.pic-upload.de/09.03.12/ea8h7yb25brk.jpg
03-13-2012, 12:16 AM
the sampler node you're using is performed after all the light computations are done, hence it sees only one kind of shadow (but you have 2:), proper shadows and cast ones).
I'm sure that inside the rendering passes there's one with just light intensity info and without cast shadows, but I still have no idea how to get it (still learning:))!!! If you check in the standard render pass list of maya (2011) you'll find a lot of passes with and without casts, but I don't know how to use them directly in the Hypershader...
A very primitive (and surely overcomplicated) way could be to compute manually the intensity you need; i.e. you should add some nodes evaluating:
(WLP - WP) dot N
where WLP is the position of your light in world coordinates, WP is the world coordinates of each point in your surface and N is the corresponding normal. In this way you should get the standard lambert pass (perhaps you'd need a ramp to adjust the roughness and intensity) and you could replace the sampling node that sees even the cast shadows.
Or perhaps there's a way to tell maya to disable the raytraced shadows in a particular shader node; it's possible to do that for a whole object, but for a single fragment of a shader? no idea!
Hope it helps a bit:)
03-13-2012, 03:59 PM
Thank you for your reply rustysunshine,
I've thought about using the light direction too, so I could determine where the night texture should be placed, but — as you've already hinted — compositing software has its place too. I'll go for the render passes route. As a bonus I'll also have more control over the final result that way. :D
03-20-2012, 05:28 PM
I still have no idea how to do this inside Hypershade without silly tricks. Anyhow, create a fake point light under your sun and parent them together and disable the shadow casting; then, create a MiaMaterial (apparently standard maya materials have more complex or hidden light linking) for the earth disabling everything except the the diffuse (no textures) and link it to the fake sun; this way you get the intensity sample you needed originally. You "just" need to unlink the fake sun to every other material you have:), what a convenient solution ah:)?
I'll try to ask around how to gain access to render passes inside HS...
03-20-2012, 05:28 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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.