Jump to content

mantraSurface shader. Export refraction


Recommended Posts

Hi !

 

My brain is absolutely exploded, after 4 hours of tries export Reflection pass, Refraction pass and Specular pass, from great Mantra Surface shader in  Houdini 13.5

IN my scene i have only box with mantraSurface shader, this shader has reflection enabled and refraction enabled. Also it has a Diffuse disabled.

I can't understand how it's works !! I see reflections and refractions, has one Omni light in scene and have the big box around with JPG map on it as constant material color..

Please, help me export reflection and refraction from that terribly simple scene ??? In mantra manual i see:
diffuse_color_noshading - ok !! It works.

But WHAT i need to write in mantra node extra images fields for exporting just simple reflection and refraction as passes ?? :)

Edited by rcwork
Link to comment
Share on other sites

no need to modify any material, it's quite straightforward with default Surface model VOP/ Mantra surface material

 

indirect_emission - reflection or refraction of emissive surfaces so reflection of your box with constant material will be there

direct_reflect - reflection of light sources, so even hdr light reflection will appear here independently of any objects reflection, and you can even split it per light

indirect_reflect - reflection of objects in the scene (non-emissive components)

the same for refraction etc

Edited by anim
Link to comment
Share on other sites

Yes as Tomas has stated these planes are all supported by default. 

 

So i am surprised at the difficulty you are encountering. Are you using a Mantra ROP and going to the Output tab > Extra Image Planes > VEX Variable - Specify your plane, ie direct_reflectivity, direct_lighting etc

Link to comment
Share on other sites

Hi, magneto, i have tried but channels is empty. Black. 

Anim, thanks, i try all and get only few results:
1. direct_reflect looks like old "specular" pass
2. indirect_reflect looks empty
3. indirect_emission - give me only reflection+refraction, as i can see, but i can't separate 2 this passes.

 

I see that filed on mantra Properties -> Output 
Export Components
and value: diffuse reflect coat refract volume

 

I try to use "Export variable for each component" but all empty. (with enabling or disabling exporting for lights also)

I'm absolutely confused with this options, that can't give me simple separated reflection, refraction, specular components.. 

Looks like mantraSurface shader can't export separated reflection and refraction. It works for lights only. I need to use Env Light for getting passes. But i can not get all passes when i create some planes with constant materials.

This is a really hard for understanding. Vray, for example, has a simple export for all components.

What the most problem - i need passes for some ice model. I get a good look, but for post - can't get passes.
ok let's start SHOP wiring 

Link to comment
Share on other sites

marty , thanks !

This looks what i need, but specific way. I have done some tests and looks like reflection and refraction passes works, but is another - very lighting-dependend way. 
Why i ask question - because in MentalRay , for example, i use planes (many planes in different statements) with constant colors (or ramp) when i need to create nice reflections on glass, or on ice. Then i catch refraction\reflection passes and tune it on post. In Houdini this way not work, as i can see. Need some light work. 
 
one more question - who know, where the full list hidden (and explanation) of MantraSurface AOV's ?

For example diffuse_color_noshading - is listed in help docs, but no full list there.

Link to comment
Share on other sites

Great stuff. The best explanation of the MantraSurface AOV are inside it ;) - select it and dive inside - press 'i' on the keyboard to investigate the shading network- then keep digging.

 

I'll need to run some tests for your other questions - I know it intuitively currently.

 

Edit: With some initial testing; the components appear to export for Physically Based Vex nodes, ie specular, diffuse, reflection etc, whereas Emission isn't a Physically Based node, therefore it won't render into components.  Can anyone confirm or correct this please.

 

Thanks!

Edited by tar
Link to comment
Share on other sites

If you right-click on a mantra surface, you may view vex code.  There you can quickly see the exported variables without having to search around subnets etc.

export vector direct_reflectivity = { 0, 0, 0 };
export vector direct = { 0, 0, 0 };
export vector indirect = { 0, 0, 0 };
export vector Ce = { 0, 0, 0 };
export vector direct_emission = { 0, 0, 0 };
export vector all_emission = { 0, 0, 0 };
export vector all = { 0, 0, 0 };
export vector indirect_emission = { 0, 0, 0 };
export vector direct_comp[] = {};
export vector indirect_comp[] = {};
export vector all_comp[] = {};
export vector direct_noshadow = { 0, 0, 0 };
export vector direct_shadow = { 0, 0, 0 };
export vector indirect_noshadow = { 0, 0, 0 };
export vector indirect_shadow = { 0, 0, 0 };
export float level = 0;
export float diffuselevel = 0;
export float specularlevel = 0;
export float volumelevel = 0;
export float direct_samples = 0;
export float indirect_samples = 0;
export float nlights = 0;
export vector multiglobclr = { 0, 0, 0 };
export vector sss_single = { 0, 0, 0 };
export vector sss_multi = { 0, 0, 0 })
  • Like 1
Link to comment
Share on other sites

Great stuff. The best explanation of the MantraSurface AOV are inside it ;) - select it and dive inside - press 'i' on the keyboard to investigate the shading network- then keep digging.

 

I'll need to run some tests for your other questions - I know it intuitively currently.

 

Edit: With some initial testing; the components appear to export for Physically Based Vex nodes, ie specular, diffuse, reflection etc, whereas Emission isn't a Physically Based node, therefore it won't render into components.  Can anyone confirm or correct this please.

 

Thanks!

 

I think you need PBR for some of those passes, don't quote me though :)

 

@rc: Sorry I meant when you click the drop down menu Mantra renders many of those layers you want:

 

t6US8Sw.png

 

@anim: Can you please tell me how to use HDRI using Mantra Surface material? Or do you mean if you use the HDRI map for your Env Light, then in direct_reflect will render full reflection? I thought if you use a map in your Env Light, then you can't render passes properly as the diffuse, etc would have the light baked in?

 

 

Thanks :)

  • Like 1
Link to comment
Share on other sites

I think you need PBR for some of those passes, don't quote me though :)

 

 

 

 

I was under the impression that Ray-tracing now evaluates PBR nodes too in H13, iirc.

 

Edit: I think a made a logical error before - the emission outputs a reflection and refraction but not separately. why? that's the question.

Edited by tar
Link to comment
Share on other sites

In 13 you can export any of those passes in the surface model / mantrasurface material.  The "computelighting" vop (which calls the "pbrlighting" vex function) has been added which will evaluate "F" (the BSDF) regardless of the render engine being used.  The "computelighting" vop also contains several "bind" vops to export all the lighting components.

Edited by jkunz07
  • Like 1
Link to comment
Share on other sites

I'm not sure, I haven't had a chance to look into any of the files here.

Emission (Ce) should be completely separate from refract and reflect though.  Any emissive components would show up in the all_emission AOV, this could be split out to indirect and direct emission if you check whether the ray is primary or secondary (using raylevel() vex function).

 

On mantra node, selecting "direct_comp" and "indirect_comp" with export for each component toggled should give you what you need:

direct and indirect diffuse

direct and indirect reflect

direct and indirect refract

direct and indirect coat (usually empty)

direct and indirect volume (will be empty if you don't have any volumes in your scene)

 

So that should give you 10 additional RGB AOVs, sperated by component as well as direct/indirect which can be comped to reassemble the beauty.

Edited by jkunz07
  • Like 1
Link to comment
Share on other sites

Thanks, i have found the fastest solution. 

1. I can not use env light, because can't transform env map on it (only rotate. no scale, no uv edit, no translate)

This is because i like custom objects with ramps, maps etc.

1. add omni Light in scene. Shadows - disabled.

2. add sphere + material "clay" (or any other with diffuse)
3. link OmniLight with Sphere only. 

Now i can get indirect_reflect pass and indirect_refract components from direct_comp and indirect_comp, as Jkunz07 explained about..
Of course, this is the not a clean way, but for "asap" - is work. 

Thanks you for help.

Link to comment
Share on other sites

...

@anim: Can you please tell me how to use HDRI using Mantra Surface material? Or do you mean if you use the HDRI map for your Env Light, then in direct_reflect will render full reflection? I thought if you use a map in your Env Light, then you can't render passes properly as the diffuse, etc would have the light baked in?

...

use hdr in envlight

and the proper use is to actually light with it (default) so usually you want to have it's contribution in diffuse pass as well

but if you only want hdri reflection then enable only reflect component on env light, then it should be in direct_reflect and not have any effect on diffuse shading

  • Like 1
Link to comment
Share on other sites

use hdr in envlight

and the proper use is to actually light with it (default) so usually you want to have it's contribution in diffuse pass as well

but if you only want hdri reflection then enable only reflect component on env light, then it should be in direct_reflect and not have any effect on diffuse shading

 

New question for this thread (may be that is not for actual theme about refractions & reflection, but linked hard)

So:

How can i transform env map ? Now i can rotate it only. How i can see with "portal geometry", map don't attach to geometry UV, or Point Positions. 

How can i transform map?

Link to comment
Share on other sites

without testing, you probably can't transform it - depending on the effect you are after- you might be able to fake it through Cops, using a 2d transform, and link to it with the op: command.

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