Example_Raytracer

Description

sealed class Tinman.Demo.Examples.Example_Raytracer

Full source code is included in the Tinman 3D SDK download.

This class implements a simplistic raytracer for a ISpatialQuery object, using a single directional light with hard shadows.

Public / Constructors

Example_​Raytracer


public constructor Example_Raytracer → ()

Creates a new instance of Example_Raytracer.

Public / Attributes

Color​Background


public attribute ColorBackground → (get,set)

value : int64

The background color.

The color to use for the background (i.e. ray missed target).

Defaults to Colors.LightSkyBlue.

Color​Light


public attribute ColorLight → (get,set)

value : int64

The light color.

The color to use for the lit areas (i.e. ray hit target, no shadow).

Defaults to Colors.PapayaWhip.

Color​Shadow


public attribute ColorShadow → (get,set)

value : int64

The shadow color.

The color to use for the shadowed areas (i.e. ray hit target, in shadow).

Defaults to Colors.DarkGray.

Light


public attribute Light → (get,set)

value : Vec3D

The unit-length light direction vector.

The light direction vector.

Defaults to Vec2D.Zero.

Matrix


public attribute Matrix → (get,set)

value : Mat4D

The inverse model-view-projection matrix.

The inverse model-view-projection matrix (i.e. the transformation from clip-space to world-space).

Defaults to Mat4D.Identity.

Offset


public attribute Offset → (get,set)

value : Vec3D

The translation offset.

The translation offset to apply to screen pixel rays that have been generated from Matrix.

Defaults to Vec2D.Zero.

Pixels


public attribute Pixels → (get)

value : ColorBuffer

[not-null]
The resulting image.

The pixel buffer that holds the resulting image.

Each time the contents of the pixel buffer have changed, the IVersioned.Version is incremented.

Size


public attribute Size → (get,set)

value : Vec2I

The output pixel buffer size, in pixels.

The size of the output pixel buffer.

Defaults to (320,240).

Target


public attribute Target → (get,set)

value : ISpatialQuery

[not-null]
The raytracing target.

Specifies the raytracing target.

Logging

Logger


public static readonly attribute Logger → (ILogger)

The logger object of this class.