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

class ModelTexture in Tinman.AddOns.Models

abstract class ModelTexture implements IModelTexture
  base of ModelTexture_Image

Configuration

Config

The configurator object for this type.

public static property Config { get }
type IConfigurator<IModelTexture>
value [not-null] The configurator object.

ToConfig

Returns the configuration value that describes this object.

public abstract method ToConfig ()
type ConfigValue
returns [not-null] The configuration value.
implements IConfigurable.ToConfig

Remarks:

All configurable objects need to implement this interface. For simple types, it is preferable to delegate to ToValue.

The returned value may be of type Invalid, which means that this object in its current state cannot be described with the configuration API.

Before returning the resulting configuration value, Cache must be called on it, passing this IConfigurable object as parameter.

Public / Constants

Black

Uniform texture of color Black.

public static readonly field Black
type IModelTexture

DisplacementZero

Placeholder for encoded displacement map.

public static readonly field DisplacementZero
type IModelTexture

Error

Used to visually indicate a missing texture resource.

public static readonly field Error
type IModelTexture

Gradient

A texture with some pseudo-random gradients in each color channel.

public static readonly field Gradient
type IModelTexture

NormalUpRB

Placeholder for encoded normal map.

public static readonly field NormalUpRB
type IModelTexture

See also:

Image.EncodeNormals

NormalUpRGB

Placeholder for normal map.

public static readonly field NormalUpRGB
type IModelTexture

See also:

IMaterial.NormalMap

White

Uniform texture of color White.

public static readonly field White
type IModelTexture

Public / Attributes

CanPreloadResource

Does this resource handle support preloading?

public property CanPreloadResource { get }
type bool
value true if preloading is supported (i.e. PreloadResource will never return null),
false if preloading is not supported (i.e. PreloadResource always returns null).
implements IPreloadingResourceHandle.CanPreloadResource

PreferredTextureFormat

The preferred format to use for this model texture.

public virtual property PreferredTextureFormat { get }
type TextureFormat
value The preferred texture format or null.
implements IModelTexture.PreferredTextureFormat

Public / Constructors

For

Creates a new instance of IModelTexture that has a uniform color.

public static method For (int64 color, bool srgb = true)
type IModelTexture
params color The uniform color to use.
  srgb Create sRGB compressed texture? Defaults to true.
returns [not-null] The model texture.

Creates a new instance of IModelTexture that refers to the given texture file.

public static method For (Path path, TextureFormat format = null, bool srgb = true)
type IModelTexture
params path [not-null] File path of the texture to refer to. If srgb is set to false, no gamma-correction will be applied when loading the texture image.
  format The texture format to use if the image file does not specify one. Set to null to choose a texture format from the pixel format automatically. Defaults to null.
  srgb The Srgb flag to use for encoding the texture. Defaults to true.
returns [not-null] The model texture.

Creates a new instance of IModelTexture that refers to the given image descriptor.

public static method For (IImage image, TextureFormat format = null, bool srgb = true)
type IModelTexture
params image [not-null] Image descriptor of the texture to refer to. Gamma correction is controlled by the image descriptor.
  format The texture format to use if the image file does not specify one. Set to null to choose a texture format from the pixel format automatically. Defaults to null.
  srgb The Srgb flag to use for encoding the texture. Defaults to true.
returns [not-null] The model texture.

Public / Methods

CreateResource

Creates a new resource object, using the given graphics context.

[OwnerReturn]
public virtual method CreateResource (Graphics graphics)
type IResource
params graphics [not-null] The graphics context to use.
returns The resource object or null.
implements IResourceHandle.CreateResource

Remarks:

Resource objects may implement the IMemoryConsumption interface. In this case, the reported memory consumption will be interpreted as an estimate on how much GPU memory is consumed by the resource. This estimate can then be used for resource caching (e.g. CacheMemory).

Equals

Compares this object with the given one.

[Pure]
public virtual method Equals (IResourceHandle other)
type bool
params other The object to compare to.
returns true if this object is equal to other, false if not.
implements IEquatable.Equals

GetHashCode

[Pure]
public override method GetHashCode ()
type int32

PreloadResource

Preloads resource data, without creating the resource object.

[OwnerReturn, ThreadSafe]
public method PreloadResource ()
type IResourceData
returns The preloaded resource data or null if this resource handle does not support resp. require preloading.
implements IPreloadingResourceHandle.PreloadResource

Remarks:

Calling CreateResource on the returned resource will perform no additional loading, which means that all necessary data is already present in memory.

ReadElevation

Reads elevation data.

public virtual method ReadElevation (PixelRange range)
type ElevationBuffer
params range The pixel range to use (see ScanlineRange).
returns [not-null] The elevation data.
implements IModelTexture.ReadElevation

ReadPixels

Reads pixel data.

public abstract method ReadPixels ()
type ColorBuffer
returns The pixel data or null if not found.
implements IModelTexture.ReadPixels

ReadTexels

Reads texture data.

[OwnerReturn]
public virtual method ReadTexels ()
type TexelBuffer
returns The texture data or null if not found.
implements IModelTexture.ReadTexels

Protected / Methods

ReadTexels

[OwnerReturn]
protected method ReadTexels (TextureFormat format, bool srgb)
type TexelBuffer
params format
  srgb