Jump to content

Per-light exporting example


pbowmar

Recommended Posts

Here's an example of per-light exporting using the cool new feature in H9's Mantra. This was started by Jerry on the mailing list.

Basically, you export each thing you want per-light inside the Illum loop, then in the Mantra ROP, you specify the same VEX export variable multiple times, but point to a different light for each variable.

I added a couple of very simple custom expressions to make life easier when setting up the ROP that extract the light and the variable for you from the Deep Raster entry (uses $CH in the custom expression which returns the name of the channel it's being used in).

The ROP is something that you'd ultimately write a simple RMB script for, that would automagically scan for all export variables and all lights and fill the ROP in for you.

Also, sadly VOPs still is not complete, there are quite a few VEX functions that do not have VOPs :( I have an embedded VOP that exposes the BRDF functions, which are some of the VEX functions without VOP equivalents. You could do this with an inline VOP, but I find those fragile and ultimately to be avoided if at all possible.

Cheers,

Peter B

PerlightIllumLoop_v0001.hip.gz

Link to comment
Share on other sites

Thank-you Peter!

The two convenience functions outlight() and outvar() are nice, simple and work well. Should be default functions IMHO.

I usually channel reference the Quantize and Pixel filter to the beauty default pass or to the first light layer if you only want an 8bit beauty C pass. That way when you compare the beauty C with the slap comp of all the lights they are the same. Just do a diff to check. Could even automate this before you pass the plates on to the compositors to make sure all the lights made it.

Also, sadly VOPs still is not complete, there are quite a few VEX functions that do not have VOPs sad.gif I have an embedded VOP that exposes the BRDF functions, which are some of the VEX functions without VOP equivalents.

Keith is cleaning up a four part OldSchool blog on how to take a default vex function and build a "sesi approved" VOP complete with signatures complete with videos and support files.

I figure we can all (sesi user community) contribute to this project. Transpose VOP is done. :)

Link to comment
Share on other sites

  • 1 month later...

Thanks you very much Peter.

I have it set up and working well. I was wondering if anyone knows if it is possible to implement bump mapping with this.

I did try but it stopped working so I'm guessing the VEX code needs to change to accommodate this, or I'm going about it

the wrong way.

Thanks

Jerry

Link to comment
Share on other sites

Hi Jerry,

I have something a little better coming soon with more automation but I'm running into bugs/issues in 9.1.xxx that's slowing it down.

What do you mean by bump mapping? That shouldn't be affected by the per-light stuff since it's just a manipulation of the normal. I'm not clear what the issue is.

Cheers,

Peter B

Thanks you very much Peter.

I have it set up and working well. I was wondering if anyone knows if it is possible to implement bump mapping with this.

I did try but it stopped working so I'm guessing the VEX code needs to change to accommodate this, or I'm going about it

the wrong way.

Thanks

Jerry

Link to comment
Share on other sites

Hi Zasid,

Basically, in a lot of professional environments you want to be able to make the large majority of your look decisions in a compositing package instead of re-rendering 3D elements, since it's much faster to work in 2D than 3D. So, by splitting out everything from the render into their own layers/channels/passes (everyone seems to use slightly different terminology) you can rebuild the image in the composite package, and then make colour, brightness and other changes in close to real time.

Cheers,

Peter B

Hello Peter,

I am new user to Houdini,can you please explain it a bit where it can be useful?I mean to ask some practical example of how it can be used in wat scenarios? I will be thankful.

zasid

Link to comment
Share on other sites

  • 1 month later...
  • 2 weeks later...
how would this work for instanced lights?

how would you..

A ) get the sum of all instances of one light combined in one pass

B ) get a pass for each instance of the light

Hmm, for #1 I'm going to say that you'll need to use getlightname() somehow, but I'd have to have a play. Might be tricky since instanced lights get named automatically.

Getting a pass for each instance wouldn't be too hard since each instance passes through the illuminance loop. The only tricky bit would be configuring your deep raster outputs on the Mantra ROP which would have to be done with a script of some kind that "knew" about the instanced lights.

Cheers,

Peter B

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...

hey guys

i finally found a relatively simple solution for my first question .... how to get the sum of all instances of one light combined in one pass

the way i did it now was to create a separate illuminance loop for handling just the instances of one light. this is done using the light mask on the illuminance loop.

if your original light is called e.g. "drone_engine_light" then in the light mask put "drone_engine_light*" and that loop will catch all of the instances of the light.

now instead of doing per-light export from within the loop you just export the result/sum of the loop.

if you need seperate exports for other lights as well, those can all be handled in a second illuminance loop with regular per-light exports

Link to comment
Share on other sites

hi Peter thanks for the reply like what Jason suggested to dump the scene in ifd format and check how the aov works. ofcourse I would like to but I have 9.5 Non-commercial so can you send it in version 9 or so... so that i can open and dump the ifd... pls help me..

I suggest that because you were asking about IFDs earlier in the thread, but just curious - why are you interested in the nitty gritty of the structure and content of the IFD format so soon? 99.99% of the time, no-one looks in those for any reason. They should be only be interesting for some pipeline people or the technically insatiable cursed types.

Link to comment
Share on other sites

Hey Jason well in just one word. I want to use Mantra as the renderer in the pipeline so that I can install unlimited no of render tokens. It will be very cost effective for me as well as flexibility. So I was asking... :)

If I get the complete Structure of IFD then it would be alot easier ... to execute the things on module basis...

Link to comment
Share on other sites

  • 2 months later...
  • 2 months later...

does this still work in 9.5?

when i bring it into my own file it says "incomplete asset definition"

the `outvar()`_`outlight()` doesn't work in my own files either... but strangely enough it's fine in the hip file i downloaded......????

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...