Jump to content

Renderman Shading Language guru ?


Recommended Posts

I'm looking for someone who has some old school renderman shading language knowledge along with shading in VOPS in Houdini.  As I'm having a hard time trying to figure out what I'm doing wrong in VOPs with regards to translating my code as an exercise; surely everyone can't be throwing their renders to redshift etc for rendering ?

 

Link to comment
Share on other sites

Your best bet is to deconstruct a mantra shader to see what it is doing. VEX and RSL are similar but mantra and renderman both have their quirks that make them different. 

With pbr your color output with no lighting is called emission. Look at some of the simpler shaders like diffuse to see an example. Otherwise just multiply color by the bsdf. 

Link to comment
Share on other sites

I'm in transit for the next few days, so no Houdini in front of me. Edit... Unless realtors are being a pain in the arse...

So the way I transitioned from the two languages I started with basic shaders. The new physical models are far more complex now adays, than when I switched. To find a simple example go to the material library and drop down a basic diffuse. Then go check it out in vops.

So one of the biggest first bumps is to render a constant shader in mantra. There are 4 combination of render engine unlike renderman last I worked with it. The default option on Mantra is not PBR, but raytrace. The main difference as far as shading with these render engines, is they are a combination of two geometry processes and for practical purposes will say two shading methods. Raytrace, and micropolygon are the geometry processes, and the non-pbr and PBR methods are for shading. So it's important to place a mantra rop and change the render engine so you can shade correctly when developing such as you are.

For PBR to make a constant shader wire a parameter or constant into a bind export called Ce (i.e emission). In the basic diffuse example this is contained in the Compute lighting vop, which is really just a custom export vop for mantra myriad render layers.

For PBR to make a diffuse with color. Take a Lambert vop that exports a f (bsdf) the yellow wire and multiple it with the color from a constant or parameter vop into the output parameter and variables.

For a non-pbr shader to make a constant shader wire a constant or parameter into the color (Cf) on the output parameters and variables vop.

For a non-pbr shader to make a diffuse shader wire the color from the lambert vop and multiple it with the color from a constant and parameter color and then wire it into the color (Cf) on the output parameters and variables vop.

Sorry for the basic, it's actually the one of the biggest gotcha when switching between the two. The harder stuff is actually easier.

Edited by LaidlawFX
Link to comment
Share on other sites

15 hours ago, LaidlawFX said:

For PBR to make a constant shader wire a parameter or constant into a bind export called Ce (i.e emission). In the basic diffuse example this is contained in the Compute lighting vop, which is really just a custom export vop for mantra myriad render layers.

For PBR to make a diffuse with color. Take a Lambert vop that exports a f (bsdf) the yellow wire and multiple it with the color from a constant or parameter vop into the output parameter and variables.

For a non-pbr shader to make a constant shader wire a constant or parameter into the color (Cf) on the output parameters and variables vop.

For a non-pbr shader to make a diffuse shader wire the color from the lambert vop and multiple it with the color from a constant and parameter color and then wire it into the color (Cf) on the output parameters and variables vop.

Sorry for the basic, it's actually the one of the biggest gotcha when switching between the two. The harder stuff is actually easier.

I assume you are leading up to the answer to my question ? :) From my previous post.

15 hours ago, LaidlawFX said:

For PBR to make a constant shader wire a parameter or constant into a bind export called Ce (i.e emission). In the basic diffuse example this is contained in the Compute lighting vop, which is really just a custom export vop for mantra myriad render layers.

I know that compute lighting works for all types of engines within Mantra :) For the first example, once this is done, where should it plug the bind into Ce of compute lighting ? Otherwise, when creating the Ce attribute is it of color, but if I must connect it to Cd of compute lighting, it doesn't match ?

 

Link to comment
Share on other sites

On 10/11/2018 at 6:38 PM, CinnamonMetal said:

I assume you are leading up to the answer to my question ? :) From my previous post.

I know that compute lighting works for all types of engines within Mantra :) For the first example, once this is done, where should it plug the bind into Ce of compute lighting ? Otherwise, when creating the Ce attribute is it of color, but if I must connect it to Cd of compute lighting, it doesn't match ?

 

Country hoping ain't easy, and is very time consuming, lol.

Compute Lighting does a lot of the old black magic internal to it so you don't have to think about it. It's just and hda so you can see how everything is split up inside. The key part is you don't need to plug Ce into anything. The Bind parameter/option to use as an export option from the parameter is all you need. That is what passes the value to mantra, or better said what mantra is looking for from the compiled shader. So if you dive into the compute lighting you'll see many of those "dead ends" for parameter vops. Their names will correspond to the Mantra Extra Image planes vex varriables. For the standard ones they are just toggle boxes now a days. But to understand it you can make a custom variable called foo in your shader and add the extra image plane and the vex variable called foo. Not what you are after I know. I have not directly answered your question :P Trying to point out the flow from the basics. Once you get those humps the  rest is quite easy. 

Cd is only the term as deifned in SOPs. Once you get in to the material land Cd is only used as a bind import and then multiplied against some other variable. Then they stop using the term Cd anywhere else in that context. Cd used to mean Color Diffuse, but that logic is long gone in the age of albedo and PBR. Legacy YEAH! If you really want you could call your SOPs attribute Albedo to make it easier and instead of importing Cd, you import albedo for instance. You won't see the color in the viewport with Cd, but it's more of an understanding of the oddity of Mantra versus Renderman than anything practical.

Hopefully, my non-answer answer makes more sense now, lol.

Link to comment
Share on other sites

Country hoping is not easy, I assume within the European Union; or did you take a plane outside of Europe ? ;)

If you don't use compute lighting vop, if I understand correct; you can switch between the sub-renders within Mantra, correct ? :) 

42 minutes ago, LaidlawFX said:

But to understand it you can make a custom variable called foo in your shader and add the extra image plane and the vex variable called foo. Not what you are after I know. I have not directly answered your question :P Trying to point out the flow from the basics. Once you get those humps the  rest is quite easy. 

Create a parameter/variable within the compute lighting vop ? I too am accustomed to use diffuse, recently understanding the new method, which as you mentioned is Albedo :) 

Link to comment
Share on other sites

So another not answer, answer that should help you. :) Just getting back into life again. I went from France back to the US. Oh the fun.

Attached is RenderExport.hip

It's a simple setup that show the variables flowing from sops to materials to mantra. It has a grid with an array of attributes P, N, uv, rest, foo. Foo is just a relative attribute as it could be anything, in this case is just a copy of the UV attribute. A material shader builder that imports them with an array of nodes that you can cross wire to see how they work. It purposely does not use any of the components of the principled shader core so you can see how the info flows. If you want you can assign the principled shader core and keep unlocking the hdas and deleting the components that don't matter until you get down to these basic components. This was roughly how the shader were written in H9-H14 or so, and at that time was when the transition was easiest from Renderman to Mantra as the 1 to 1 was very apparent. The shader core make that switch a lot harder to see. Which is why most of what I am saying is complete non-sense, besides the fact that I am not actually answering your question directly. lol.

There are 4 mantra ROPs each set to the different render engine so you can flip between them and see how the shading works. Also there are a series of different BSDF connections you can make to see those basic components. The easiest way to answer is to keep cross wiring that setup until you understand it. Then the direct RSL conversion will make sense. This way you can see how the data flows across the different components of Houdini. At any point you can RMB and see the VEX of those compiled connections. 

You can switch between the different render engine no matter what, but you will notice the shading is different due to the inherit difference between the PBR shading, raytrace shading, and micropolygon shading.

Look at the fooExported bind export vop and the mantra rop extra image planes and you can see how the variables get passed to the render engine. So now when you look in the Compute Lighting vop you can see how all those connections are made. And how BSDF is broken into it's sub-components to be read by mantra.

Apologies again for presenting more a small lego set than an answer. This should help you more. It was the biggest issue going from Mental Ray and Renderman to Mantra. It's that key difference maker, that makes it make sense.

RenderExport.hip

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...