Raytrace

class arlunio.raytrace.ClayRenderer(*args, **kwds)[source]

Inputs:

width: int height: int

Produces:

Image

A simple clay renderer.

class arlunio.raytrace.Gradient(*args, **kwds)[source]

Inputs:

scatter: ScatterPoint

A basic gradient color.

class arlunio.raytrace.LambertianDiffuse(*args, **kwds)[source]

Inputs:

scatter: ScatterPoint

Lambertian diffuse material.

class arlunio.raytrace.MaterialRenderer(*args, **kwds)[source]

Inputs:

width: int height: int

A renderer capable of rendering materials.

class arlunio.raytrace.NormalMap(*args, **kwds)[source]

Inputs:

scatter: ScatterPoint

Visualise the normals on a given surface.

class arlunio.raytrace.Rays(origin: np.ndarray, direction: np.ndarray)[source]

A collection of rays

at(t)[source]

Get the position for each value of t.

direction: np.ndarray

An array of vectors indicating which direction each ray is pointing

origin: np.ndarray

The point where the rays originate from.

class arlunio.raytrace.SampledRenderer(*args, **kwds)[source]

Inputs:

width: int height: int

Produces:

Image

A renderer is responsible for orchestrating the entire process.

class arlunio.raytrace.ScatterPoint(hit: np.ndarray, t: np.ndarray, p: np.ndarray, normal: np.ndarray, front_face: np.ndarray)[source]

A scatter point is where rays have intersected an object and where various calculations should take place.

merge(other)[source]

Merge the results of another scatter point in with this one.

classmethod new(rays: arlunio.raytrace.data.Rays)[source]

Create a new scatter point based on an initial cluster of rays.

front_face: np.ndarray

A boolean array with shape (n, 3) indicating which side of the surface the incoming ray was on.

hit: np.ndarray

A boolean array with shape (n,) indicating which rays have intersected some object.

normal: np.ndarray

An array of vectors with shape (n, 3) indicating the direction of the surface normal at the point of intersection.

p: np.ndarray

An array of vectors with shape (n, 3) indicating the point of intersection in space.

t: np.ndarray

A scalar array with shape (n,) indicating the value of the parameter t at the point of intersection.

class arlunio.raytrace.SimpleCamera(*args, **kwds)[source]

Inputs:

width: int height: int

Produces:

Rays

A simple camera that generates rays to be cast into the scene.

focal_length

Something something focal length

origin

Set the position of the camera in space. If not set this will default to \((0, 0, 0)\)

sampler

The sampler the camera should use in order to generate rays. If not set this will default to an instance of arlunio.raytrace.UniformSampler

scale

Something something scale.

class arlunio.raytrace.SimpleSampler(*args, **kwds)[source]

Inputs:

width: int height: int

The simplest sampler.

class arlunio.raytrace.Sphere(*args, **kwds)[source]

Inputs:

rays: Rays t_min: float t_max: float

Produces:

ScatterPoint

A sphere.

class arlunio.raytrace.UniformSampler(*args, **kwds)[source]

Inputs:

width: int height: int

Generate samples according to the uniform distribution

class arlunio.raytrace.ZDepthRenderer(*args, **kwds)[source]

Inputs:

width: int height: int

Produces:

Image

A renderer that returns a z-depth pass.