Mental ray flicker free FG


#1

Hey,

I might be heading back to Mental ray land soon, just wondering if the amazing Flicker Free Final Gather that’s in Max 2010 made it to Maya 2010? This project will probably kick off before Maya 2011 is out.

Cheers,

Nicko


#2

It’s the same thing in softimage/max/maya - can’t see why it would differ from app to app these days :thumbsup:


#3

i’m guessing that’s a no :wink:

Can some one post a some efficient work flows (eg, reduce flicker, keep render times reasonable) when using final gather?


#4

Well if you are going to have animated objects in your scene you are in trouble. If its just the camera that moves around you get away with rendering FG only for the frames where the camera sees something it hasn’t seen before and this way no flicker appears. You will save on rendering times as well. This means saving out your FG map to a file and adding to the FG calculation as needed. Max 2010 even has a drop down function for that in the render dialogue.
I would speculate that a workflow where you render out animated objects on a several pass without FG (but maybe faked GI) and composite this pass in post with the environment rendered in FG would be an option. Haven’t tried that, but I definitely will.
There are work arounds to getting a nice GI feel without resorting to FG like using AO and setting up your bounce lights manually. Either way im no expert on this. If someone else has comments i would be glad to hear your opinions :slight_smile:


#5

Yeah I think it’s a good idea: you can simply calculate FG for the environment and render chatacters on top. Unless you have a very complex GI where it won’t work. So it depends on a situation. if it outdoors, then baking FG is a good choice. If it’s indoors, maybe yes, but for characters you can setup a faked GI based on test renders with GI. Or - you can create a pretty close faked GI with skylight portals as bounce lights, or shadowmaps, if you need a very fast rendertimes. And of course you can simply use AO pass as a quick and dirty way to simulate GI, multiplying it over some soft of a solid color for ambient lighting.
I didn’t test FG for animation interpolation, But I doubt it’s perfect. At least in vray you won’t get anything close to a production-ready flicker-free GI with its option for GI frame interpolation.


#6

It depends on the shot of course. You could try rendering the envirement alone then for your characters create and 360 hdri based on the envirement then use it as an IBL later on to ge the same ambient lighting.


#7

I think there is a difference between max and maya.

From what I heard - max has an integrated fg-interpolation algorithm which creates several fgmaps according to the frames in the timeline and starts interpolating them - so flickering is reduced by a huge amount.
In maya - you don’t have that feature - I think someone made such a standalone interpolation application to use with maya. – but so far definitely every application is better than maya. but hey maya 2011 is out - maybe they optimized things at fg - help says a lot about gi optimizations but nothing about fg - but maybe they took the global term where gi means fg&gi - have not read it yet.


#8

i have made some tests getting reduced flicker with FG in mental ray and it is possible but it has its quirks… :wip:

as in all forums and tutorials i read people suggest compositing bg and characters in post… by saving fg and gi maps for BG then render the characters by recalculating the fg maps every frame with higher setting so you dont get flicker.

its valid and very good suggestion but what i think many people are seeking as i am is to get as much info possible in one pass for time sake. and maybe concentrate in compositing other things like reflections, refractions, shadows, etc…

so for what i have tested there are a couple of settings you can tweak to get better render times. i often set all fg settings to zero then start adding values to see how they help cleaning up the image until i get good results in nice time

-the first group settings i like to turn off are the FG trace depth values by default they are way to high if you need just pure speed and not that much color bleed and accuracy. I have noticed that even if i set them to 0 i get a nice bounces in my illumination. and it reduces the render times quite a bit. could depend on the scene tho. but well if they are 0 you still get bounces and self illumination, etc… so it still is using FG for the main environmental illumination and that for me works.

-definitely turn off the speckle reduction option. it just darkens the image a lot and it wont remove flicker… just speckles from over lit areas.

-then after that basically play with the points density, interpolation and rays. i use relatively high values for all but with the trace depth turned to 0 it kinda runs faster.

when i set up fg i totally dont care about shadow precision from the fg map, i depend mostly of an ao pass and the scene direct lights, but i have discovered that using a nice points density will give you nice fg shadows as well.

a value around 1 to 1.5 will make a very high point density in the corners of objects where you most need them.

then its all about adding some rays and then blurring them with interpolation.

about 150 to 250 rays get the job done for me in most situations. a nice flat 200 if the scene is simple and outdoors and no hdri. if one uses hdri then might need more rays and also very important too blur the map inside 3ds max with the blur offset option inside the map coordinates group. its not the same to have the image already blurred from photoshop. i noticed better results using blur offset.

if you have enough rays then it all about blurring them with interpolation and a value for that totally depends on the scene. i usually blur rays a lot so i use similar values as rays around 150 to 250… but i mostly try to have more interpolation value in case rays are not enough.

thats what i do when i have time to use FG, most of the times i dont use it and i do the ao with standard lights combo. which is really awesome too if and has a lot of underrated features that i dont see people use enough. but thats another topic…

hope this helps getting started in your research.

i might get some time to post a test with this settings later


#9

thx Jeb for your detailed answer. I will definitely try out your settings in future projects.


#10

one more thing tho…

usually if you are rendering some sort of exterior scene with sun light then you get less flicker because the light source is filling up the area with light and flicker happens in shaded areas thats why interiors are a pain in the neck to render without precalculating FG and GI.

in interiors its really worth the compositing technique for BG and character, but with the previous mentioned types of settings the character pass its a LOT quicker and also really speeds up the FG map rendering for the background too. so i think it was worth to mention that i have saved myself a lot of time by doing it that way and maybe someone else might find it useful hopefully.

btw… you have to consider shader render time on top of this. try test rendering fg with a standard material so you can calculate if its worth the wait when all the shaders are applied. sometimes shaders alone make render times unbearable.

haven’t had time to render some new tests to illustrate what im talking about but i have some tests from some projects i’ve done.

all of this except the one with the little kid in the classroom where rendered with final gather. i know they are super simple but i wanted to show the settings i talked about in action in different approaches.

the kid was done different but i think it works as a GI look too… could elaborate if someone is wondering but not today i got a trip this weekend. :wavey:

final gather tests videos


#11

well you can make FG not filker if you make sure that there is no high constrasted value in your HDR map / scene object during your FG phase.
What I mean is the relative maximum color value vs minimum value.
That because FG doesn’t support Importance sampling until this new version shipped with 2011.
You can use importons together with MR.

I have using FG sucessfully wihtout any filcker for 5 years now( even with Fur ! ). Just remember this rules of thumb and everything will be fine !

eg.
http://www.vimeo.com/2856571
http://www.vimeo.com/2857007
http://www.vimeo.com/2847753
http://www.vimeo.com/2001115
http://www.vimeo.com/9730466


#12

hey saturn,

aways found your works awesome. what is your output resolution out of max?, was a lot composited or mainly just all straight out of max?
any render times per frame you could share?


#13

Actually that was done in XSI.
Resolution are 1080p, and what you see is mainly your beauty render.


#14

Hey Harry.

There is plenty of amazing stuff in your site.

I’d love to see some breakdowns of your work


#15

Great posts jeb !

‘compositing bg and characters in post… by saving fg and gi maps for BG then render the characters by recalculating the fg maps every frame with higher setting so you dont get flicker.’
That is pretty much the standard way of doing it, I think that’s exactly what I did with vray about 5 years ago :blush:

When Nicko originally asked, I really didn’t think he meant about workflows, I didn’t understand what he meant by ‘flicker free’ - like it was some kind of special button that didn’t make it over.
Now the more I’m using MR in Maya, the more I’m realising things aren’t quite the same (usually annoying work arounds!), so nice one for clearing that up Sorath ! :thumbsup:


#16

glad to help ragingbull,

its imperative to talk about workflows when dealing with final gather because there are many ways to go about it depending on what you do. 3ds max workflows in their help files, tutorials, master classes, website demos, etc… are really aimed to arch viz. without moving objects.

i’ve seen every video in THE AREA and not many talk in depth about rendering motion graphics or production rendering techniques. gnomon workshop has awesome tutorials but also i think it needs more info in this matter. and by this i mean speed and good quality. I think jeff patton will do some new tutorials soon about final gather and moving objects.

for what i have read in many forums people have figured out rendering techniques on their own. final gather will definetly always make your renders slower no matter how optimized you get it to work.

From what I heard - max has an integrated fg-interpolation algorithm which creates several fgmaps according to the frames in the timeline and starts interpolating them - so flickering is reduced by a huge amount.
In maya - you don’t have that feature - I think someone made such a standalone interpolation application to use with maya. – but so far definitely every application is better than maya. but hey maya 2011 is out - maybe they optimized things at fg - help says a lot about gi optimizations but nothing about fg - but maybe they took the global term where gi means fg&gi - have not read it yet.

Sorath, you are correct 3ds max has that feature but as far as im concerned i cant get it to work nice. if you dont do a really high calculation you get flicker anyway. i guess im gonna look into it a bit more but for now i try to stay away from final gather as much as i can if the project doesn’t need it.

just saw saturns website in the lab section he has a great article that i think many need to read.

http://www.harrybardak.co.uk/diff_conv.htm

never saw that article before but thats the way i go about it in 3ds max tho a bit different
because max doesnt do shader connections like xsi or maya one needs to do it in a different way. i use the ao shader in an omni light(set to environment) as a lightshader that way i avoid having to composite it afterwards. you can have nice image based lighting that way too by putting some environment image in your background as spherical mapping (just like you do on any hdr) and in the AO shader settings enable environment Type=1. be sure to use the blur offset option to smooth the environment images otherwise you get awful noise. but no flicker! :thumbsup: .

another underrated feature of final gather is that it can behave as ambien occlusion when used in brute force.

if anyone is wondering you achieve brute force sampling method by turning off interpolation (set it to 0) by doing that it no final gather no longer takes it into account so point density is not been used also. mostly now you are just adding samples to clean up the solution but it takes a hell of a lot of time to render, but thats because its sampling to infinity, just as an AO shader does when you dont limit the max distance parameter.

so if you limit the ray distance for FG you get an AO approach but with lightbounces and self illumination lighting, but no flicker :buttrock: .

for example i rendered this test to prove my point

HERE IS A VIDEO

video

is not physically accurate by any means but i was able to render it in really quick speed (about 2.2 minutes per frame in a slow 4 buckets machine) and still get all the benefits of FG but without flicker.

this is a worst case scenario for final gather and moving objects… dark interior with animated light. it has A&D materials, sss skin, hair and fur on the mittens and boots, animated self illumination on the wall, one sky portal light on the window, glass, etc… all of this would be a pain in the neck to composite thats why i think many could take advantage of this technique for complicated scenarios.

my settings were these

basically i turned to 0 all the options i didn’t need to illustrate that brute force doesn’t need a lot of tunning.

most important parameters are amount of rays and limit ray distance.

when using brute force the rays behave very similar to AO so the amount of samples you use for AO would do here too, tho you have to consider that this method calculate more than occlusion so for cleaner results more samples are needed but not that much actually.

then limit ray distance works exactly as AO max max distance. its how far fg calculates interaction between objects. and as low as you set it the faster it’ll be but less light interaction with objects you get. so this is one of the more important values to tune.

i used 75cm because it made the self illum light reach a nice distance. i didn’t have that self illumin then i might had set it lower.

bounces work the same as always so if you really need more light bounce increase the trace depth values accordingly.

one thing is important to note is that this method seems to make images brighter and thats because rays are not looking up into infinity so some objects are not shadowing areas that they should… just like AO behaves when you limit it.

Another important note. i didnt use image based lighting here, just flat colored skylight, when using images in environment samples need to be a bit higher. also really important to blur the images specially hdrs

here is an example with material override

could have use more rays but for a test i think its enough. also when objects have a lot of textures more grain is acceptable.

hope its useful for someone, it sure is helpful for me when i dont have time to do complex composites and have to render complex light scenarios.


#17

[QUOTE=jeb][/QUOTE]
Excellent Job dude, I’ll try to do a test with this information in maya, and I’ll post it soon


#18

I did another term at fxphd in January, primarily to do MasterZap’s Mental Ray class - WOWZA was it fantastic, and the main area I wanted to learn about was using FG with animations.
I learnt about that and SOO much more than I thought I would, really amazing stuff indeed :thumbsup:
The hardest part has been getting used to Maya, and using bizarre convoluted workflows to get things working in Maya as quickly as he showed in Max :banghead:

Awesome little render jeb :applause:


#19

Thanks a lot Jeb for sharing knowledge. I just tried rendering it, and it’s pretty fast as for a flicker-free GI. Of course it won’t be as fast as setup fake lights, but it’s pretty decent in quality. I got 1 SD frame for 3 mins, without GI it renders 20 seconds, but… the quality is pretty good. I’m not sure, why do you call it “AO”? Isn’t it just a brute-force? Or mental ray switches its mode to AO?
Adding some reflectivity to the shot added time without GI 1:05, and with - 12:27. So keep that in mind: once you add reflections, it won’t just “add” time, it will calculate them too for GI, not just like AO shader.


#20

-thanks Voidreamer looking up to see how it worked for you in maya. maya can be a pain in the neck when using mental ray some times, but also is cool because it exposes a lot of shaders max cant use easily like geometry shaders and such.

-RagingBull thanks too. hey do you know if those course will be available for download purchase or something. i really wanted to see them but didnt get the chance. most of the stuff i know about mray come from zap or jeff patton, so every tutorial they do about mental ray its bible for me.

mister3d to clarify why i mention the term AO a lot.
the actual ambien occlusion shader is a brute force method by itself in a way that it requires samples to clean the solution.SO Think about Final gather in its brute force method as an ambien occlusion solution but that also calculates light bounce, incandescence in materials, color bleed, etc… So basically YES i guess we could say it switches to AO mode when in brute force.

Also if you have used AO a lot you know that if you dont limit its distance search it can take a hell of a lot of time too. Thats exactly what Final gather in brute force is doing, calculating all that complex illumination to infinity with all objects in your scene thus taking a lot of time to render. Thats why interpolation exists. so one can use less calculations and then clean up that low quality solution by blurring and merging samples together and thats why we get flicker when using interpolated methods.

So as in AO shader the more you limit the ray distance search the faster it gets and the less samples you can get away with. The same happens with final gather in brute force. as explained in my previous post.

Sure its slower than just an ao shader or a faked lights setup because its calculating more than just occlusion shadows and also materials like arch & design use final gather to calculate some specular shading, but its pretty certain you dont get flicker and for me thats something i can count on in production. :thumbsup:

Of course, faked solutions can be pretty cool, in fact thats what i mostly use, but i like having the option to use final gather in a kind of quick way and without having to worry about artifacts and flicker. Specially troubles i have found while rendering in network. dunno if its my network having problems or what but sometimes other computers render the saved FG map solution a little different and produce small detail errors sometimes. i have to check up on that in the future. :shrug: :banghead:

I uploaded a simple scene to demonstrate, im also posting an image of the setup for quick review.

Test Scene

The scene has the final gather method active, you can switch it to AO method by turning off fg and turning on the omni light in the scene. Try not usint the fg preset slider otherwise the settings are lost. no need to turn off the skylight because without fg enabled mental ray doesnt use it.

I used mr exposure to give it nice contrast.

Also used a gradient ramp to have environmental color faking an hdr in a way, tho the ramp renders a LOT faster than adding an actual environment image.

Lit only with AO or FG no point lights used.

I would like to repeat that this isn’t the best solution, or the quickest or the most accurate but it does give interesting effects with predictable results.

If someone is looking to do image based lighting with hdrs maybe try staying away of this method because it will be slow if the hdrs are not treated properly and if not enough samples are used. But not saying it cant be done, just that it will increase render times.