PDA

View Full Version : Need Mental Ray rendering help


RickToxik
07-17-2010, 04:44 PM
Hi,
I have just ordered a 700-pages book on Mental Ray, and I will read it. I ordered that book because I am discouraged with how hard it is to render my scenes in Mental Ray in reasonable time. Right now, I've been sitting beside my computer for three days, rendering a 4000x2500 screen of this scene.

http://img143.imageshack.us/i/cgforuma.jpg/

When this is going to be over, it will have taken 5-6 days to render a simple frame. The scene has a lot of refracting glasses, mia_x water shader and displacement (I could not use ocean shader because there is a bug in Maya 2010 that ocean shader does not refract normally through mia x glass).

My setting is I-core 7 920 with 6 gb RAM... Maya settings are fg 100 rays density 1.0
no gi, no caustics, production settings... All rendered in one pass with the #$% scanline.

I am considering learning importons and mr-baking techniques. And of course I think using raytracer would speed up a bit my scene. But I just don't understand how I must wait a week to render this whole thing, while a single guy (Alex Roman) can do a film like this http://www.youtube.com/watch?v=PSGx4bBU9Qc
with a computer slower than mine. Is V-Ray that faster??? Haha, and he won't share any tip with me. I've searched the whole forum, can anybody give me a tip for a better workflow please help please help!!

InfernalDarkness
07-17-2010, 08:20 PM
mental ray is among, if not THE, most customizable of all renderers. You just need to learn to tweak the quality settings to get your speed down, especially with FG. You can tweak FG's interaction on a per-material and/or per-object basis to speed things up. And if you're just using the rasterizer, you can cut down many of your raytrace settings to help too.

Also, you're working with a very large output size (4000x2500). If you plan on doing high-end professional video with Maya, I suggest using a RenderBox or getting a RenderServer of some sort. If you're just doing test-renders, don't do them at such a high resolution. If you're still testing your animation, lower the resolution to something more realistic (400x250, perhaps) and it'll just FLY. If your client wants super-resolutions, they should be paying super-resolution prices as well, and part of your deal should involve a rendering server of some sort, either on lease from Boxx or ArtVPS or wherever, or bought outright.

Not that your workstation is slow, mind you... But you're asking Maya to do a considerable amount of math. This will take time, and even a faster Opteron setup would still take a long time to render such resolutions with a complex scene.

RickToxik
07-17-2010, 09:11 PM
Thank you InfernalDarkness, Screen Typer From Beyond!! your reply is appreciated a lot!

I was not sure if one absolutely needed the kind of product like Boxx (I think it's a render farm?) to render Mental Ray at ridiculous resolutions hahaha!!! The thing is that I will probably use some images I render on a promotionnal banner or something like that, so that's why I try to get as many pixels as I can get...

I'm almost 100% sure that it's the ocean texture/ mia x shader (water) combination that makes my rendering that slow. I had vegetation mr proxies in the scene that I deleted, my scene is only 4mb... I mean, 100 rays and 1.0 is not that high as a fg setting I think...

Because of all the refractions in the scene, I thought that it was the scanline renderer that was taking that long, and maybe I'll render a small percentage of the image when this is all done with the raytracer to see if there's an noticeable difference in earth time... I thought the rasterizer was good only to speed up motion blur?... But I'm also starting to think that increasing the resolution of the frame also exponentially increases the rendering time.

The setting per object idea is a realllly good idea, and I will definitly remember that.

By the way, all the beams are instanced objects, would it be a better idea to make mr_proxies? Maybe another idea to fasten the whole thing, would be to count the exact maximum number of reflections and refractions required in the scene, and then set the maximum numbers of raytrace required in my render...

Too many questions to be awnsered hahaha!!! :bounce: The reason of my post is only that I don't understand how this genius Alex Roman could render such a long animation, perfect in quality, with a single computer (he gives the specs of his cpu on his website I think). Thanks for the great tips InfernalDarkness, I'm really glad when I get an awnser :))

chafouin
07-17-2010, 10:55 PM
The beams must be really simple geometries, I don't think mr proxies are going to change anything. I have to say that I'm really surprised that your image, even if this is a big resolution, takes so long to render.

I remember my longest render was 25 hours on a Athlon XP 2 GHz - 2Go RAM (it was almost 5 years ago) for a 3500*2500 image, and there was a really good reason why it took so long to render: I had no FG, but a dome of 64 lights faking HDR, and all of them where casting raytrace shadows with 20 samples (the worst idea I had in my life, but this was a rule I had to follow for this exercise: No FG nor GI, ahah). I didn't have lots of refractions but high quality textures and slow sampling and filtering settings because I wanted a sharp image (you can actually have a look at it here (http://2.bp.blogspot.com/_2qv_rJq7-rg/R4kwpXv5h3I/AAAAAAAAACs/3XQDAUI2nd0/s1600-h/pentax_HIGH.jpg) ).

I have a question that might sound stupid, but are you rendering your DOF or doing it in compositing? This is the kind of thing Mental Ray can take ages to render. And this is also a good advice I can give to you: never under-estimate compositing and post production, this is something that can boost your rendertimes :)

Talking about the amazing work of Alex Roman, I would say that Vray is generally faster than Mental Ray, that's true. But most of the times, it's because Mental Ray is wrongly set up. InfernalDarkness is right, MentalRay is the most customizable renderer, and that can give you really good results when you know how to optimize your render, but also give you the worst results ever if you're looking for a "single click" way to render.

Good luck reading you 700 pages book. I never had the courage to read these kind of things :)

PS: Don't forget to save your FG solution to avoid recalculating it for every images.

RickToxik
07-17-2010, 11:50 PM
Hi Dot87! I am fairly new to mental ray, even though I've read a lot on the net on the topic...
Your pentax image is very impressing, that faked hdr lighting is really cool!

I wasn't saving my fg maps, and I will try that as soon as next week when my render finishes :twisted: lol...
That will help a lot with an animation with fg like walk-through (exluding animations with moving objects if I am not mistaken) AND also maybe renders from the same scene but from a different perspective?

Except for the water displacement with the ocean texture (and the frame size), maybe the number of my raytrace rays is way too high... (the production setting in maya sets the max number of rays to 10 reflect + 10 refract maximum 20)

So maybe what takes that long to render is something like:
the chrome bolts/screws on the beams on top of my image reflect two or more refractions/reflections of the water and glasses... You understand what I mean...?
Or a glass that reflects the water that itself reflects the glass... The problem is that I need at least three to 5 refractions to be able to see the back of the appartment in the picture, maybe I should count the minimum number of rays required.

I'm really trying hard and working a lot to understand mental ray, I love it, but just can't afford to go to 3d schools or else. Thanks for your help guys!! Keep posting tips like this, it really helps me a lot
:wip: working on it....

Sorry and btw my DOF is made in post!

InfernalDarkness
07-18-2010, 04:06 AM
I looked at your scene for a bit and also wonder why it's taking so long. It's a great scene, but beyond the ocean displacement it doesn't appear terribly complex. But that doesn't mean there's not a lot of math going on...

Doing the DOF in post will also speed things up tremendously, but as a rule, the scanline and rasterizer aren't necessarily as efficient for fully raytraced scenes as forcing it all to be raytraced and using BSP2. I think eliminating DOF and changing these features would seriously improve your rendertimes, in conjunction with some FG optimization too. You may not need 10 bounces, but you very well may need more, but another thing to try would be to turn on the mia_material_x's cutoff threshholds for reflections and refractions, if you aren't already using those.

There are so many ways to speed up a render... Wish I could pinpoint the ones that will help your scene specifcially!

As for exponential speed differences in resolutions, it's actually very linear. A 1000x1000 res image will render 8 times slower than a 250x250, and so on. For me, 100DPI=1100x850, and a 200DPI=2200x1700. Doubling the resolution takes roughly four times as long to render. This is simply because there are four times as many pixels.

RickToxik
07-18-2010, 05:12 AM
You the man!

another thing to try would be to turn on the mia_material_x's cutoff threshholds for reflections and refractions, if you aren't already using those.


Hmm... I am not really familiar with that, but I'll definitly dig in that concept.

chafouin
07-18-2010, 09:05 AM
Do you really need to have displacement for your water ? You don't need to have big waves, a mix of normal maps and bump maps could give you the same look.
Displacement is something that can make your render realllyyy slow, you have to use optimized settings with the mental ray approximation editor.

RickToxik
07-18-2010, 10:52 PM
Hi, I've looked back into my displacement map settings and the initial sample rate is only set to 16 (and I fear it will give me artifacts).

I, indeed in this case, should only have used some bump for the water, but I was trying to recreate the exact effect of my previous ocean shader. I'm having a hard time finding the way tu use mental ray displacement features, because I believe they differ from the Maya's regular displacement function.. Humm right? I tried to use the "calculate bounding box scale" in the displacement feature of the poly plane and it didn't work. I'll try to find a tutorial on how to use mr displacement features (approximation, mr nodes), but I've not been successful on that up to this day. And the documentation in Maya on mental ray is incomplete I think. They explain how to use the basic shaders, the sky and the portal lights, but for the other shaders, you're on your own..
Cheers :beer:

3DRenderer
07-18-2010, 11:38 PM
I am too interested a little bit more in Mental Ray optimization settings for an animation scene. My renders arent terribly long, just would always like to make minor tweaks here and there to get the renders pumping out.

So far some nice considerations for a few settings.

RickToxik
07-19-2010, 01:42 AM
- Saving fg maps (but not for moving objects)
- Using the raytracer + BSP2 for large and complex scenes
- Lowering the numbers of rays in the raytracer to the minimum required
- Setting a per-object final gather quality setting
- Tweaking the cutoff threshold (and the rays count) for each refracting/reflecting mia_x material
- Plan for work in post composition

These are not settings but I believe they are good tweaks to start with. :hmm:

But I feel too there is much more to be said about mental ray rendering! I'd like to know why people use importons and map-baking, and if they speed up anything vs quality.

RebelPixel
07-19-2010, 01:59 AM
i have a question since a lot of time, i never made my head around this..

I use softimage, i always heard people speaking about "Baking FG map, and reuse it for animation"
i'm confused on how this can speed up things, or why this should be done, i've searched and studied a lot but i cant make my mind on this.

In softimage when i use MR for animations i usually go for "Append new FG points to file" and render it out, i dont save any FG map to get reused, simply because then i would have to do 2 renders and it'll take a lot of time

Can someone explain me the correct procedure and the difference between "Append new FG points to file" and a saved FG map ?

To my knowledge saving FG maps = Render first the entire animation (for example from fram 1 to 400) rendering and saving only FG in a file, then re-render everything using FG from file but you have to go again over 400 frames.

With the method i use, i just render once frame 1 to 400 with the option "append new FG points to file",

Any help wold be nice because im still confused on how to do this properly, if someone could explain step by step the difference with those methods and how it should be correctly done.

Thanks a lot

RickToxik
07-19-2010, 03:39 AM
If you're interested, you guys should watch some video tutorials on www.i3dtutorials.com (http://www.i3dtutorials.com)

They have a lot of free stuff, and I have found some great tips for tweaking Mental ray.

and so does the free WonderHowTo...

chafouin
07-19-2010, 08:06 AM
RebelPixel : I don't use XSI but I think it's possible to render only FG. We can do this in maya (Feature tab in the render globals, Render mode, Final Gather Only). Otherwise you can certainly find a shader to render only irradiance/FG/GI, I think puppet had one in his shaders pack. The idea is that FG doesn't care about shaders and materials, only about geometries. So if your models are final, you can render FG pass just once, and not everytime you tweak a specular or a texture in your scene.

Append new FG points to the file is a good way to calculate FG. It's certainly faster than calculating all the points, and it avoids flickering during rendering.
The difference with a saved map is that it's always calculating FG before your render, because it will be looking at the spots in your image that might don't have FG points yet.
What I would do is to render all your animation with Append new FG points to file, and when it's done, save your FG solution into a file, and load it without re rendering it. Then you can render everything else.

Also, for animation you might be interested in baking maps like ambient occlusion, FG or GI for the things that don't move in your scene (your background for instance). Since these are the things that are subject to flicker in animation, and could be also long to render, you can bake them into a texture and apply it in a surface shader, in a different render layer that would be your irradiance or occlusion pass.

PS: Rick: About the displacement, have you tried the different presets you can find in the mentalrayDisplaceApprox that you create from the approximation editor? I don't really know what your talking about when you speak about the initial sample, sorry.

RickToxik
07-19-2010, 04:54 PM
I've done some other renders since my last post, too many raytraced reflections on my mr materials was my initial problem.

RickToxik
07-20-2010, 04:01 AM
...one thing I've learned in this tutorial is that almost every -mental ray rendering setting- depends on -the area and maya lights settings-... So you ajust the lights first, and then the render settings. You really have to save your gi and fg maps too if you want to render faster.

RickToxik
10-30-2010, 10:25 AM
And my images sometimes are grainy so I was cranking up every MR value but the good ones lol. The way I'm rendering with mr these days is:


- (I almost always test with a very low anti-aliasing setting, you can also create your fg map and gi in low-res) Anti-aliasing seems to be the most critical element in overall render speed (and if too low poor quality?)

- I first make sure the image is not grainy in the darker areas by increasing the area lights "high sample" value until I know which setting is high enough for the final render

- Since I always use the architectural shader (mia_x), I raise the cutoff threshold of the reflections (this is so important) and limit PER-MATERIAL the number of reflections/refractions

You guys helped me understanding some important mr concepts, thanks a lot!

3DRenderer
10-30-2010, 10:38 PM
Since I always use the architectural shader (mia_x), I raise the cutoff threshold of the reflections (this is so important) and limit PER-MATERIAL the number of reflections/refractions

That's one thing I would really like to learn and get a better understanding of. The cutoff threshold and per material option settings. How do you determine your settings for those attributes and/or shaders? Are they based on camera distance too?

InfernalDarkness
10-31-2010, 12:11 AM
I don't know much about the Cutoff Threshold (other than it rocks!) technically, but the ray depth per-material override is very nice. Say you have a ton of tree leaves, all using mia_mats, and you want the sky to appear shinier in more leaves (if the final tree looks too dark, for example), then you can set this reflection depth to 1 and most of the leaves will simply reflect the physical_sky!

Or say you're doing something with glassware or bottles and stuff, and you want the overall ray depth to be a 2 or 3 for all other elements in your scene, but you want your reflections and refractions for the glassware objects to go all the way. This optimizes the speed for the rest of your scene, and slows it down again for more detail where you need it.

Same with the Final Gather overrides in the mia_mat_x. For leaves, lowering the quality decreases rendertimes, while the "splotchies" which would appear in (say) an arch/vize scene and be undesirable actually add a greater randomness and color variation with leaves, alongside speeding up your render.

Just some examples, hope they help!

3DRenderer
10-31-2010, 01:40 AM
Thank you the prompt reply , explanation, and examples. Much appreciated, but I'm not actually sure on how to set the correct numbers to optimize my render times.

Im doing an exterior fly-through animation of a building. Starts off (camera) with an establishing shot of the building and them makes it way around, eventually going inside. For lighting, using ibl, actually sIBL, along with deex passes, therefore all mia_x materials, half the building is made up of mirrored glass, and of course a large area of grass.(Forest thread).

I'm just trying to make some logical sense out of this on type of settings will work well with my scene. Also, do perhaps have any kind of info., suggestions, or examples on how to use the interpolation settings. Not the fg interpolation, but the performance attributes...?

graffitimonkey
10-31-2010, 07:42 PM
hi guys, totally new to this and probably shouldnt be sticking this here but I just need help with a tiny (kinda stupid) problem.

I have a cube with only 5 faces and I would like to know how I create the sixth face (before any funny guys say it, no i cannot use undo).

p.s. before anyone thinks I'm a moron and don't just create another cube, I've simplified my primary problem.

any help greatly appreciated, cheers. :)

RickToxik
11-01-2010, 06:19 PM
Sorry. My bad again....

The cutoff threshold of mia_x should not be tweaked too much, it's better to leave it to the default setting. It limits the contribution of the reflections on the pixel composition. So as you raise this value, the pixels where the reflection appears will be replaced by black (a value of 0). This is not desireable, because it only replaces the reflection with empty pixels, or by the diffuse channel pixels but the mix diffuse/reflection with cutoff threshold makes a very weird result.

When I create a new mia_x material, I always set the "Max Trace Depth" to the minimum required. So, as Infernal Darkness was saying, make sure you keep those numbers of rays to the minimum. I usually go with a value of 1 or 2.

Look at the image I posted in the beginning of the thread. Look at the top of the image and you will notice that there are some reflective chrome bolts on the steel beams. This kind of object should have a Max Trace Depth set to 1. We'll never see any difference if these objects reflect a ray that bounces on 4-5 different objects or if they only reflect one level.... Keeping the default setting of 5 Rays on the reflections of the bolts' material is absolutely absurd and it triggers a ridiculous amount of calculations when rendering. Even the glass panels in that scene should not go beyond 2 or 3 levels in reflection (will we really see a difference above 2????).

3DRenderer
11-01-2010, 10:56 PM
RickToxik- So your saying on all materials created (mia_x) you lower the threshold to 1 or 2? Brick, concrete, glass, mirrors would be set to a number much less then the default of 5. Does the same principle apply to the cutoff threshold under the refraction settings?

Also, do you also combine and tweak the Interpolation Settings?

This is all kinda starting to make some sense and am about to do some test. Because Im experiencing some long render times for a 1700 frames. Its been rendering on and off with 2 of my PC's for about 2 weeks now. I actually have about 420 frames left.

You guys been a great help thus far,
Cheers :bowdown:


Forgot 1 more thing...Does "Use Max Dist." influence any huge decrease in renders or improvements?

RickToxik
11-02-2010, 12:42 AM
Sorry I don't know how to use the "quote" feature properly (don't know how to quote multiple sentences), so I'll just copy paste...

- "So your saying on all materials created (mia_x) you lower the threshold to 1 or 2?"

not the (cutoff) threshold, but yes, the Max Trace Depth. The number of Max Trace Depth for BOTH reflections and refractions might be (one of) the parameters of the mia_x materials that impacts the most the rendering time. You can tweak advanced reflections and advanced refractions the same way, but generally you it's possible that you need more rays in refractions.
Consider also that if you're using mia_x for stone, concrete and non-reflective materials, you really don't need those 5 rays of Max Trace. If you don't need reflections, check the option "Highlights only". If you want a subtle reflection, yes you can just lower the Max Trace Depth to minimum (1). My opinion is that it should be always be set to 1, 2, or a different value if you really need it. Mental Ray documentation also suggests that you will almost never encounter a situation where you need more than 2 rays of reflection. Note that the number of "glossy samples" is another parameter that affects a lot the performance and quality of your rendering.

- "Also, do you also combine and tweak the Interpolation Settings?"

I don't know where that attribute is.... In the mia_x tab, under advanced reflection I only have (in Maya 2010) Max Distance, End Color, Max Trace Depth, Cutoff Threshold.... If I'm not mistaken, interpolation usually works by deciding the composition of a pixel by evaluating its "surroundings", and then decides which color better fits for that pixel... I don't know if it's faster, but it can sometimes compensate for poor quality.

I would also have some questions regarding your animation:
-what is the rendering time for a frame?
-what resolution is it?
-what method did you use for the grass?
My guess is that if your windows are 100% reflective, you'd just need 1 Max Trace Depth, so they would reflect the sky and the grass. If you don't have anything else on the outside of the house -even if your Max Trace Depth is set to a higher value- there's nothing more to calculate than the environment and the grass. So unless your grass is reflective, Mental Ray won't calculate more than 1 level of reflection rays.

3DRenderer
11-02-2010, 01:43 AM
- "Also, do you also combine and tweak the Interpolation Settings?"
Here are the Interpolate settings, and in the docs, it mentions how to use it especially with mirrored like objects. http://s1232.photobucket.com/albums/ff379/Smokcan2/?action=view&current=interpolation.jpghttp://i1232.photobucket.com/albums/ff379/Smokcan2/interpolation.jpg
http://s1232.photobucket.com/albums/ff379/Smokcan2/?action=view&current=interpolation.jpg


I would also have some questions regarding your animation:
-what is the rendering time for a frame?
-what resolution is it?
-what method did you use for the grass?
My guess is that if your windows are 100% reflective, you'd just need 1 Max Trace Depth, so they would reflect the sky and the grass. If you don't have anything else on the outside of the house -even if your Max Trace Depth is set to a higher value- there's nothing more to calculate than the environment and the grass. So unless your grass is reflective, Mental Ray won't calculate more than 1 level of reflection rays.
Rendering Time: @30fps Varies depending on layer.
-Main Color Layer, (another scene with just the reflection as a layer, because I did not want the reflections of my grass showing up cause its unnecessary since I already have a grass plane, inwhich does the job). Anyway, back to the main layer, it usually takes between 7-13 minutes per frame.
-Background: 3 frames a minute.
-Matte (DJx's Matte_Creator): 18 frames a minute
-Occlusion: 2 minutes per frame
-Z_Depth: 33 frames per minuter
-Grass: Varies 2-5 minutes a frame
As for the grass Im using mip_binaryproxy and instanced everywhere.

Rendering 1280x720

RickToxik
11-03-2010, 12:43 AM
I have a cube with only 5 faces and I would like to know how I create the sixth face (before any funny guys say it, no i cannot use undo).

It would help to know which app you're using, but in Maya use the function "fill hole" in the polygon menu. I know there's a similar function in Max.

InfernalDarkness
11-03-2010, 01:03 AM
hi guys, totally new to this and probably shouldnt be sticking this here but I just need help with a tiny (kinda stupid) problem.

I have a cube with only 5 faces and I would like to know how I create the sixth face (before any funny guys say it, no i cannot use undo).

p.s. before anyone thinks I'm a moron and don't just create another cube, I've simplified my primary problem.

any help greatly appreciated, cheers.

Start new threads please instead of derailing threads about completely different topics.

To solve your problem: Create Polygon.

It would help to know which app you're using, but in Maya use the function "fill hole" in the polygon menu. I know there's a similar function in Max.

Since this is the Maya forum, let's assume he's using Maya.

@3DRenderer: A lot of people use Interpolation, but I've not much. Perhaps try it on some basic settings, starting with defaults, and see how it affects your rendertimes?

graffitimonkey
11-06-2010, 02:10 PM
thanks Toxik. I ended up extruding the face and connecting the verts, which seemed to work fine. But i shall give your version a try, I am guessing it might be easier (p.s. yeah I am using MAYA :D)

@Infernal Darkness, sorry I just didnt think it was worth starting a whole new thread for a stupid question.

thanks for the help though all

CGTalk Moderation
11-06-2010, 02:10 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.