Question about the Mantra Surface material

   9105   6   2
User Avatar
Member
69 posts
Joined: 7月 2005
Offline
Hi
I have a general question about how to use the Mantra Surface material.
Having a strong mental ray/mia_material background, I like to work as physical plausible as possible.

If I have a specular intensity value of 1, I would assume that this results in a 100% reflective object (if fresnel blending is disabled). But this is only true if my diffuse value is set to 0 or is disabled (unlike in MR).
Now, in that case one could argue that it's kind of logical to put diffuse to zero if you're aiming for a 100% reflective surface.
But what if my reflectivity should be 75%? Do I need to set diffuse to 25% then? What is the correct math for this?
Is it as simple as 1 - specular = diffuse?
And shouldn't reflectivity always “overwrite” diffuse? When I set reflectivity/specular to 1, how come I can still see it's getting added to the diffuse color? It doesn't make much sense to me if it's set to 1.
Or maybe my logic is broken somewhere?

Could someone guide me to a place where I can read more about this? How to balance diffuse, specular and refraction “against” each other?

cheers,
Daniel


On a side node - Is it possible to give the coat reflection a different IOR than the base reflection?
User Avatar
Member
37 posts
Joined: 8月 2011
Offline
In CG Specularity is used to mean the reflection of highlights from lights, this is wrong, in Physics Specularity means smoothness, a very smooth object is highly specular whether or not it is reflecting something. An example is glass, which is highly specular, but not very reflective. Another example is white cloth, which is highly reflective but not smooth at all. The terms Reflect Lights and Reflect Objects are much clearer and this is how Houdini presents reflections.

Houdini separates reflection into Reflect Lights and Reflect Objects. The Specular parameters are retained to allow you to create conventional CG Effects, which you need when using point lights. The setup therefore allows you to use either conventional CG lighting approach or a Physically correct lighting approach.

Technically for a Physical Renderer you don't need specularity at all, it is redundant, as reflection would cover both lights and objects. Specularity is only present as a parameter to deal with the problem of point light sources that are infinitely small.

You may find the video “Shader Interface Design for Artists”, from CGMasters, of interest:
http://online.cg-masters.com/videos/software/6 [online.cg-masters.com]
User Avatar
Member
69 posts
Joined: 7月 2005
Offline
Thank you for your reply penboak.
Actually, I am quiet aware of the differences between specularity, reflection and how sometimes I use one word to describe the other. Maybe my initial post was a bit confusing because of that.

What I am looking for is a description of diffuse, when ever I use specularity/reflection.

Again, if I have a red diffuse color, but then pump up the reflectivity to 100%, shouldn't this completely override the diffuse color? If an object is 100% reflective, all I should see are the reflections, right?

But with the Mantra Surface Shader, I need to control this manually. So the question would be, that whenever I use a reflectivity value higher than zero, what is the appropriate value for diffuse?
Is it something like
diffuse = 1 - reflectivity? Or is it more complex than that?

Hope that makes my question/confusion a bit clearer.

cheers,
Daniel
User Avatar
Member
37 posts
Joined: 8月 2011
Offline
The reason the balance between reflections and diffuse must be set manually is that objects may also absorb light instead of reflecting it or re-radiating it to the scene (think of a matt black surface…). By setting the diffuse and reflection levels manually you can determine how much light is absorbed, which would not be possible if the adjustment was made by Houdini automatically.

On the Mantra Surface Material the “Conserve Energy” parameter is on the settings tab and is checked by default, it prevents the shader increasing the amount of light in the scene, it does NOT automatically adjust the Diffuse Amount to compensate for reflection amount.

Search Houdini documentation using the phrase “surface model” for more details, it's all there.
The problem is that you can't find it if you search using “Mantra Surface Material”! although there is a link under in the document for the Mantra Surface Material it's easy to overlook it.

I hope that helps.
User Avatar
スタッフ
138 posts
Joined: 12月 2010
Offline
yes you are correct. when you strip out all other variables, diffuse and reflected components are simply added to produce the final output color.

If you dive into the shader you can see that the diffuse and reflected componets are combined via an Add operator.
(double-click on the mantrasurface shader, then double-click on the surfaceModel)

if you're dead set against using an expression to make an inverse relationship between diffuse color and reflected color, you could always modify the shader network to make it “automatic”.
john mariella
Senior Technical Director
SideFX
www.sidefx.com
User Avatar
Member
69 posts
Joined: 7月 2005
Offline
johm
if you're dead set against using an expression to make an inverse relationship between diffuse color and reflected color, you could always modify the shader network to make it “automatic”.

Not at all. I am happy to plug in an expression. Just want to make sure it's the correct one.

So diffuse should always be 1 - reflectivity?

And penboak, thanks for the documentation tip. I will certainly read up on this.

Daniel
User Avatar
Member
8591 posts
Joined: 7月 2007
Offline
it's not as simple as it seems
I had this problem a while ago and posted an RFE that specularity(reflection) should override other components weight if present so 100% specular surface will have no diffuse, SSS, refraction
the same goes for refraction, 100%refractive will have no diffuse, SSS, however specularity will always have priority

this should work on per sample basis so if fresnel is involved, specular masks and so on as well as with possible addition of other layers of specularity which will have even higher priority

how surfacemodel energy conservation seems to work now is kind of averaging all components to final weight of 1 so if sample is set to diffuse 1 specular 1 refraction 1, final weights will be 0.333, 0.333, 0.333
not much problem there, since user can always complement the weights in the interface as he likes and as you suggested here and it is quite easy with expressions
however
if the specular mask is involved, user needs to create complementary mask texture for diffuse, refraction, … to have just part of the object purely specular and so on

also fresnel seems to be implemented wrongly
it seems to be just a fresnel mask which gets multiplied with specular and complementary mask which gets multiplied with other channels
but if specularity itself is set to any value other than 1 especially very low values like 0.001 or even 0 it produces dark colors more apparent at high incident angles since diffuse(and other channels) are (almost) fully dimmed, but maximum added specularity is just very low (e.g. 0.001*fresnel (maximum of 1))
as opposed to correct behaviour where other channels get dimmed by the complementary to the specular weight at that sample
(I posted BUG quite wile ago about this, still seems to be no change, so the only option now is to dive in the shader and change it there, but for energy conservation in PBR it doesn't seem to be so simple)

so even though I love surface shader model in Houdini, I find it a little counterintuitive as well and maybe not as efficient as it should be, maybe even highly inaccurate in some areas like fresnel with specular other than 1

This is just my understanding and observation and it can be wrong so feel free to discuss

(PS: I'm always talking about weights of individual channels, not their real sampled color values)
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links