Mental Ray - Shaders


#4025

Really we need a better way to do materials in layers error free! :sad:

Thanks for looking into it regardless.

I am quite surprised that this is such a problem in a mature render package like Mental Ray. I would have thought this was a common requirement or that there would be simple way to do it. I am still hoping there will be, but for now I have given up on it and am testing out juxtaposing three copies of the cylinder with the three different materials and hoping that the alphas will clip them well enough that they line up and look like one. I’ll run a higher res render tonight and see how it goes.

If there any other ideas I would love to hear them though :slight_smile:

Thanks
b


#4026

I think you’ll find that this hasn’t got anything to do with mental ray. The problem is with Max and layering shaders / materials. Mental ray just renders what Max gives it, and if that is wrong, it will be rendered wrong…

Dave


#4027

Is it possible to apply the mia_light_surface shader to a mesh, i saw this was possible thru nodes on maya but i dont find this shader in max or is it just part of mia monolithic material?


#4028

This looks like you forget to turn up the “brdf 0 degree angle” to get a fully reflective object.

For metals, ALWAYS:

  1. “reflective” color to white and reflectivity 1.0
  2. “brdf_0_degree” color high, much higher than default 0.2
  3. Check “Metal Material” checkbox
  4. Put the desired color in the diffuse slot

You can also try this.

  1. In the BRDF check “By IOR (fresnel)” mode
  2. Set the IOR to 25 or higher (yes, that is an actual IOR for metal, conductors IOR work differently than dielectric (transparent) things IOR)

Also, metal is 90% about reflections, you generally need something “cool” to reflect. A simple sky never is more than “ok”, but so will a gold object photographed in a cloudless desert also look “boring”.

See “gold in the sun” (reflecting just sun&sky)…

…vs “gold in the kitchen” (exact same material, reflecting good old “kitchen.hdr”)

/Z


#4029

The composite material is a very bad way of doing this (for a ton of technical reasons).

A much more efficient way to do this is either
a) the blend material
or even more efficient (but harder to do)
b) actually have maps that modify the parameters of the A&D material to your desired look, i.e. a glossiness map, reflectivity map, etc. etc.

For this case, though, I think the easiest/best is the blend map. And if you want to blend three things, well, the “nested blend map” trick should work.

The reason I suggest this metohd is that only the blend map “plays nice” with photons, the composite map… not so much.

/Z


#4030

Does efficient mean longer?, lol.

Also, using maps white is 100% and black is 0 correct. So just a thought, if you want 63% from a map, would you place a white layer over a black background in photoshop and set it to 63% opacity? Just a guess. That should be equal to 63% correct? So I guess you would need to figure out your settings before hand.


#4031

No, just more render-efficient.

But if your masks are (largely) pure-white and pure-black, “Blend” is very efficient too. It’s in the areas where you have a non-white or non-black “Blend” value both materials get evaluated, which can take longer (render time).

This is a single nested “Blend” material on the teapots…

Yes, but Blend works nicely too, so the “other” method was really just the “if you really want the ultimate render efficiency”, which you may not need in this case.

/Z


#4032

Hey MasterZap that tip helped a lot. the IOR - 25. it really worked out really good.
The “brdf_0_degree” i already had .08 so you’re late in there but the IOR looks really nice. gonna try it with a HDRI environment to check the reflections.


#4033

Another example.

/Z


#4034

Thanks Master Zap.

I will go back and try the Blend material again, but that is where I started with this problem with caustics:

http://forums.cgsociety.org/showpost.php?p=4729248&postcount=3992

This is why I ended up going to composite maps and “material to shader” options - because I couldn’t seem to get around this issue. I was using only A&D materials in there. For your example, are the glass and label materials part of the same Blend, or are they two mats on two objects? I’m wondering if that would make a difference, since in my case the label is a different object so it can have thickness so the bottle had it’s own simple A&D mat.

I actually had already decided to try and do it all in one material with mapping as you suggest, but I could not figure out a way to do the BRDF reflections properly. How would I create a map to do the paper BRDF reflections at around .2 and the metal foil parts at around .9 or 1? Also, is there a way to map the “metal material” function?

Thanks again!
b


#4035

A single teapot object, one material, so both glass and label is a single material. I re-use
the mask as a bump map to get a bit of “edge” on the label.

Exactly, this is why the “blend” material is better. I didn’t consider the fact that certain parameters are not really mappable.

Of course, there are ways around a most things, for example, all “metal material” really does is (roughly) copy the diffsue color to the reflectivce color. Changing the “BRDF” curve can instead be “emulated” by using a Falloff map in the reflectivity slot and use 1.0 in both 0 and 90 degree reflectivity slot and let the “Falloff” map do the job… etc. etc. etc…

But truly, “Blend” is “easiest”.

/Z


#4036

But truly, “Blend” is “easiest”.

Thanks - it really does seem that way. I just need some time to test if the caustics problem is still happening. I have installed 2008 since that first test, maybe that will help too.

I’ll let you know how I make out - thanks for the help
b


#4037

Well in another project of mine. a hot rod. i have a situation i dunno how to handle.

In the taillights, i made a lightbulb but i tried using the glow(lume) shader but the light is too weak or not showing at all, so i must be doin’ something wrong about that. And the other thing is the glass. How do i make the glass textured (with a proper tail light texture) but still allowing to be lighten up from behind by the lightbulb?


#4038

Don’t use lume glow for lighting anything up at all. It’s not meant to light anything, it’s only meant to display the material as being ‘lit’. You need to use actual lights for everything else. As for the glass, without showing any pictures, I really have no idea. Just model it out properly and let raytrace do it’s job if realistic light is your aim.

On a low polygon model, you simply use a texture and don’t create a light inside at all. A texture shadered and illuminated properly with a separate light object simply outside the tail-light model usually does the trick.

a very simple and quick light solution (Jeff’s asphalt material used here). Basically one point light inside each light, with a glass mesh covering the light cone itself and mudelled to have a slight texture in it. Not very real, but again, it’s an example of how common sense can work.


#4039

Actually i’m making this for rendering and by the pace of it its going to be very high poly so idk how many polys it gets… its gonna take several hours anyway on the final render.

Well by my question was how do i texturize the glass mesh and still let the light go through it?

EDIT: Well i’m doin’ a slow ass render to show you what i got so far.


#4040

Why do you want to texture it if you plan to make it very high poly? Actual carlights are not textured, they are simple plain plastic or glass. You just need to model it.

Even if you don’t want to model the inside of the carlight glass texture, you’d be using displacement map instead in the inside, or even bump might work, and again that does not stop any light going through it.

mental ray shaders don’t obstruct light going through them as long as raytrace settings are high enough, from what I know this entirely depends on the materials transparency. Direct light will go through depending on material transparency alone. Though without raytrace depth the material itself will look black.


#4041

Vaher what kind of light u used in that scene?


#4042

Regular photometric point light.


#4043

Ok, i’m making a few tests now.
But from what i can see it works pretty good, even though in viewport on prespective the ligth would seem to light all the scene, reflecting in the car mesh, but after rendering it didn’t, only light up what it was suposed to.


#4044

http://defaultcreation.com/datas/users/5-hotrod8.jpg

  Although that appear 2 lights under the right tail light, wich weren't there before.
  
  And the right light is brighter although the left one is a copy of the left.
  
  And yes there is a scene light, it is on the right side.
  
  
  
  Front Side                   ..............0 mr Sun
      |                          ........................./
      \/                      .....................\_
  ________
  | .........|
  |          .........| -> Car
  |______|
  
  
  Soz for the drawing... just too lazy to open paint.  -_-''
  
  (this probably gave me more work though  xD)


And i just rendered with the mr Sun turned off, the left TailLight still appears to reflect outside light (wich there isn't one) and the 2 light reflections from under the Right Tailight are down to one.