---- DATABASE ERROR ----
Digging Deep: Quick Media Rendering
by Mike Kost
Introduction
Povray media statements can be used to create fantastic scenes, but the
effect is a rendering time hog. Seemingly simple media statements grind
the latest processors to a slow crawl. This is tolerable when rendering
a final, high quality scene, but is truly tedious when doing quick
renderings to compose the scene. Because of this, it's good to have a
feel for how to degrade media quality to decrease rendering times. This
Digging Deep tutorial will attack media rendering times in Povray 3.6 and focus
on how various settings reduce scene quality and media rendering times.
Quick Reading
A bit of media brushing up material
The Scene
To put Povray to work, lets start with a scene that taxes Povray. The
scene shows a light illuminating through a window into a media filled
room. A sphere is placed in the middle of the window to add some
variation and interest. A high quality rendering is shown below.
From here, we'll start degrading the image quality by varying the media
computation method, the number of samples and intervals, the media
anti-aliasing, and finally the variance and confidence.
All the times were run from the Linux command line 'povray +W200 +H200
<file>' on an AMD 64 3000+ system. It should be noted that all
the images link to the Povray source used to generate them.
Samples & Intervals: Method 1
Using media method 1, several test renderings were run with 1, 5,
and 10 samples and 1, 5, and 10 intervals. Render time are those that
were reported by Povray. The results are below.
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
|
|
|
Interval = 5 |
|
|
|
Interval = 10 |
|
|
|
Rendering Time |
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
1 s |
1 s |
2 s |
Interval = 5 |
2 s |
7 s |
12 s |
Interval = 10 |
4 s |
16 s |
28 s |
This scene does not handle the low end well. Still, for composing
purposes, a minimum of 5 samples and 5 intervals produced near-usable
results. The inportant point to notice is that adding samples is
'cheaper' than adding intervals.
Samples & Intervals: Method 2
Now into media method 2, repeating the same Povray renderings done previously under method 1.
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
|
|
|
Interval = 5 |
|
|
|
Interval = 10 |
|
|
|
Rendering Time |
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
1 s |
2 s |
3 s |
Interval = 5 |
2 s |
7 s |
14 s |
Interval = 10 |
4 s |
19 s |
37 s |
Method 2 also has lots visual artifacts compared to method 1. The more
tolerable method is left as a personal judgement. When samples or
intervals exceed 1, method 2 takes longer versus method 1. Besides the
method 1 vs method 2 comparisons, we again see that increasing samples
takes less time than increasing intervals.
Samples & Intervals: Method 3
Media method 3 uses adaptive sampling. Lets see how well the adaptive sampling handles this scene.
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
|
|
|
Interval = 5 |
|
|
|
Interval = 10 |
|
|
|
Rendering Time |
|
Samples = 1 |
Samples = 5 |
Samples = 10 |
Interval = 1 |
1 s |
1 s |
3 s |
Interval = 5 |
7 s |
11 s |
18 s |
Interval = 10 |
19 s |
26 s |
49 s |
Method 3 looks like an improved method 2, though it does have some
artifact quarks of it's own. It does take longer to render than both
methods 1 and 2 and, again, adding samples is less time consuming
compared to adding intervals.
Anti-Aliasing
In addition to the computation method, samples, and intervals, there's
other settings to tweak with to reduce rendering time. By default,
media has some amount of anti-aliasing enabled. To disable
the media anti-aliasing, the scene files added 'aa_level 1 aa_threshold 1.0' to the media statement. All images were rendered with 10 samples and 10 intervals.
Method |
With Anti-Aliasing |
No Anti-Aliasing |
Method = 1 |
|
|
Method = 2 |
|
|
Method = 3 |
|
|
Rendering Time |
|
With AA |
No AA |
Method = 1 |
28 s |
29 s |
Method = 2 |
37 s |
38 s |
Method = 3 |
49 s |
49 s |
The anti-aliasing is noticable when looking at the method 3
rendering, and barely noticable with the method 1 and 2 renderings. The
small image change did not significantly alter the rendering times.
Variance & Confidence
Variance and confidence are statistical parameters used to determine
when the media is properly sampled. Higher quality variance and
confidence settings can dramatically increase rendering times, but can
lower quality settings reduce rendering times? There's one way to find
out. The regular variance and confidence use Povray defaults, while the
reduced variance and confidence were set to '2.0/128' and '0.8' respectively.
Method |
Regular V & C |
Reduced V & C |
Method = 1 |
|
|
Method = 2 |
|
|
Method = 3 |
|
|
Rendering Time |
|
Regular V & C |
Reduced V & C |
Method = 1 |
29 s |
28 s |
Method = 2 |
37 s |
37 s |
Method = 3 |
49 s |
49 s |
There does not appear to be a noticable difference
in image quality or rendering time by relaxing the variance and
confidence options.
Conclusions
There are two major observations that came forward from all the testing:
- Intervals are more expensive than samples. To reduce rendering time, decrease intervals first.
- Method 1 is faster than method 2, which itself is faster than method 3. Go with the fastest acceptable method.
From these general rules, the results come from tweaking to your lowest acceptable quality. Happy rendering!
Want To know More?
Looking for more information on media? Check out our Web Walking: Media article
Published: 08/16/05
Last Modified: 08/14/05
Copyright (C) 2005 Mike Kost