Author Topic: strange flickering in Atmosphere and Terrain  (Read 2738 times)

Offline Haaranoos

  • Member
  • *
  • Posts: 4
strange flickering in Atmosphere and Terrain
« on: July 17, 2014, 02:37:50 PM »
hello

Sorry If this is too basic for you.
I'v got a strange result in my render...   
not only the environment flickers ( which I'v been told to raise the AA setting to fix it), but the terrain itself has strange shape change and consequently casts wrong shadows..

maybe I'm doing something wrong, or AA setting should work for these kind of problems..

thank you in advance

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: strange flickering in Atmosphere and Terrain
« Reply #1 on: July 17, 2014, 03:12:40 PM »
Hi and welcome to the forums :)

No question is too basic, so just shoot.

Flickering is caused by GI.
GI is a method for indirect lighting to create details of lighting in the shadows.
Intrinsic to this method is that each frame calculates the lighting slightly different.
What you need is a  more uniform GI "solution" across frames and fortuntely you can do that in TG, here's how in 6 steps and it's not as much work as you may think.

1) In the render node click on "GI settings", then select "write to GI cache file" and then specify a path which has enough free space.
What will happen now with these settings is that frames themselves will not be rendered, but instead the lighting calculations, called the "GI cache" is written to your harddrive. Later we will blend these files while rendering the animation to get uniform/consistent results across all frames.

2) In the sequence tab of the render node you have to specify the range of frames you want to render, as you may already know.
Since the lighting doesn't change that much frame by frame, as the camera isn't moving that fast, we don't need to calculate the GI cache for every frame, but for every 3th frame or so.
You can do that by changing the sequence step from 1 to 4.

3) In the same sequence tab hit "Animation Check".
This will alter some settings in the renderer to make them more suitable for rendering.
Normally these settings are more optimized for still rendering, so that's why this convenient button is there, to do the work of changing those settings for you. Handy.

This will likely fix the issues of popping geometry/shadows.

4) Render your animation with the "render sequence" button. (how many times I hit "render image" instead...I don't wanna know)
Now TG will save out the GI cache for every 4th frame. This doesn't take much time, especially if you use default settings for GI cache detail and sampling.

5) Once finished we want to render the animation itself, of course.
In the GI settings window switch from "write to GI cache file" to "read GI cache file(s)" and specify the first GI cache file of the sequence.
The blending mode should be "Interpolate (for animation)" and the default blending of 5 files per frame is a good starting point.

6) Go back to the render sequence tab, change the sequence step back from 3 to 1 and render!

Good luck!

Cheers,
Martin

Offline jdent02

  • Member
  • *
  • Posts: 38
Re: strange flickering in Atmosphere and Terrain
« Reply #2 on: July 18, 2014, 03:16:35 AM »
Did you hit the 'animation check' button on the sequence output tab of the renderer?  The shadow popping is probably being caused by the mountain 'snapping' into a higher detail level as the camera gets close to it.  There's a slider called "ray detail padding" in the renderer section that can be used to fix this.

Terragen's rendering engine can be very complex to get a grasp of, and if you post your TGD file there are a lot of smart people around here that'll take a look at it and give you even better advice. 

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 12815
  • Holy snagging ducks!
Re: strange flickering in Atmosphere and Terrain
« Reply #3 on: July 18, 2014, 04:54:11 AM »
Simple answers: for the major light flickering use GI caching, described in the documentation here:
http://www.planetside.co.uk/wiki/index.php?title=Terragen_2_Global_Illumination#Rendering_with_GI_cache_files

For the shadow flickering, use Ray Detail Region Padding, described on this page (near the bottom):
http://www.planetside.co.uk/wiki/index.php?title=Render_-_Advanced_Tab
Try a value of 0.5 to start.

- Oshyan

Offline Haaranoos

  • Member
  • *
  • Posts: 4
Re: strange flickering in Atmosphere and Terrain
« Reply #4 on: July 18, 2014, 06:33:18 AM »
thank you :)
the Ray detail region padding did the trick.

for now I have a smooth animation.
the only thing that I need to adjust is the large shadow side of the mountain which flickers a lot.
I think I should bump up the GI setting maybe.

Offline Tangled-Universe

  • Terrevangelist
  • *
  • Posts: 6183
    • CGScenery.com - Terragen Tutorials!
Re: strange flickering in Atmosphere and Terrain
« Reply #5 on: July 18, 2014, 02:54:09 PM »
I think you need to increase GI sample quality then...default is 2, so try 4 or 6 in short test sequences.
(Make sure GI cache detail is at least set at 2 or may be even 3.)

Offline jdent02

  • Member
  • *
  • Posts: 38
Re: strange flickering in Atmosphere and Terrain
« Reply #6 on: July 18, 2014, 07:47:49 PM »
To add to Tangled's suggestion, you might also want to look at your atmosphere samples, sometimes you can get noisy shadows if that's too low.

Offline Oshyan

  • Planetside Staff
  • *
  • Posts: 12815
  • Holy snagging ducks!
Re: strange flickering in Atmosphere and Terrain
« Reply #7 on: July 18, 2014, 08:42:43 PM »
Are you using GI caching? (note: this is different than the "GI cache detail" setting!) If you're not, no amount of increase in GI quality will fix the flickering for good. If you do use GI caching (with multi-cache blending, e.g. 3-5 frames), you can safely use pretty low GI values and avoid flickering.

- Oshyan