TINMAN 3D / REALTIME TERRAIN
Software Development Kit - User Manual

class ColorCube in Tinman.AddOns.Rendering

Helper class for creating mipmapped cubemap textures that properly wrap around between faces and conserve energy during downsampling.

sealed class ColorCube  

Public / Attributes

Size

The cubemap size.

public property Size { get }
type int32
value [pow2+1] The cubemap size.

TextureMipmaps

Returns the number of mipmap levels in the pixel-is-area cubemap texture.

public property TextureMipmaps { get }
type int32
value [>0] The mipmap level count.

Public / Constructors

ColorCube

Creates a new instance of ColorCube.

public constructor ColorCube (int32 size)
params size [pow2+1] The cubemap size.

Public / Methods

Get

Computes an average sample value for the given output cube size.

[Pure]
public method Get (int32 x, int32 y, CubemapFace face, int32 size)
type int64
params x Cubemap face X-coordinate of minimum block corner.
  y Cubemap face Y-coordinate of minimum block corner.
  face The cubemap face.
  size [pow2] The output cube size, in pixels.
returns The average cube sample value (see Colors).

Remarks:

The returned samples have pixel-is-area semantic.

Load

Loads an image onto the given cubemap face.

public method Load (CubemapFace face, IImage image, Transform transform = Transform.None)
params face The cubemap face.
  image [not-null] The image to load onto face.
  transform Optional transform to apply to image before loading it onto face.

Set

Sets a sample of this color cube.

public method Set (int32 x, int32 y, CubemapFace face, int64 color)
params x Cubemap face X-coordinate of sample.
  y Cubemap face Y-coordinate of sample.
  face The cubemap face.
  color The color to set (see Colors).

Remarks:

The color cube samples have pixel-is-point semantic.

Texture

Generates a 2D texture for the given cubemap face.

[OwnerReturn, Pure]
public method Texture (CubemapFace face, TextureFormat format)
type TexelBuffer
params face The cubemap face.
  format [not-null] The texture format.
returns [not-null] The texture buffer.

Remarks:

The generated texture has pixel-is-area semantic.


Generates a cubemap texture.

[OwnerReturn, Pure]
public method Texture (IGraphicsContext context, TextureFormat format)
type ITextureCube
params context [not-null] The graphics context to use.
  format [not-null] The texture format.
returns [not-null] The texture object.

Remarks:

The generated texture has pixel-is-area semantic.