Pbrlighting parameter export doesn't work "For each lig

   5057   9   1
User Avatar
Member
14 posts
Joined: July 2014
Offline
Hello!
Rendering with Mantra PBR, H14. Have got my own shader built in SHOP. Need to obtain light passes for each light source in my scene. For different reasons, dividing diffuse passes by diffuse_noshaded in post comp is not an option.
So, inside my shader i've created simple Lambert node and use it bsdf-output for bsdf input of pbrlighting node. Then use all output of pbrlighting and connected it to exportable parameter. But there is an issue - it works fine with "For each light" toggled off, but when i make it ON i receive black empty passes.

Could you please help me with this issue?
Maybe, there is another simple way to obtain light color passes for each light in one render?
Edited by - April 4, 2015 08:13:41
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi
See attached .I had a quick test everything works as expected , each light has a category ie env , key , fill . In this case the image plane of the key light gets spat out direct lighting only in the mantra rop . In the image plane set the light to * and get all direct lighting from each light separately

Rob

Attachments:
perlight_.hip (256.4 KB)

Gone fishing
User Avatar
Member
14 posts
Joined: July 2014
Offline
circusmonkey, thank you for your reply.

Have got your web site in one of my browser tab opened long time. A lot of usefull information.

Basically, file you've posted is not exactly what i want. It's working for me either. You see, i don't want to have shaded diffuse as separate pass. I need light color pass - AOV with only light unclamped color. And that for each light sources separately. Result should by like i divide “light_name”_direct_diffuse AOV by unshaded texture AOV. But without this operation.

I've modified your example with some notes in example material. I've add my AOV light_color, and used it in ROP. So, as i said in post, it works with each light toggled off, and gives empty passes with it toggled off.

Attachments:
perlight__105.hip (287.4 KB)

User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hi,
Ok well Ive had a dig around and its not as easy as it once was, mainly because I used to set my own image planes up . But if you dig around and set the export components to diffuse & color Then create an image plane using the setting from the drop down direct_noshadow then check on export variable for each component > render .You will get a pure colour pass for each light and a diffuse with no shadow . I must admit the whole set up for that area is a bit confusing with check box components and drop down image planes with settings.
The only thing I have ever done using the separate light colors was to relight volumes.

Attachments:
perlight__105_187_fixed.hip (450.6 KB)

Gone fishing
User Avatar
Member
14 posts
Joined: July 2014
Offline
Hi!
Thank you for answer and example again.
Sadly, but it's not what i need.
You see, in your example if you connect some texture to diffuse color it will appear on render. So, i connected sir Mandril - and his face appeared on color and noshadow passes.
I'm sorry, maybe i explain bad and do not understand some basic stuff.
Will try to explain again. I know that my case is rare.
Attaching picture from Google, can't make better example right now.

So, there is lambert diffuse pass and color from textures pass. And if i multiply them i will receive something like direct_diffuse pass - shaded texture color. It that example we have “rim” pass on bottom right corner - its like what i want - light pass for particular light source. In this example we've got shadows and shading on color from textures pass - lets imagine that there is not shadows or shading. If we've got few lambert diffuse passes(as in example) for different light, we could control all lighting in shot on compositing stage. Like that: (light_pass1)–> grade–>plus–>(light_pass2)–>grade–>plus–>…–>multiply–>(texture_color_unshaded). So, i need (let it be) lambert with my connected normal map, which is rendering “for each light”. And i need this in one shader and in one render, as image planes.
Of coarse, as i said before, it can be done by dividing direct_diffuse(shadow is not important in my case) by texture_color_unshaded(just export color parameter from texture node). And it just very simple, but unfortunately is not acceptable in my case. Because of that i trying to find a way to export “lighting” passes clean from shader.

Thank you very much for your attention and sorry if i can't explain my issue correct.

P.s. based on your example, circusmonkey, i tried one thing - created pbrdiffuse node, call it component as “light_pass”, connected normal. Then add it to result of your surface model. But there is an issue(or feature) of PBR and BSDF - Mandril connected to surface model diffuse color appeared on “light_pass” component passes on render because of mixing bsdf-s(i think). It could be solution, but unfortunately it's not.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Thank you for answer and example again.
Sadly, but it's not what i need.
You see, in your example if you connect some texture to diffuse color it will appear on render. So, i connected sir Mandril - and his face appeared on color and noshadow passes.
I'm sorry, maybe i explain bad and do not understand some basic stuff.
Will try to explain again. I know that my case is rare.

The texture map will render in the colour channel you have just overridden the “base colour” of the shader to output pure colour.

When you render per light , you are breaking the shader into components to be re-assembled to match the beauty render in comp. 99% of the time we render diffuse / direct / indirect / reflection . Very rarely do we ever render shadows separately. Rendering AO > with PBR is really redundant now, its just not used on any modern PBR pipeline. The example scene ( first one shows how to do this ) .

Please feel free to explain your end goal as it might be a better start point. ie render a shot > break the lights out > re-assemble in comp for a grade.

Rob
Gone fishing
User Avatar
Member
14 posts
Joined: July 2014
Offline
I've examined your example (perlight_fixed…) again and i can't find, where you defined “color” component. Can you please explain? Because base on what you say, it should work like i want, but it doesn't for me.
There is a wisdom in your words - i should start this post with explanation of my workflow needs. I'm trying to find answer for a long time.
So, in my pipeline i've got vehicle render process. Each model has normal map with details. Some specular gloss/power maps(which is not important right now, i think). A thing is that one model has got 4-5 different diffuse textures. Normal and glossy maps are universal for all textures. Quantity of light sources and are variyng from 2 to 3 usually.
I'm using my own built PBR shader, with diffuse and specular components. Only one PBR diffuse node, and one specular.
I can't post any scenes because of strict NDA.
Next, compositing process is taking place in Nuke.
After render i'm composing final image with supervisor. And slowly we've come to thing. So, i want to make few unshaded diffuse passes for each of diffuse texture. In one render, in one file. It's simple, i've already got it.
I've got “for each” speculars(direct and indirect) - it works perfectly. But i can't obtain light color passes for month. Shame on me.
I just need those passes which should contains only base constant color with normal map without any part of diffuse texture. Then i will combine those lights, grade them, multiply with diffuse texture pass and that's way obtain my shaded diffuse. Then adding speculars, reflection. Not using AO. And, as a result, i should receive comp in Nuke, where i can change diffuse texture “on a flight”, multiply it by graded lights and receive correctly shaded diffuse all-in-one.
If The Answer wont be found before monday, I will try to make detailed sample scene with pictures etc.
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Great just make a simple box and add some wheels ! .I am not sure what advantage you have at this point , in making your own PBR shader. Just for tests, make a scene up for car rendering , box with wheels will do , add your lights and set it up for rendering.

Rob
Gone fishing
User Avatar
Member
14 posts
Joined: July 2014
Offline
Will definitely make it.
I've been rereading my pot at n-th time and understand that my explanation of my needs kind of “misty”.
And I've remembered one thing!
Do you know Maya's Mental Ray (direct)Irradiance pass? Its exactly what am i looking for! But for each light source separately.
Upper right corner of this picture that i've found.
I'm using my own shader created from scratch(in vex editor) because of surface model has got a lot of things that i don't need(less then mantra surface shader of coarse).
User Avatar
Member
14 posts
Joined: July 2014
Offline
I think I've found what i'd looking for.
I don't need texture diffuse pass in this case - so why the heck i'm rendering it? Just render all of texture colors in separate passes, connect white constant color to pbrdiffuse - and woila! Then, multiplying diffuse result with unshaded texture we've got correctly(i think) lighted pass with great control at compositing stage.
For only one texture light controlled quite simple - grading all of direct_diffuse passes before adding is giving control all over the differnt light sources. Am i write?

Much greatful for your help, circusmonkey. You helped me to look in right direction.

For now, trying to achieve new thing - set a particular region for one of mantra render nodes. Is it possible? Not for render region to see on screen, but to file.

UPDATED: Found it in camera crop settings. Nice.
  • Quick Links