Enumerations and flags

Enumerations and flags used by PlotOptiX raytracer.

Scene

class plotoptix.enums.Postprocessing[source]

2D postprocessing stages.

Postprocessing stages can be added with plotoptix.NpOptiX.add_postproc() to correct ray traced 2D image. Each algorithm has its own variables that should be configured before adding the postprocessing stage.

Gamma = 2

Image gamma correction.

Variables to configure: - tonemap_exposure, float, exposure value - tonemap_igamma, float, 1/gamma value.

Examples

>>> optix = TkOptiX()
>>> optix.set_float("tonemap_exposure", 0.6)
>>> optix.set_float("tonemap_igamma", 1/2.2)
>>> optix.add_postproc("Gamma")
GrayCurve = 3

Brightness correction curve.

Variables to configure:

Examples

>>> optix = TkOptiX()
>>> optix.set_float("tonemap_exposure", 0.6)
>>> optix.set_texture_1d("tone_curve_gray", [0, 0.33, 0.75, 1])
>>> optix.add_postproc("GrayCurve")
Levels = 1

Image levels correction.

Variables to configure: - levels_low_range, float3, RGB values - levels_high_range, float3, RGB values.

Examples

>>> optix = TkOptiX()
>>> optix.set_float("levels_low_range", 0.1, 0.15, 0.2)
>>> optix.set_float("levels_high_range", 0.9, 0.8, 0.7)
>>> optix.add_postproc("Levels")
Mask = 5

2D mask multiplied by the image.

Variables to configure:

  • frame_mask, grayscale texture 2D, mask to apply

Examples

>>> optix = TkOptiX()
>>>
>>> x = np.linspace(-1, 1, 20)
>>> z = np.linspace(-1, 1, 20)
>>> Mx, Mz = np.meshgrid(x, z)
>>> M = np.abs(Mx) ** 3 + np.abs(Mz) ** 3
>>> M = 1 - (0.6 / np.max(M)) * M
>>>
>>> optix.set_texture_2d("frame_mask", M)
>>> optix.add_postproc("Mask")
Overlay = 7

2D overlay, applied to the image according to alpha channel.

Variables to configure:

  • frame_overlay, RGBA texture 2D, overlay to apply

Examples

>>> optix = TkOptiX()
>>>
>>> # ...read or create overlay image
>>>
>>> optix.set_texture_2d("frame_overlay", M)
>>> optix.add_postproc("Overlay")
RgbCurve = 4

RGB correction curve.

Variables to configure:

  • tonemap_exposure, float, exposure value

  • tone_curve_r, texture 1D, red channel correction curve

  • tone_curve_g, texture 1D, green channel correction curve

  • tone_curve_b, texture 1D, blue channel correction curve

Correction curves can be configured by passing the values directly (using plotoptix.NpOptiX.set_texture_1d()) or with plotoptix.NpOptiX.set_correction_curve()

Examples

>>> optix = TkOptiX()
>>> optix.set_float("tonemap_exposure", 0.6)
>>> optix.set_texture_1d("tone_curve_r", [0, 0.31, 0.75, 1])
>>> optix.set_texture_1d("tone_curve_g", [0, 0.33, 0.78, 1])
>>> optix.set_texture_1d("tone_curve_b", [0, 0.35, 0.81, 1])
>>> optix.add_postproc("RgbCurve")
class plotoptix.enums.MissProgram[source]

Miss program.

Miss program is executed when ray segment is not intersecting any object at a defined maximum distance. Radiance assigned to the ray by the miss program appears as a color of the background (e.g. on primary segments) or environmental light color (segments scattered off a diffuse surfaces).

AmbientLight = 1

Background color is used if the ray is not scattering of any surface; ambient light color is used otherwise (e.g. background can be black while the scene is illuminated with any color of light).

Default = 0

Constant background color is used.

TextureEnvironment = 4

Texture color is used for both, the background and the scene illumination. Texture pixel is selected by the ray direction, so effectively the texture is mapped on the sphere with infinite radius: use 360 deg environment maps.

TextureFixed = 3

Texture color is used if the ray is not scattering of any surface; ambient light color is used otherwise. Texture in the background is not reacting to the camera changes and is not affacting the scene illumination.

Geometry

class plotoptix.enums.Geometry[source]

Geometry shapes.

BezierChain = 6

Bezier line interpolating data points.

Line thickness and color can be provided for each data point. Line is smoothed, use SegmentChain for a piecewise linear plot.

Mesh = 10

Mesh.

Color and normal vectors can be provided for each data point.

Parallelepipeds = 8

Parallelepipeds.

Color and U / V / W vectors can be provided for each data point.

Parallelograms = 7

Flat parallelograms.

Color and parallelogram U / V vectors can be provided for each data point.

ParticleSet = 1

Spherical particle for each data point.

Each point can have individual radius and color.

ParticleSetTextured = 4

Spherical particle, 3D oriented, for each data point.

Each point can have individual radius and color. U and V vectors allow for 3D orientation of each point so it can works best with textures. Texture overrides individual flat colors of particles.

U vector points to the north of the particle, V vector sets the zero longitude direction. V vector is orthogonalized to U.

Tetrahedrons = 9

Tetrahedrons.

Color and U / V / W vectors can be provided for each data point.

Unknown = 0

Value reserved for errors.

class plotoptix.enums.GeomBuffer[source]

Geometry buffer flags.

Flags are used for selection of buffers which should be updated in GPU (update geometry() method) after geometry modifications made with move_geometry()/move_primitive() and similar functions.

All = 4294967295

All buffers.

Colors = 12

Any geometry color, including start/end of bezier and line segments.

Colors0 = 4

Bezier and line segments starting color.

Colors1 = 8

Bezier and line segments end color.

NormalIdx = 8192

Mesh normal indexes.

Positions = 1

Data point positions.

Radii = 16

Particles radii, bezier and line segment thickness.

U = 32

U vector of parallelograms, parallelepipeds and tetrahedrons.

V = 64

V vector of parallelograms, parallelepipeds and tetrahedrons.

V0 = 256

Start node of bezier and line segments.

V1 = 512

1st mid node of bezier segments.

V2 = 1024

2nd mid node of bezier segments.

V3 = 2048

End node of bezier and line segments.

VNodes = 3840

All nodes of bezier and line segments.

Vectors = 224

All vectors of parallelograms, parallelepipeds and tetrahedrons.

VertexIdx = 4096

Mesh vertex indexes.

W = 128

W vector of parallelograms, parallelepipeds and tetrahedrons.

class plotoptix.enums.GeomAttributeProgram[source]

Geometry attributes program.

Executed when the closest ray-object intersection is found. Calculates the geometry and shading normals, texture coordinates and object.

Default = 0
DisplacedSurface = 2

Displaced surface position.

Modifies surface position according to the provided texture. Available with textured particles.

NormalTilt = 1

Modulated shading normal.

Modifies shading normal according to the provided texture. Available with: parallelograms, tetrahedrons, parallelepipeds, textured particles.

class plotoptix.enums.TextureMapping[source]

Texture projection mode.

Flat = 1

Orthogonal projection on a flat surface.

Spherical = 2

Projection on a spherical surface.

class plotoptix.enums.DisplacementMapping[source]

Surface displacement mapping mode.

DisplacedSurface = 2

Surface is actually displaced, shading normal is tilted accordingly.

NormalTilt = 1

Only the shading normal is affected.

Camera

class plotoptix.enums.Camera[source]

Cameras (ray generation programs).

DoF = 1

Perspective camera with depth of field simulation.

Pinhole = 0

Perspective camera.

Lights

class plotoptix.enums.LightShading[source]

Light shading program.

Hard = 1

Hard light shading.

Slower convergence (more frames required to eliminate noise), but much better suited for scenes with caustics.

Soft = 0

Soft light shading.

Raytracing in this mode converges quickly and lighting is well balanced for most scenes and light sources.

class plotoptix.enums.Light[source]

Light sources.

Parallelogram = 0

Flat parallelogram, light on front face only.

Spherical = 1

Spherical light, shining in all directions.

Encoder

class plotoptix.enums.NvEncProfile[source]

H.264 encoding profile.

Beware that some combinations are not supported by all players (e.g. lossless encoding is not playable in Windows Media Player).

Baseline = 1
Default = 0
High = 3
High444 = 4
Main = 2
class plotoptix.enums.NvEncPreset[source]

H.264 encoding preset.

Beware that some combinations may not be supported by all players (e.g. lossless encoding is not playable in Windows Media Player).

BD = 3
Default = 0
HP = 1
HQ = 2
LL = 4
LL_HP = 5
LL_HQ = 6
Lossless = 7
Lossless_HP = 8

Ray tracer

class plotoptix.enums.RtResult[source]

Raytracing result codes.

AccumDone = 1

Last accumulation frame completed.

Image is ready, raytracng stops until changes in the scene are made.

ComputeTimeout = 256

Compute/upload task timed out.

LaunchTimeout = 257

Ray-tracing task timed out.

NoUpdates = 2

There is no change in the output image.

Success = 0

Frame raytracing completed with no errors.

class plotoptix.enums.RtFormat[source]

OptiX buffer formats.

Float = 257

32 bit single precision scalars.

Float2 = 258

32 bit single precision 2D vectors.

Float3 = 259

32 bit single precision 3D vectors.

Float4 = 260

32 bit single precision (x, y, z, w) vectors.

Unknown = 256

Reserved.

class plotoptix.enums.GpuArchitecture[source]

SM architecture.

Auto = 0

Select highest SM architecture matching available GPU’s.

Compute_50 = 500

Maxwell.

Compute_52 = 520

Maxwell.

Compute_60 = 600

Pascal.

Compute_61 = 610

Pascal.

Compute_70 = 700

Volta.

Compute_75 = 750

Turing.

Other

class plotoptix.enums.Coordinates[source]

Coordinate system styles.

Note, implementation of the coordinate system geometries is ongoing. Now only a simple box containing the data points is visible in plots.

Box = 1

Box containing all the data points.

Hidden = 0

No coordinate system in the image.

class plotoptix.enums.Channel[source]

Image color channel.

A = 4

Alpha channel.

B = 3

Blue channel.

G = 2

Green channel.

Gray = 0

Brightness.

R = 1

Red channel.

class plotoptix.enums.ChannelOrder[source]

Color channel ordering.

BGR = 2
BGRA = 4
RGB = 1
RGBA = 3