Easy 1-7 Photon Mapping and Final Gather (Biased)

Frequently asked questions about Twilight Render
Post Reply
Fletch
Posts: 12895
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Easy 1-7 Photon Mapping and Final Gather (Biased)

Post by Fletch » Tue Apr 26, 2011 9:09 pm

For those wishing to make changes to the Easy Settings 1-7, they will need to understand as much as they can about what Photon Mapping and Final Gathering is, and how it works with Twilight.
Easy1-7_rendersettings.jpg
Easy1-7_rendersettings.jpg (30.14 KiB) Viewed 49758 times
First, let's discuss in general about the Easy Settings 1-7.
The Easy Settings 1-7 are a starting point for rendering. They attempt to do something "impossible", which is to find an optimum render setting for all scene cases and to do this in an "easy" to use format. They work well for this purpose, but there are always some tweaks one can make depending on the scene being rendered to improve speed or performance or quality.

Because they were created "for most cases", Easy Settings 1-7 need to begin with some assumptions in order to get to a goal of "optimum settings for most cases":
  1. Likely the scene being rendered is of an architectural nature. That is, that the scene is not "technical" requiring infinite reflections, or caustics of lasers being split into spectrum through some sort of dispersion diamond, SSS material, or a global fog-like medium.
  2. Likely the scene will be lit with sun and sky, or it will have around maximum 10 lights. (But wait - aren't there lots of architectural shots with more than 10 lights? Of course. But most people start rendering with a sun and sky system = 2 lights.)
  3. People rendering these scene are in a hurry, and they don't care for "super quality" as much as they care for "good quality in good render time" they want a good "value" render setting. (But wait - can't you get super quality from the Easy settings? Of course. Easiest is Easy 09. But You can also get great renderings with even Easy 02 - Low. It totally depends on what sort of scene one is trying to render. Living Room? Patient Room? Gymnasium? Museum? Cave? Product in a photo studio?)
  4. People want caustics to work out-of-the-box, they don't want to have to go find a special setting for making caustics work. People don't really notice or care if caustics are perfectly accurate or not, and since they care about shorter render times, pseudo-caustics will do fine in most situations. Can we get very accurate caustics? Sure. Does that increase render times? Yes.
  5. People want sub surface scattering effects like translucent rubber or glass to render without having to set any special settings for them. For this reason the SSS rendering (Volumetrics) works with Easy 3-7. Who wants to wait for those effects with a low setting?
  6. People want "good enough" Anti-aliasing (AA= elimination of the jaggies on lines that are slightly angled in relation to the camera view). Each Easy 1-7 setting varies its quality of AA in comparison to its name. It follows logically that the AA setting for Easy 02 Low will be of lower quality than the AA Setting for Easy 06 High. The + sign tells you that this setting is similar to the other setting of the same name but with the addition of a "little something extra". Generally this means it has increased photon shooting/mapping or increased final gather quality and increased AA quality and sampling.
    .
Photon Mapping and Final Gathering Overview
Easy 1-7 employ 2 methods for calculating global illumination (that is, figuring out what the parts of the image are supposed to look like when they are lit only with bounced light, and not hit with direct light)
Photon Mapping refers to shooting, or tracing, virtual photon particles which start at a light source and bounce around until some of them reach the virtual camera sensor (the image plane). So when photons can easily find their way to the camera from a light source (in just a bounce or two) Photon Mapping is great - think: interior architectural renderings lit with lights close to the camera.
Final Gathering works from the other direction. It traces "importance particles" from the camera to the geometry of the scene. Then calculations for direct and bounced lighting are made based on the importance particles and not wasted trying to figure out "everything" at once. This is useful when the light source is distant from the camera. Think: interior lit only with external sun and sky.
Photon Map/Final Gather (PMFG) combines the two methods for a superior quality image.

So, first question when changing your PMFG settings:
Are my light sources close to my camera? If so, then more PM will be in order.
Are my light sources far from the camera? If so, then more FG will be in order.

What is a photon map? A photon map is a "storage box" for every photon shot. Those low on RAM would be wise to keep photon shooting low in order to avoid filling the ram quickly with all the photons of a large map. Lower photons will result also in faster rendering. But a low quality photon map will also result in low quality rendering. To save RAM and keep render times reasonable, try to keep a total of 10000 photons shot per scene (more is better, but above 1 million photons there are diminishing returns).

If trying to optimize your render settings, here are some tips:
So if there are 10 light sources, photon shooting should be at 10000/10=1000 photons per light source. If there are 100 light sources relatively close to the camera, then 100 photons could serve well. If there are over 1000 light sources, 10 photons could serve well. If there are lights in the scene which are contributing nothing to the final image, turn them off as they are still being calculated into the photon map for no reason.

To change a Render Setting for Twilight Render:
On your computer, navigate to the Folder:
...\Google\Google SketchUp X\Plugins\Twilight\RenderSettings\Express\1) Easy
Select and Copy the Easy 1-7 .xml files located there.
Navigate to the Folder:
...Google\Google SketchUp X\Plugins\Twilight\RenderSettings\Express\3) Custom
Paste the files into this folder. We suggest you ONLY modify these files in the Custom folder!
Open the render setting file you would like to modify using a text editor like Notepad or Notepad++,
Now you can make any changes to the file, save, being sure you do not convert the file extension to a .txt file or some other type of format. It must remain as type ".xml".

Let's change the number of photons per light source for Easy 03 Low+ as a "starter".

In the render settings file, this photon shooting number is located here (do a "find" in your text editor):

Code: Select all

<Parameter Name="Samples per Light" Type="Integer" Value="1000"/>
If you have 100 lights in your scene, change this number to be "100" so that the line will now look like this after deleting a zero(0):

Code: Select all

<Parameter Name="Samples per Light" Type="Integer" Value="100"/>
Save the file as "03. Low+_100photons.xml" (without the quotes).
Now try closing and re-opening only the Render Dialog in SketchUp, navigate to the render setting "03. Low+_100photons.xml" in the Custom folder, and hit render. Render speed should be significantly increased. If you do not have a lot of lights near the camera, quality may have also decreased.

Max Photon Tracing Depth should be left at 5 or can even be placed possibly as low as 3 for most architectural scenes. The exception is where reflections are being lost in the rendering. Then increasing the depth to 5, 6, or even 7 may be the case. The lower the value, the faster the render because fewer bounces or reflections of the photon are being calculated.

Code: Select all

<Parameter Name="Max Photon Tracing Depth" Type="Integer" Value="5"/>
The Tracing Depth can be observed easily if you are looking from the outside of your building through a large plane of glass to the interior lobby space. With tracing depth lower than 3, the light may pass through the glass to the interior, but never make it back out to the camera. This will cause the interior of the building to look dark. Increasing the value to 5 results in many more photons passing through glass and reaching the camera.
tracingdepth-compare.jpg
tracingdepth-compare.jpg (93 KiB) Viewed 49924 times
Mesh Detail. The "resolution" of the photon map is determined by the Mesh Detail. It is wise to keep this at "0" as this means that Twilight will calculate the detail needed automagically for you. Any other number for this will likely increase render times while losing quality. However, if you really know what you are doing, modifying this number can save a lot of RAM. The number is in meters. Think of it as the size of the largest surface you want it to calculate for a single photon. In other words, what's the smallest triangle in your scene? How big is it in meters? (this is just a way to think about "mesh detail")

Code: Select all

<Parameter Name="Mesh Detail" Type="Real" Value="0"/>
In our next installment we will discuss Antialiasing before moving on to some important things to know about tweaking Final Gather and the results in Twilight.

Fletch
Posts: 12895
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Re: Easy 1-7 Photon Mapping and Final Gather (Biased)

Post by Fletch » Wed Apr 27, 2011 2:34 pm

Anti-aliasing Settings
Anti-aliasing, Antialiasing, or simply AA is the processing pass performing the smoothing of jagged lines, speckles or sparkles on shiny materials, the smoothing of speckles at the edges of soft shadows, or the elimination of Moiré pattern in materials. It results in the overall sharpness or fuzziness of a rendering.

AA is calculated dependant on 3 main variables:
  1. Threshold

    Code: Select all

    <Parameter Name="Antialiasing Threshold" Type="Real" Value="0.1"/>
    Best AA for Fuzzy Tracing blurry reflection is AA .1 (medium quality) or .01(high quality) Higher quality AA, especially for fuzzy tracing fuzzy reflections in floors and metals will take a LONG time to render. This number quality will also effect the quality of edges on your soft shadows.
    Production AA at Antialiasing Threshold of Value="1.0" means that only spatial edges will be AA traced. This means exceptionally fast AA (but poor quality) if one is in a hurry. It will not trace AA inside of reflections, refraction, blurry reflections, material textures, etc.
  2. Quality Type

    Code: Select all

    <Parameter Name="Antialiasing" Type="String" Value="Ultra Fine"/>
    :!: Effects mainly soft shadow and caustics quality. (as opposed to fuzzy tracing quality for blurry materials)
  3. Sampling Parameters - which should be kept to numbers based on multiples of 4 or 12 and should be increased or decreased together as a matching pair.

    In Low+, the sampling parameters look like this:

    Code: Select all

    <Parameter Name="./Sampling Criteria/Diffuse Samples" Type="Integer" Value="128"/>
    <Parameter Name="./Sampling Criteria/Specular Samples" Type="Integer" Value="12"/>
    In High+, the sampling parameters look like this:
    <Parameter Name="./Sampling Criteria/Diffuse Samples" Type="Integer" Value="512"/>
    <Parameter Name="./Sampling Criteria/Specular Samples" Type="Integer" Value="28"/>

    Example of a custom sample setting: (these sampling results are very good, but when a camera is close to a surface and at a steep angle to the nearby surface it can give some strange results. In normal architectural rendering it should work quite well.)

    Code: Select all

    <Parameter Name="./Sampling Criteria/Diffuse Samples" Type="Integer" Value="1024"/>
    <Parameter Name="./Sampling Criteria/Specular Samples" Type="Integer" Value="32"/>
Other AA parameters of interest:
Available AA types and AA filters
AA-other-options.jpg
AA-other-options.jpg (31.51 KiB) Viewed 49659 times
Next post: Tweaking Final Gather

Fletch
Posts: 12895
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Re: Easy 1-7 Photon Mapping and Final Gather (Biased)

Post by Fletch » Wed Apr 27, 2011 9:32 pm

Tweaking Final Gather Render Settings

This scene is COMPLETELY RECONSTRUCTED FROM SCRATCH FOR THIS TEST.
Benchmark_TeapotMuseum_RealScale-clay-SketchUp.zip
(496.17 KiB) Downloaded 1879 times
It is based on a famous radiosity test scene. Some refer to it lovingly as the "Ando Teapot Museum" but it is not a Tadao Ando project. It is just reminiscent of one.

:!: One may skip editing a file in a text editor, and instead one may use a render settings editor with a GUI (graphical user interface) if one uses Kerkythea to change the render setting.
RenderSettings-GUI.jpg
RenderSettings-GUI.jpg (27.85 KiB) Viewed 49552 times
To change a render setting using Kerkythea :>: CLICK HERE<<

The images below were taken from Kerkythea's render setting dialog because it is the quickest way to try out many different render setting and document the resulting differences. Changing the settings manually in Notepad will yield similar rendering results with Twilight.

IMPORTANT STATS:
  1. All flat white surfaces are at 92% flat white
  2. The architectural elements are built to a real-world reasonable size and scale (original scene was not)
  3. Sun and Physical sky only - sun is at radius 7
  4. That's a really big teapot. :shock:
Common Ray Tracing Parameters to all scenes:
Production AA
AA Threshold = .3
Fuzzy Tracing High
Soft Shadows Fine
Max Scatter Bounces 5
Max Dirac Bounces 5
Brightness Threshold .002
Trace Translucencies = 0 (FALSE OR Unchecked)

:idea: All of these settings can be tweaked depending on your scene's contents and render's purpose.

Setting your sun greater than radius 10 will increase render times. (Soft Shadow Radius for Sun, Spot, Point Lights IN DEPTH TUTORIAL) A render time for a scene with sun radius at 50 will be up to 2x greater than a scene with sun at radius 7. 7 looks good too. ;)

Computer specs:
corei7 - 8 threads overclocked to 3.62Ghz Vista 64bit with 3Gb RAM

RENDER TIMES - are shown in all images just below the Render Settings Setup Dialog box for relative rendering time reference only. Actual render times on your machine may vary.

Conclusions for getting best value and results from Final Gather Settings with interior scenes lit only with Sun and Physical Sky:


1. Always use Gathering Depth 2
2. Tracing Depth of 4 seems to be best balance between quality and render time.
3. Never use quality lower than "Very Good" :!: (especially for interiors)
4. Use the lowest number of Final Gather Rays which you can get away with. In a white room, this will be higher than in a room with a lot of textures.
5. Lower number final gather rays = blotches. If there are textures, blotches are hidden by the texture and do not matter.

Example: Animations with textures would save a lot of render time by keeping this in mind, as the compression of an animation will also hide blotches.

If you have more than sun and sky as light sources, you will likely need to lower number of final gather rays. to be something like 60 rays and 2 depth with Very Good quality. This may yield quite good results (this is just an educated guess). You may also want to lower number of photons. Try to keep total number of photons in the scene at somewhere between 10000 and 100000 for good final gather results.

Numer of Photons "best value" (reasonable quality for reasonable time) for this scene was 10000. It could be lowered to 5000 with little render time difference, nor quality difference.

Tracing Depth is the number of rays bounced back and forth inside of reflections/refractions. This number is best between 4 and 6, but could even be OK at 3, depending on how many reflections and refractions you need in your scene. If there are only a few reflecting surfaces, 5 or 6 does not seem to effect render times. Limit bounces to 5 when the scene contains many reflective surfaces.

Think about the basics this way - if your scene is lit a lot with direct light, and those lights are close to the surface they are intended to strike (an interior night shot of a reception desk, for instance.) Then lower number of photons and lower number of final gathering can be acceptable for getting good quality rendering results. Even PMFG low setting with good AA may be good enough for you.

However, if you are rendering an interior space, with light from a small window or two (bedroom during daytime), then you will need deeper tracing and final gathering numbers for that information to come through in the rendered image. Along with that, you will need a lot higher photon shooting. You could also try a sky portal - see the section in the manual about sky portals.

The photon map is also directly related to your rendered image resolution... if you render a very large image on lower settings, it may look as good as the same scene with low resolution but higher settings. There's no rule about this, it's just something gathered over time and experience.
Attachments
_0000_sun-int-prelim.jpg
_0000_sun-int-prelim.jpg (109.42 KiB) Viewed 49575 times
_0001_sun-int-low.jpg
_0001_sun-int-low.jpg (109.49 KiB) Viewed 49594 times
_0002_sun-int-med.jpg
_0002_sun-int-med.jpg (109.73 KiB) Viewed 49577 times
_0003_sun-int-high.jpg
_0003_sun-int-high.jpg (111.12 KiB) Viewed 49578 times
_0004_sun-int-fine.jpg
_0004_sun-int-fine.jpg (109.74 KiB) Viewed 49570 times
_0005_sun-int-veryfine.jpg
_0005_sun-int-veryfine.jpg (109.76 KiB) Viewed 49570 times

Fletch
Posts: 12895
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Re: Easy 1-7 Photon Mapping and Final Gather (Biased)

Post by Fletch » Wed Apr 27, 2011 9:53 pm

For some pretty nice off-site reference tutorials on PMFG:

PMFG Tutorial 1
PMFG Tutorial 2

Fletch
Posts: 12895
Joined: Fri Mar 20, 2009 2:41 pm
OS: PC 64bit
SketchUp: 2016-2023
Contact:

Re: Easy 1-7 Photon Mapping and Final Gather (Biased)

Post by Fletch » Thu Apr 28, 2011 8:03 am

:!: One may skip editing a file in a text editor, and instead one may use a render settings editor with a GUI (graphical user interface) if one uses Kerkythea to change the render setting.
To change a render setting for Twilight using Kerkythea: (this presumes you have the free Kerkythea installed already.)

The basic process works like this:
  1. Copy setting file into Kerkythea's Render Settings Folder
  2. Customize the setting.
  3. Save the setting with a new name.
  4. Copy the setting file back over to Twilight.
Step-by-step:

:>: Before attempting to edit the render setting using Kerkythea's graphical user interface, first copy the render setting .xml files you want to work with over to the Kerkythea Render Settings folder. (...\Program Files...\Kerkythea Rendering System\RenderSettings)
(Kerkythea can not read folders with .xml files in them, so only copy the .xml files.)
  1. Open Kerkythea, and go to File>New to Start a New Scene
  2. Click the green Start Render Button
  3. When the dialog pops up, choose the render setting and scroll down to find which setting you would like to modify
  4. Click apply
  5. It will ask you if you are "really sure you want to apply this" and you will say "yes, it's ok".
  6. Click Cancel to exit the Start Render (Camera and Settings) dialog.
  7. Choose Menu "Render>Setup" to open the Render Settings dialog to begin to modify your render settings you just copied over to Kerkythea.
  8. Modify the information on the "Ray Tracing" tab to match the settings described above.
  9. Modify the information on the "Global Illumination" tab.
  10. Click "OK" when ready.
  11. Then you will save the scene BUT you will choose the format "render settings" for saving the scene.
  12. You MUST type in the extension .xml manually in order to specify the file to be in .xml format. Otherwise it will be saved as a .kzx file and will not be able to be read by Twilight (or Kerkythea)
  13. Click OK to save the file
Create-Custom-Render-Setting-Using-Kerkythea.jpg
Create-Custom-Render-Setting-Using-Kerkythea.jpg (362.71 KiB) Viewed 49531 times

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 2 guests