changing shader with light

   3089   4   0
User Avatar
Member
15 posts
Joined: May 2013
Offline
Hi,

As a small challenge to learn shading I'm trying to do a simple earth planet in Houdini.

It fits my modelling skill…

Anyway, I have 2 maps, a day and a night map, I was just wondering if it was possible in Houdini to group some faces or points by “hit by a specific light” or not, and thus remplace shading by group (if it is a good idea or the good way to do it).

Also is it possible to do a bit of gradient transition between the 2 textures ?

Thanks

Jean-Luc
User Avatar
Member
2629 posts
Joined: June 2008
Offline
This would be nice to know how to do this effect in Houdini. I know C4D has some xpresso nodes for handling when a light is illuminating a surface.

Here is a start. Basically I am trying to use a lighting model at the SHOP level to control the bias on a mix colors node. I have taken the X vector out of the direct lighting shadow socket to control the mix. This demonstrates that some kind of control can be achieved but it is far from complete.

I don't really know what math needs to happen to turn the direct lighting model in to a controller, preferably based off the spotlight falloff.

Attachments:
ap_bias_mix_two_colors.hipnc (458.3 KB)
Untitled-1.jpg (150.8 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
392 posts
Joined: Nov. 2008
Offline
It's little bit tricky.
You need to put some bsdf to the directlighting and then you can use luminance for masking.

I used custom label to be able to pick lights for masking.

See this example for Houdini 14, pbr.

Attachments:
Lighting_mask.PNG (193.0 KB)
pz_lighting_mask.hipnc (390.5 KB)

User Avatar
Member
2629 posts
Joined: June 2008
Offline
Thanks pezetko!

With a little tweaking I was able to create the earth dark side lit up. As the sphere rotates, the correct map is used for the dark side.

Attachments:
ap_pz_lighting_mask_196.hipnc (578.5 KB)
Untitled.jpg (187.2 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
15 posts
Joined: May 2013
Offline
Thanks a lot Pezetko and Enivob

I'm rushing to finish a project so I lack time right now but can't wait to put my hands on this to look at how you did it.

Best regards
  • Quick Links