ray_tracer

This subpackage provides the ray tracing and rendering capabilities for GIANT.

Description

In GIANT rendering is primarily done using single bounce ray tracing, where a ray is traced from the camera, to a surface and then bounced to the light source. This tells us a number of things. First, is the geometry of the ray trace, including the exidence, incidence, and normal vectors and the albedo at the intersect location. It also tells us if the surface is shadowed where we initially intersected. Based on this information, we can then compute the intensity for each ray and then use those intensities to render an image. Because space imagery typically has a single collimated illumination source (the sun) and most bodies we are doing OpNav with respect to are airless (and thus there is no atmospheric scattering) the single bounce ray trace is a very accurate way to render synthetic images.

There are 2 primary ways to represent a surface in GIANT. The first is as a triaxial Ellipsoid. This is useful for many larger celestial bodies (planets, moons, and large asteroids/comets) and is very efficient for ray u tracing since only a single object needs to be intersected. The second primary way is as a Surface object. Using this we represent the surface as a tesselation of small planar geometry primitives (usually triangles, Triangle32 and Triangle64) where we then have to check our rays intersections against every geometry primitive in the surface. This allows us to represent arbitrary topography with arbitrary resolution, but because it normally takes many many geometry primitives for a single surface tracing can be very slow. Therefore, we also provide an acceleration structure in the form of a KDTree which limits the number of triangles we need to check each ray against using AxisAlignedBoundingBox.

Once a surface is represented in GIANT it is usually wrapped in a SceneObject and added to a Scene. The Scene in GIANT is used to define the locations and orientations of multiple objects with respect to each other. It also provides functionality for automatically updating these locations and orientations for a new time and for doing the single bounce ray trace for rendering. Once the ray trace is complete, the subclasses of IlluminationModel are used to convert the ray trace geometry into intensity values for each ray (typically) the McEwenIllumination class).

When creating a surface in GIANT, you will usually use the ingest_shape script which will create the surface and build the acceleration structure automatically for you.

For more details, please refer to the following module documentation, which provides much more detail.

Modules

rays

This module defines a class for representing rays in GIANT, a function to generate them from a camera model, and the numpy structured data type used to store the results of a ray trace.

shapes

This subpackage defines all shapes that are used throughout GIANT.

kdtree

This cython module provides the ability to accelerate ray tracing of RawSurface objects in GIANT.

scene

This module provides scene functionality for rendering in GIANT.

illumination

This module defines the illumination functions that are used to convert ray traced geometry into intensity values when rendering.

utilities

This module provides some basic utilities for working with the ray tracer in GIANT.

Classes

Rays

A class to store/manipulate rays.

SceneObject

This class provides a quick and easy interface for changing the position and orientation of various objects.

Scene

This is a container for SceneObject instances that provides an easy interface for tracing and rendering.

CorrectionsType

This enumeration provides options for the different corrections that can be used when calculating the apparent position of an object in a scene

IlluminationModel

This abstract base class specifies the minimum interface expected of an illumination model in GIANT.

McEwenIllumination

This illumination model computes the intensity values as the weighted sum between the Lommel-Seeliger and Lambertian models, weighted using the phase angle.

LambertianIllumination

This basic illumination model computes the intensity values as simply the cosine of the incidence angle times the albedo.

LommelSeeligerIllumination

This basic illumination model computes the intensity values as simply the cosine of the incidence angle divided by the cosine of the incidence angle plus the exidence angle times the albedo.

AshikhminShirleyDiffuseIllumination

This illumination model computes the intensity values according to the Ashikhmin Shirley diffuse law

GaskellIllumination

This illumination model computes the intensity values as the weighted sum between the Lommel-Seeliger and Lambertian models, weighted using the phase angle.

Triangle64

This class represents surfaces as tessellated triangles, storing the vertices, albedos, and normal vectors using double precision.

Triangle32

This class represents surfaces as tessellated triangles, storing the vertices, albedos, and normal vectors using single precision.

Ellipsoid

A shape for modelling spheres and triaxial ellipsoidal bodies.

Surface

This defines the basic interface expected of all surfaces in GIANT.

Surface32

This class serves as the backbone for surfaces in GIANT represented using single precision.

Surface64

This class serves as the backbone for surfaces in GIANT represented using double precision.

Solid

A solid represents an 3D object that can be mathematically represented without resorting to tesselation (for instance a tri-axial ellipsoid).

Shape

This represents the minimum required interface for an object to be considered traceable in GIANT.

Point

Represents a single, unrenderable point.

AxisAlignedBoundingBox

This class provides an efficient implementation of an axis aligned bounding box.

KDTree

A KD Tree representation for accelerated tracing of surface objects with many geometry primitives using axis aligned bounding box acceleration.

Constants

ILLUM_DTYPE

The numpy datatype expected by the illumination functions in this module as input for conversion to intensity values.

INTERSECT_DTYPE

The numpy datatype returned when rays are traced with a shapes or KDTree in GIANT.