Class TPathTracer
Unit
CastleRayTracer
Declaration
type TPathTracer = class(TRayTracer)
Description
Path tracer. See [http://castle-engine.sourceforge.net/vrml_engine_doc/output/xsl/html/section.path_tracer.html] for documentation.
Hierarchy
Overview
Fields
Methods
 |
procedure AppendStats(const Stats: TStrings; const RenderingTime: Single); override; |
 |
constructor Create; |
 |
procedure Execute; override; |
Description
Fields
 |
MinDepth: Integer; |
MinDepth and RRoulContinue together determine the path length. The path has at least MinDepth length, and then Russian roulette is used.
See [http://castle-engine.sourceforge.net/rayhunter.php] documentation about "<recursion-depth>" and --r-roul-continue for suggestions about how to use these parameters. See also [http://castle-engine.sourceforge.net/raytr_gallery.php] for some experiments with these values.
RRoulContinue must be in 0..1 range.
You can give RRoulContinue = 0 if you don't want to use Russian roulette at all (works OK because our comparison Random < RRoulContinue uses "<", not "<="). Note that this causes bias (result is darker than it should be). Only RRoulContinue > 0 removes bias (the expected result is the correct one).
Small RRoulContinue values cause a lot of noise. Large RRoulContinue values cause long rendering.
MinDepth must be >= 0. You can use MinDepth = 0 to disable "minimal path length", and use Russian roulette always (noisy).
|
 |
RRoulContinue: Single; |
|
 |
PrimarySamplesCount: Cardinal; |
How many paths to use. Both must be > 0.
PrimarySamplesCount tells how many paths are used for primary ray, and is really useful only for anti-aliasing. You can set this to a few. Values above ˜10 are useless, they cause much longer rendering without really improving the result. You can set this to 1 if you don't need anti-aliasing.
NonPrimarySamplesCount is the number of paths caused by each hit of a primary ray. This is the main quality control for the path-tracer, more paths mean that colors are gathered from more random samples, which means that final color is more accurate. In total you have pixels count * PrimarySamplesCount * NonPrimarySamplesCount, so beware when increasing this: you really have a lot paths.
|
 |
NonPrimarySamplesCount: Cardinal; |
How many paths to use. Both must be > 0.
PrimarySamplesCount tells how many paths are used for primary ray, and is really useful only for anti-aliasing. You can set this to a few. Values above ˜10 are useless, they cause much longer rendering without really improving the result. You can set this to 1 if you don't need anti-aliasing.
NonPrimarySamplesCount is the number of paths caused by each hit of a primary ray. This is the main quality control for the path-tracer, more paths mean that colors are gathered from more random samples, which means that final color is more accurate. In total you have pixels count * PrimarySamplesCount * NonPrimarySamplesCount , so beware when increasing this: you really have a lot paths.
|
 |
DirectIllumSamplesCount: Cardinal; |
How many samples are used to calculate direct illumination at every path point. These are rays sent into random points of random light sources, to test if given light shines here.
Set this to 0 to have a really naive path-tracing, that wanders randomly hoping to hit light source by chance. This will usually need an enormous amount of PrimarySamplesCount * NonPrimarySamplesCount to given any sensible results.
Set this to 1 or more for a normal path-tracer.
|
Methods
 |
procedure AppendStats(const Stats: TStrings; const RenderingTime: Single); override; |
|
 |
constructor Create; |
|
 |
procedure Execute; override; |
|
Generated by PasDoc 0.15.0.
|