Detailed Description

A texture which can be used to describe a surface.

Inheritance diagram for Loonim.SurfaceTexture:
Loonim.RasterSurfaceTexture

Public Member Functions

 SurfaceTexture ()
 
void Load (byte[] data)
 
void LoadProperties (TextureReader reader)
 Loads the set of properties from the given reader. More...
 
void Set (string property, Texture value)
 Convenience function. It also helps to cache the original property value and straight edit that. More...
 
void Set (string property, Color value)
 Convenience function. It also helps to cache the original property value and straight edit that. More...
 
void Set (string property, float value)
 Convenience function. It also helps to cache the original property value and straight edit that. More...
 
TextureNode getElementByInstanceId (int layerID)
 
Texture2D DrawAlbedo (int size)
 Renders as a static image (albedo only, not HDR). Please don't spam me! It creates a texture and draw meta, so.. More...
 
Texture ForceDraw (DrawInfo settings)
 Always draws even if properties haven't changed. Typically responds with a RenderTexture but it depends on your tree (i.e. if your tree is just a constant, then you'll actually get a Texture2D back). More...
 
Texture Draw (DrawInfo settings)
 The fastest of all the drawing approaches. Typically responds with a RenderTexture but it depends on your tree (i.e. if your tree is just a constant, then you'll actually get a Texture2D back). More...
 
Texture2D DrawAlbedo (int size, bool hdr)
 Renders as a static image (albedo only, optionally HDR). Please don't spam me! It allocates a texture, draw meta and probably a pixel buffer. More...
 
void CreateMap ()
 Builds or rebuilds the property map. More...
 
void RemoveProperty (string property)
 Removes the given property by its nice name. More...
 
void SetProperty (string property, Values.PropertyValue value)
 Sets the named property. More...
 
SurfaceProperty GetProperty (string property, bool create)
 Gets the named property by nice name, optionally creating it. More...
 

Static Public Member Functions

static Texture2D ToTexture2D (Texture img, bool hdr)
 Converts an image (usually a RenderTexture) to a Texture2D. Optionally the resulting texture is HDR. More...
 
static void CopyTo (Texture2D image, RenderTexture rt)
 Copies a render texture into the given image. More...
 

Public Attributes

bool Changed
 True if this texture has changed in some way and it needs to be redrawn. Note! If you have RenderTexture's as inputs then this will be wrong (i.e. it doesn't know that the source properties are always changing). More...
 
TextureNode Root
 Noise describing the surface. More...
 
SurfaceProperty[] Properties
 The raw set of properties if there are any. More...
 
SurfaceDrawMode Mode =SurfaceDrawMode.GPU
 Draw using the GPU as often as possible. More...
 
Dictionary< string,
SurfaceProperty
PropertyMap
 A map of properties. Created if a property is requested by name. See this[string]. More...
 

Properties

Texture Texture [get]
 The output texture. Available after PreAllocate or Draw has been called. More...
 
SurfaceProperty this[int property] [get, set]
 Gets/sets a property by its nice name. More...
 
Values.PropertyValue this[string property] [get, set]
 Gets a property value by its nice name. Note that nice names are generally rare. Null if it doesn't exist. More...
 

Constructor & Destructor Documentation

Loonim.SurfaceTexture.SurfaceTexture ( )
inline

Member Function Documentation

static void Loonim.SurfaceTexture.CopyTo ( Texture2D  image,
RenderTexture  rt 
)
inlinestatic

Copies a render texture into the given image.

void Loonim.SurfaceTexture.CreateMap ( )
inline

Builds or rebuilds the property map.

Texture Loonim.SurfaceTexture.Draw ( DrawInfo  settings)
inline

The fastest of all the drawing approaches. Typically responds with a RenderTexture but it depends on your tree (i.e. if your tree is just a constant, then you'll actually get a Texture2D back).

Texture2D Loonim.SurfaceTexture.DrawAlbedo ( int  size)
inline

Renders as a static image (albedo only, not HDR). Please don't spam me! It creates a texture and draw meta, so..

Texture2D Loonim.SurfaceTexture.DrawAlbedo ( int  size,
bool  hdr 
)
inline

Renders as a static image (albedo only, optionally HDR). Please don't spam me! It allocates a texture, draw meta and probably a pixel buffer.

Texture Loonim.SurfaceTexture.ForceDraw ( DrawInfo  settings)
inline

Always draws even if properties haven't changed. Typically responds with a RenderTexture but it depends on your tree (i.e. if your tree is just a constant, then you'll actually get a Texture2D back).

TextureNode Loonim.SurfaceTexture.getElementByInstanceId ( int  layerID)
inline
SurfaceProperty Loonim.SurfaceTexture.GetProperty ( string  property,
bool  create 
)
inline

Gets the named property by nice name, optionally creating it.

void Loonim.SurfaceTexture.Load ( byte[]  data)
inline
void Loonim.SurfaceTexture.LoadProperties ( TextureReader  reader)
inline

Loads the set of properties from the given reader.

void Loonim.SurfaceTexture.RemoveProperty ( string  property)
inline

Removes the given property by its nice name.

void Loonim.SurfaceTexture.Set ( string  property,
Texture  value 
)
inline

Convenience function. It also helps to cache the original property value and straight edit that.

void Loonim.SurfaceTexture.Set ( string  property,
Color  value 
)
inline

Convenience function. It also helps to cache the original property value and straight edit that.

void Loonim.SurfaceTexture.Set ( string  property,
float  value 
)
inline

Convenience function. It also helps to cache the original property value and straight edit that.

void Loonim.SurfaceTexture.SetProperty ( string  property,
Values.PropertyValue  value 
)
inline

Sets the named property.

static Texture2D Loonim.SurfaceTexture.ToTexture2D ( Texture  img,
bool  hdr 
)
inlinestatic

Converts an image (usually a RenderTexture) to a Texture2D. Optionally the resulting texture is HDR.

Member Data Documentation

bool Loonim.SurfaceTexture.Changed

True if this texture has changed in some way and it needs to be redrawn. Note! If you have RenderTexture's as inputs then this will be wrong (i.e. it doesn't know that the source properties are always changing).

SurfaceDrawMode Loonim.SurfaceTexture.Mode =SurfaceDrawMode.GPU

Draw using the GPU as often as possible.

SurfaceProperty [] Loonim.SurfaceTexture.Properties

The raw set of properties if there are any.

Dictionary<string,SurfaceProperty> Loonim.SurfaceTexture.PropertyMap

A map of properties. Created if a property is requested by name. See this[string].

TextureNode Loonim.SurfaceTexture.Root

Noise describing the surface.

Property Documentation

Texture Loonim.SurfaceTexture.Texture
get

The output texture. Available after PreAllocate or Draw has been called.

SurfaceProperty Loonim.SurfaceTexture.this[int property]
getset

Gets/sets a property by its nice name.

Values.PropertyValue Loonim.SurfaceTexture.this[string property]
getset

Gets a property value by its nice name. Note that nice names are generally rare. Null if it doesn't exist.