A texture which can be used to describe a surface.
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... | |
|
inline |
|
inlinestatic |
Copies a render texture into the given image.
|
inline |
Builds or rebuilds the property map.
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).
|
inline |
Renders as a static image (albedo only, not HDR). Please don't spam me! It creates a texture and draw meta, so..
|
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.
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).
|
inline |
|
inline |
Gets the named property by nice name, optionally creating it.
|
inline |
|
inline |
Loads the set of properties from the given reader.
|
inline |
Removes the given property by its nice name.
|
inline |
Convenience function. It also helps to cache the original property value and straight edit that.
|
inline |
Convenience function. It also helps to cache the original property value and straight edit that.
|
inline |
Convenience function. It also helps to cache the original property value and straight edit that.
|
inline |
Sets the named property.
|
inlinestatic |
Converts an image (usually a RenderTexture) to a Texture2D. Optionally the resulting texture is HDR.
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.
|
get |
The output texture. Available after PreAllocate or Draw has been called.
|
getset |
Gets/sets a property by its nice name.
|
getset |
Gets a property value by its nice name. Note that nice names are generally rare. Null if it doesn't exist.