PDA

View Full Version : Car paint, light cards, and FG


JeffPatton
11-29-2006, 02:04 PM
I know, probably a confusing title to this thread but there are several aspects to this issue.

So, let me start off with a few real world car paint examples:
http://jeffpatton.net/Tests/paint-ex-01.jpg
http://jeffpatton.net/Tests/paint-ex-02.jpg
http://jeffpatton.net/Tests/paint-ex-03.jpg

Now, I have a real simple studio setup in mental ray with a few photometric lights and some light cards (using an output map) just to give some proper reflections from my actual light locations.

Here's a cropped sample render using the car paint shader:
http://jeffpatton.net/Tests/paint-01.jpg

Notice how the reflections from my light cards aren't pure white as I would expect. If you look at the real world examples at the beginning of this post I chose those examples because of the dim lighting, yet still bright highlights on the paint.

So, to make the reflections brighter I can increase the output map settings on my light cards...but naturally that borks up my lighting by adding light since FG is enabled...but the reflections are white as shown in this render:
http://jeffpatton.net/Tests/paint-02.jpg

I've tried to use several of the shaders on maxplugins.de that deal with controlling the ray types to try and eliminate my light cards from contributing to the FG solution regardless of how high my output map settings go....but no luck so far.

The only solution I have found thus far is to turn off the reflections option on the car paint and use it as a base material in a shellac or composite map. Then use a reflective material for the "clear coat". This method has it's highs and low's as well. One low is that it's harder to control the colors because I'm having to mix in new colors...but on the bright side now I can use a bump map on the clear coat layer to simulate an orange peel effect. Here's an example using a composite material:
http://jeffpatton.net/Tests/paint-composite-mat.jpg

For a car paint comparison here's a maxwell car paint material from their website:
http://jeffpatton.net/Tests/Adrian-MW-carpaint.jpg
and a Vray carpaint created by using a Vray blend map:
http://jeffpatton.net/Tests/paint-vray.jpg
Ignore the fact that I didn't let that image completely render. I figured I had enough rendered to show the effect.

In the Maxwell version you can see how the reflection is bright white as expected with the moderately lit environment. In the Vray example, I had the lights too bright...but I'm sure the reflections would still be bright even if the vray lights were less powerful.

Sooo, finally my questions:
1. How can I make a powerful light card that does not contribute to my FG calculation.
2. Shouldn't the car paint materials reflections be brighter? I'm thinking that when I use the shellac that's an additive mode therefore that's why the reflections are brighter? I know what mode it is when I use the composite map...so maybe the car paint reflections should be in an add mode?

Mr.Ray
11-29-2006, 02:17 PM
Humm that look pretty good to me

mustan9
11-30-2006, 08:37 AM
Can you post your scene file, and I'll take a crack at it.

We had the exact same problem on a car commercial just last month. I ended up doing different passes for the car bodies, and background.

JeffPatton
11-30-2006, 09:22 AM
Sure, I've attached a similar file with some notes. It would be great if this material worked with the render elements, and then I could just create a reflection pass.

Along those lines I'll have to try using the A&D material for the clear coat layer. With that I may be able to generate a render element reflection pass...but I'd still like to know if it's at all possible to use a high output light card to brighten the reflections without it adding to the FG solution.

Thanks.

mustan9
11-30-2006, 09:28 AM
You can with a 3rd-party shader like "ctrl_rays" that will allow you to control (reflections, refractions, final gather, etc.. etc..). Sadly, the version I found at maxplugins.de crashes in Max 8, and Max 9. Appears stable in Maya.

I found the source code for another shader that does the same thing, but it's built for MentalRay 3.3 (32-bit).

What if I recompile this shader and get it working in Max 9. What C compiler can you use for MR?

JeffPatton
11-30-2006, 10:34 AM
I ran into the same thing with the crashing on the ctrl shaders (when I'd try to add a map). I also tried the Puppet shaders that deal with FG rays, and they didn't crash. However, when I'd add an output map that was beyond 1.0 strength, it would still produce illumination.

As far as a compiler, I'm not sure. I'm just starting my journey into the world of C++, just for mental ray. The only thing I've been told from others thus far is that I should use the latest Microsoft Visual Studio.net software package. I'm sure that doesn't help you...but it's the only one that has been recommended to me thus far.

MasterZap
11-30-2006, 12:36 PM
There are about a billion ray-switching shaders, you could (in principle) use either.... what you "want" to do is exclude the "whitecards" from FG.

However, another solution is to not have any lights, and let all lighting come from FG, and the light cards will, by definition, be correct, and generate the correct amount of light.

The problem is you are trying to fake a luminous surface *and* have a lightsource, which of course creates "twice the light" since there IS twice the light ;)

/Z

JeffPatton
11-30-2006, 01:04 PM
Thansk Zap, as I mentioned above, I've tried several of the ray exclude shaders from maxplugins.de. Some of them seemed to work, until I increased the output map on my light cards beyond 1.0. Then I still find that FG starts calculating for those light cards for some reason. Do you happen to know of a specific ray-switching shader somewhere that I should try?

Yes, I could light the scene with just the cards, but that doesn't really offer the same results as an actual light source. And, it's much harder to get a clean, non-spotty FG result with light cards only than when using actual lights.

Yes, I realize that it's double lighting. Which led me to search for ways to eliminate my light cards from FG in the first place.

I could also use some of the geo-light shaders as well to turn these cards into actual area lights...but while they work better than in previous versions of Max, I still find them to be a bit hit & miss in Max (at least from my own testing).

I'll go back and research the ray-switching shaders some more, and I'll also start googling for additional ray-switching shaders to try.

mustan9
11-30-2006, 01:35 PM
However, another solution is to not have any lights, and let all lighting come from FG, and the light cards will, by definition, be correct, and generate the correct amount of light.

That doesn't work well. The first it might sound like a good idea, but I've found out the hard way the following.

1) The car paint shader requires a light source to calculate a specular vector for most of the effects. A panel that is sending out FG rays would only result in all the shaders in the entire scene having a diffuse component, but no specular.

2) Specular vectors are required for rendering bump maps on materials. So no light sources. No bump maps.

3) The FG panels produce poor first instance lighting. It's spotty, and you can't control the fall off or attenuation.

4) Materials like rubber, plastic, and stone just don't render correctly.

mustan9
11-30-2006, 02:03 PM
I was able to come up with something close, but not yet perfect.

What I did was enclose the light panel in a black box. The black box catches any FG rays from the panel. The black box is then invisible to the camera, and reflections (done via the object properties).

This works fine until you increase the output amount of the panel. What it looks to me is that MR is casting FG bounces off the car paint objects. So this is a problem because the reflected image in the car paint produces extra FG rays from the car paint object. Does that make sense?

http://img71.imageshack.us/img71/9316/imagesxq2.jpg (http://imageshack.us)

JeffPatton
11-30-2006, 03:00 PM
Neat! That works pretty well actually. Thanks for sharing this technique. :)

EDIT: Ahhh, I see what you mean about the car paint reflecting more light when the output map on the light card is increased above 1.0.

mustan9
12-01-2006, 11:02 AM
Here's a new fix. This trick does work in all cases.

You can adjust the brightness of the light panel, and not effect the FG points.

This image has the brightness of 3.0, but looks the same at 2.0 and 1.0.

http://img364.imageshack.us/img364/8572/truefixedpo7.jpg (http://imageshack.us)

I added a spot light with a rectangle soft shadow area. Turned on the option to include the rectangle at render time, and then told the light to "exclude" all the objects in the scene (or include nothing).

MentalRay will render the panel for the spot light, but excludes it from the FG calculations!

Enjoy!

JeffPatton
12-01-2006, 12:18 PM
Cool, that's the ticket, works like a charm (and it's simple too)...thanks!

maxplugins
12-14-2006, 04:06 AM
I'm a bit late, but it's been a bit busy lately...

I use ctrl_rays a lot, and have never had a problem with it crashing. Maybe I'm not using it in the way that the two of you are, but I would be interested in seeing a scene where it causes a crash.

Dave

JeffPatton
12-14-2006, 07:44 AM
Hmmm, sounds like I'm using it incorrectly then if you've had success with it. As far as crashing goes, no particular scene is required for me, here's what I do to generate a crash:
1) Add the ctrl_rays shader to the surface map slot of a mental ray template shader.
2) Try to add any map to the eye map section of the shader and then 3dsmax9 will give me a fatal crash message.

I just tried this workflow and found the color_ray_type shader works great for light cards as well:
1) Add a color_ray_type shader to the surface map slot of a mr template shader.
2) Add an output map to the ray_eye map of the color_ray_type shader and crank the output setting up to 5 or more. Then apply than to the light card (or whatever geometry).
3) Turn on FG & render

No contribution to the FG calculation from the light cards, but they are very bright as I want. Great! Now I can use custom shaped light cards! :)

So maybe I need to use the ctrl_rays shader as a sub-map to the diffuse color/map of a material? If so, then how would I add an output map into that mix?

mustan9
12-14-2006, 08:54 AM
What's a "mr template shader"?

JeffPatton
12-14-2006, 09:09 AM
The mental ray basic empty material. I've found that if I just say "mental ray shader", that means many different things to many people. Some think it's any shader that works with mental ray, some might think it's one of the physics_phen materials, the list goes on and on...

But then since "template shader" is my own terminology as such, I know that's confusing to the folks that are more experienced with mr.

So basically I'm screwed no matter what I call it. :)

F3LIC3
12-14-2006, 09:23 AM
Another way is, to save the FG calculation with an output value of 1 first, and then re-render your pic with an higher value, without computing any FG.
But I think the other ways are better.

I also don't understand why there isn't an option to make photometric area lights visible.

mustan9
12-14-2006, 09:25 AM
OH! That one.

I call that one the "empty mental ray shader". :)

In MaxScript it's call "mrMaterial"

But, I do like the term "mr template shader".

maxplugins
12-14-2006, 11:08 AM
Hmmm, sounds like I'm using it incorrectly then if you've had success with it. As far as crashing goes, no particular scene is required for me, here's what I do to generate a crash:
1) Add the ctrl_rays shader to the surface map slot of a mental ray template shader.
2) Try to add any map to the eye map section of the shader and then 3dsmax9 will give me a fatal crash message.

The most common use I have for it is to remove glossy reflections from the FG part of the render.

I set up the actual material the way I want (ie with glossy reflections, etc). When that's done, I start a new mr material, add ctrl_rays to the surface slot, and then copy my original material to the eye slot. I then copy the eye slot to the FG slot, and remove the glossy reflections from that one, you could copy the eye slot to the reflection slot and change the material so that it looks different in the reflections, etc.

In any case I don't use maps, I use materials in the map slots. Maybe that's the problem...

Dave

MasterZap
12-14-2006, 11:15 AM
What you call the "mental ray template shader" is more correctly called "the mental ray material".

Of course, nowdays most people call A&D "the mental ray material" so....

(Funny thing is we actually pondered calling A&D simply the "mental ray material" and renaming the old one "advanced mental ray material".... but alas, it was not to be such. ;)

/Z

JeffPatton
12-14-2006, 12:59 PM
What you call the "mental ray template shader" is more correctly called "the mental ray material".
I'm just trying to say that regardless of whether I call it "the mental ray material" or "mental ray template shader", or "mental ray <insert whatever name>"...I still end up having to explain what "the mental ray material" is because I find people sometimes call a DGS material "the mental ray material"...or the glass physics phen "the mental ray material", or anything that works in mental ray..some consider it to be "the mental ray material".

Whew, I think I just won an award for most "" ever used in a post.

hot chip
12-14-2006, 01:23 PM
i am voting for "mental ray root connection", :o because i use the "mentalray material/template" for all shaders lens, volume what ever.

mfg
hot chip

guanghua
12-17-2006, 07:30 AM
很好!
喜歡這個。
:)
-------------------------------------------------------------------------
我是來自中國的mentalray爱好者.
我的mentalray论坛:http://mentalray.art.topzj.com/