Jump to content
PaulM3D

"For each light" isn't working (for custom shader)

Recommended Posts

Hi everyone!

Got new issue.

 

Made shader - will not attach file, it's quite simple - just a standart Oren-Nayar diffuse  connected to Cf output. Want to make diffuse and illumination passes from it. Made Parameter noder for this outputs of Oren-Nayar node. Added image planes and 2 simple light sources with different colors. Want to make passes for each light individually. But receive empty black passes when "For each light" toggle on. When off - got my pass, but for combined light. 

 

What I'm doing wrong?

I know that there I should use Illuminance Loop node some how, but I haven't figured it out by myself. Houdini help didn't help, as Google.

Tried to put my diffuse into Illuminance Loop and export parameters from it - doesn't work for me.

 

Can you help me with this issue please?

Edited by PaulM3D

Share this post


Link to post
Share on other sites

Are you rendering with Mantra? Use the "Physically Based Diffuse" node (Set to Oren-Nayar) and be sure to use "F", too.  Make sure you're using a PBR render engine too. Then it should work.

Share this post


Link to post
Share on other sites

Oh, thanks for answer, using Mantra, but I've forget to say that I'm using micro-poligon rendering, PBR cannot be used for this work. For PBR Illuminance Loop doesn't need at all, as I know.

Share this post


Link to post
Share on other sites

To make per light image plane support in your shader you need to

1. iterate over all lights in the scene (this possible with illuminance loop but it's unofficially deprecated, use getlights(), loop and sample_light()/shadow_light()

2. In each iteration compute diffuse for corresponding lights (in this case first you need implemented Oren-Nayar BRDF, builtin Oren-Nayar already has illuminance inside)

3. Store values with storelightexports() and some magic

...

?. Enable "Export variable for each light" in Extra Image Planes.

?. Render

 

Or use Mantra Surface.

Share this post


Link to post
Share on other sites

Thanks for answer!

It's what I need, I think, but for now it's not possible to me to implement what you said. I didn't write shaders code for know, only in vex bulider. Of coarse, my goal is to write shaders by myself, but now my level is quite low for this, I think. I've read Houdini help info about these functions and have understod some part of it, but it's not enough to implement this for now.

 

About Mantra Surface - I want to make my own shader, which make only what I need. Mantra Surface is too "hard", a lot of useless functions for me. Even if I delete all I don't need from Surface Model inside it, like SSS etc, there is issue for me - Mantra Surface, as I think, made basically for PBR render(H13). I know that I can use micro-poligon render too, but all calculations are made by compute_lighting network, where is PBR-lighting node is situated. So, basically, all export calculations made from BSDF by this node. Not usable for me becouse I need particular render passes(image planes). I don't even need Beauty pass basically. And PBR-lighting export parameters is not usable for me(direct_diffuse etc.). I've made some tries and almost receive result that I need, but have made a decision to build my own shader.

 

Sorry, I think my "noob" issues could be considered funny for hardcore Houdini artists, but I'm just preparing to move all my workflow to Houdini from some other CG software.

Share this post


Link to post
Share on other sites

Ok, I've got an idea - can I use 2 different Illuminance loops in 1 shader with light mask specified for each Loop? Will attach a picture with an example. I think I'm doing something wrong, because got such result: one loop working propertly with both of my light sources. Connected to Cf for visual seeing, export working as well. But 2-nd created Illum. loop with another light source is doing the same result as 1-st one. Exactly the same. Can that be done this way? Right now I'm talking not about "For each light" basically, but about type of construction that I've used on screenshot.

post-10881-0-41668700-1409070917_thumb.j

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×