Pages

2008-04-02

Why does my animation flicker?

It seems like alot of folks on the forums are asking this question. Often when using low GI and Final Gather settings, an animation will flicker because the solution is not refined enough. To have a smooth animation you have to crank up your settings high enough to have similar results for each frame. Problem is you will have extremely long render times. This is my attempt at explaining how to create smooth animations with low indirect illumination settings in Max 2008.

common problem with low GI and Final Gather settings

Here's a quick step-by-step, but if you read further I have exhausted each of these steps in detail.

•Turn on Photon Map, use Read/Write File, then render
•Turn on Final Gather, use Read/Write File
•Lower samples to 1/64 - 1/64
•Render active time segment at every 10 frames
•Turn on final gather Read Only (FG Freeze)
•Increase samples to 1 - 16
•Turn on Save File for Render Output
•Render active time segment at every 1 frame

First we calculate the photon map (PM). When calculating the PM it's a good practice to have final gather (FG) off to see the pure PM results. To save your PM click on the [...] button, and if you are rendering on a renderfarm, be sure to save your PM in a location that the farm has access to (your network). Also be sure "Read/Write File" is checked.

Now go ahead and render a single frame. Mental ray will calculate the PM first, save it to the location you specified, then renders your scene. Very important to note: now the second time you render, mental ray will not re-calculate the PM, but rather read the already calculated PM from the file location you specified because you have "Read/Write File" checked. The PM is scene based rather than view/camera based. This means that when the PM is calculated it is calculating the entire scene (much like radiosity). The great thing about the PM, is that once it is calculated, a rendering can be done from any view using that same PM...wonderful for animations!

Now that we have our PM calculated, we're now going to move onto FG. Unlike the PM, FG is view/camera based. This means that when a FG map is calculated the information in the map is only of that viewing angle. So if you wanted to see both sides of an object, you would need at least 2 FG maps. This is very bad news for animations. Because every frame in an animation is different, you would need a new FG map for that frame. But we have a work around for this that I will get to.

For now:
•under FG check "Enable Final Gather"
•for the Preset choose Draft
•under Final Gather Map click on the [...] button, and choose a location to save the FG map.

Be sure "Read/Write File" is checked and "Read Only" is not checked.

Now to get back to our problem of needing different FG maps for every frame. Instead of creating a FG map for every frame, I create a FG map for a range of frames. For example, if my animation is 100 frames long, I will render every 10 frames creating a FG map for only those 10 frames. Then with that combined FG map, will go back and render every frame. Here's how to do this:

Make sure FG Map is checked on. Then in the Renderer tab, lower your samples to 1/64 - 1/64. We are doing this, because we are not concerned with the actual rendering, but just the calculation of the FG map. In the Common tab, change your Time Output to Active Time Segment, and under Every Nth Frame change it to 10.

Now click Render. You will get a warning that pops up telling you that you are rendering a sequence without saving the images to a location. That's ok, because we are just interested in FG at this point. So click Yes. Now the animation will render every 10th frame. Because we have "Read/Write File" checked and do not have "Read Only" checked, every time FG for a frame is calculated it is added to the previous FG map. After all 10 frames render, you now have a single FG map for your animation sequence.

Now go back to Indirect Illumination tab, and under Final Gather Map check "Read Only". Now when you render, it will not add to your already created FG map, but just read the one that it's locating to. Also increase your samples back up to something reasonable (1-16), and change your "Every Nth Frame" back to 1. Also be sure to set your Render Output to save to a file location.

That's it. Click render and enjoy!

Animation using PM and FG from file

Now it will start the rendering right away without calculating any indirect illumination. Even though the solution for PM and FG are low, it's not that noticeable. The noise will be even less noticeable when texture are added. Note: this technique doesn't work well for secondary animation (animation with moving objects or characters).

If you have moving objects, then you will have to render FG for every frame. You can also render just the moving objects and composite them onto the background in post...this process can turn into a tedious one though!

Thanks again Ramy. i`ve rendered the entire sequence saving the FG map for every frame, but the problem is still there, now is like the splotches are following the moving object and not randomly generated as before. When i render any frame individually, the splotches are gone for that specific frame (read/write file OFF).

You are getting splotches that are following the moving objects because you are saving the FG map. To avoid this you have to calculate FG for every frame, and not save the FG map. If you render at high enough settings you won't get splotches, but this is very time intensive.

thanks again Ramy! i`ve render my scene (well... part of it) like 12 times with different settings (noise filtering, filter type, jitter on and off...) and now i realize that the flickering was generated by a specific material in my scene, so i`ve changed it to a arch&design and everything worked marvelous rendering without saving the FGmap!!!! i`m so happy.thanks again for your time and all your really really helpfull tips and tricks. keep on rocking mental ray!!

Yes i am getting black splotches on objects still. Just like Nacho... saving the map is actually creating black marks on objects that did not have them before even though it fixes other ones.... So i am not sure where to go from here... I have managed to tweek the settings of some of my clips so that i dont bother to save the FG map. I dont have GI turned on so i am not making a PM file. For cases where i cant find a solution should i turn off FG and just use GI so that i can build a nice quality PM map?

I have no moving objects just a moving camera. Just zooming in on something. My latest version is much better. I replaced a standard material with a A/D material. I thought i had already done that but had imported an object from an old scene i think. Now most of my smoke issues have gone away but my render times have gone through the roof with the A/D mat. Working on trying to fix that now.

Actually, this worked well, very well. However I'm having a problem with my walls. They are bumpmapped and as the camera moves down the hall it sparkles. Are these artifacts? Just looks like my walls and ceiling are glistening...My boss wants it out. I'm pretty sure it is a mental ray mat

Fixed it...scintillation I guess it's called. My bump map was too detailed and tiled too small with not enough blur on it. I couldn't get the settings just right so I just changed it from cellular to noise.

Hey! Thank you for this GREAT tip! It's SO USEFUL!I have one small question, how would you determine the amount of frames you skip when you render the FG map (before you freeze it)?In this instance you picked 10. But some times this isn't a good number and you can still see flickers. Is there any method to determine that? Thank you!

This architecture student form South africa realy appreciates this! Have a small Q though if you dont mind - after rendering each frame my pc take a helluva long time to "clean up". I think its just because my model is so damn big - at render time with xrefs laod its 29mil faces (yes its a huge building!!) Im rendering on a friends pc with xp64 and 4gb ram - it does push ram usage to the limit and i have conserve memory at 3500.

Is it possible to avoid flickering without using GI, but only FG? My scene is too render intensive and when I allow them both ı get an hour per frame in an 8-core machine, I need to somehow only use FG and not get flickering. Any ideas?

I'm a second year architecture student and would like to shout out THANK YOU SO VERY MUCH for this neat trick.

Rendering my project already took forever, but to find out that it's flickering after all the rendering has been done?? I was on the verge of giving up and wanted to just submit a flickering animation in a few days time cause rendering the entire thing again with a higher FG quality would be impossible time-wise.

I was so happy when I stumbled upon this post and even happier when I tried it out and saw how it worked.

Hi Ramy,I noticed in your Efficient Interior Lighting with mental ray tutorial you say that you render out your FG map at around 50% of your actualy render size, is this something you could also do for the photon map?

Does this solution require "Project Points From Positions Along Camera Path" to be selected, along with a number of segments? Or does this solution ultimately do the same thing? I'm running on max 2010.

Yeah, I just noticed that after I commented. I looked at your other tutorial that involves moving objects as well, but that process might not be possible with my complex scene.

I'm really looking for a way to avoid so many map files. My photon maps are running 5mb a frame at 1700 frames... about 9gb of photon maps. Am I wrong to say that I need one for every single frame? There has to be a better process than this b/c the render farms can't accept such big files. And this doesn't even include my fg maps - which are larger.