Class TPathTracer
Unit
Declaration
type TPathTracer = class(TRayTracer)
Description
Path tracer. See [https://castle-engine.io/vrml_engine_doc/output/xsl/html/section.path_tracer.html] for documentation.
Source: scene/castleraytracer.pas (line 170).
Hierarchy
- TObject
- TRayTracer
- TPathTracer
Overview
Fields
| Public | Octree: TBaseTrianglesOctree; |
| Public | Image: TCastleImage; |
| Public | CamPosition: TVector3; |
| Public | CamDirection: TVector3; |
| Public | CamUp: TVector3; |
| Public | Projection: TProjection; |
| Public | SceneBGColor: TVector3; |
| Public | Background: TAbstractBackgroundNode; |
| Public | PixelsMadeNotifier: TPixelsMadeNotifierFunc; |
| Public | PixelsMadeNotifierData: Pointer; |
| Public | FirstPixel: Cardinal; |
| Public | MinDepth: Integer; |
| Public | RRoulContinue: Single; |
| Public | PrimarySamplesCount: Cardinal; |
| Public | NonPrimarySamplesCount: Cardinal; |
| Public | DirectIllumSamplesCount: Cardinal; |
| Public | SFCurveClass: TSpaceFillingCurveClass; |
Methods
| Public | procedure Execute; virtual; abstract; |
| Public | procedure ExecuteStats(const Stats: TStrings); |
| Protected | procedure AppendStats(const Stats: TStrings; const RenderingTime: Single); override; |
| Public | constructor Create; |
| Public | procedure Execute; override; |
Description
Fields
| Public | Octree: TBaseTrianglesOctree; |
|
Spatial structure (that contains geometry with materials) to render. You can create it using e.g. CreateOctreeVisibleTrianglesForScene for TCastleScene. Must be set before calling Execute. | |
| Public | Image: TCastleImage; |
|
Image where the ray-tracer result will be stored. Must be set before calling Execute. We will not resize given here Image. Instead we will use it's current size — so you just have to set Image size as appropriate before calling this method. For every pixel, we calculate it's color and store it by Using TRGBFloatImage class is advised if you want the full color information. Otherwise color precision is lost beyond 8 bits, and values above 1.0 are clamped. | |
| Public | CamPosition: TVector3; |
|
Camera view. CamDirection and CamUp do not have to be normalized — we will correct them here if needed. CamUp will be automatically corrected to be orthogonal to CamDirection if necessary, you only make sure it's not parallel to CamDirection. | |
| Public | CamDirection: TVector3; |
|
Camera view. | |
| Public | CamUp: TVector3; |
|
Camera view. CamDirection and | |
| Public | Projection: TProjection; |
|
Camera projection properties. | |
| Public | SceneBGColor: TVector3; |
|
Default background color, if scene doesn't have Background node with skyColor. | |
| Public | Background: TAbstractBackgroundNode; |
|
Scene Background node. | |
| Public | PixelsMadeNotifier: TPixelsMadeNotifierFunc; |
|
Callback notified (if assigned) about writing each image pixel. This way you can display somewhere, or store to file, partially generated image. This callback gets information (in PixelsMadeCount) about how many pixels were generated (this includes also pixels skipped in case FirstPixel > 0). The pixels are written in the order of TSwapScanCurve for TClassicRayTracer, and in order dependent on TPathTracer.SFCurveClass for TPathTracer. When shadow cache will be implemented to TClassicRayTracer, then configurable SFCurveClass may be done also for TClassicRayTracer. Remember that pixels not done yet have the same content as they had when you Execute method started. In other words, if you set | |
| Public | PixelsMadeNotifierData: Pointer; |
|
This item has no description. | |
| Public | FirstPixel: Cardinal; |
|
Initial pixel to start rendering from. By setting this to something > 0, you can (re-)start rendering from the middle. Useful to finish the job of a previous terminated ray-tracer process. Must be in [0 .. Image.Width * Image.Height] range. Setting to | |
| Public | MinDepth: Integer; |
|
See [https://castle-engine.io/rayhunter.php] documentation about "<recursion-depth>" and --r-roul-continue for suggestions about how to use these parameters. See also [https://castle-engine.io/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 Small RRoulContinue values cause a lot of noise. Large RRoulContinue values cause long rendering.
| |
| Public | RRoulContinue: Single; |
|
This item has no description. | |
| Public | PrimarySamplesCount: Cardinal; |
|
How many paths to use. Both must be > 0.
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 * | |
| Public | 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.
| |
| Public | 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. | |
| Public | SFCurveClass: TSpaceFillingCurveClass; |
|
Order of pixels filled. In theory, something like THilbertCurve or TPeanoCurve could speed up rendering (because shadow cache is more utilized) compared to TSwapScanCurve. But in practice, right now this doesn't give any noticeable benefit. | |
Methods
| Public | procedure Execute; virtual; abstract; |
|
Do ray-tracing, writing a ray-traced image into the Image. | |
| Public | procedure ExecuteStats(const Stats: TStrings); |
|
Do ray-tracing, like Execute, additionally gathering some statistics. The statistics will be added to the given string list. | |
| Protected | procedure AppendStats(const Stats: TStrings; const RenderingTime: Single); override; |
|
This item has no description. | |
| Public | constructor Create; |
|
This item has no description. | |
| Public | procedure Execute; override; |
|
This item has no description. Showing description inherited from TRayTracer.Execute. Do ray-tracing, writing a ray-traced image into the Image. | |
Generated by PasDoc 0.17.0.snapshot.