Unigine.TextureCurve Class
Interface for handling curve textures. This class lets the user store 2d curves in a form of a texture (convert vectors to raster data).
Curve textures can be used for color variation in the particles_base material of Particle Systems or in other custom materials.
You can set up to 4 channels for the curve texture.
TextureCurve Class
Properties
Texture Texture#
Pointer to the texture.
int NumChannels#
The number of channels.
set
Sets the new number of channels for the texture.
set value -
Number of texture channels.
int Resolution#
Texture width resolution.
set
Sets the width resolution for the texture.
set value -
Texture width resolution.
int Flags#
Texture flags.
set
Sets texture flags.
set value -
Texture flags.
Members
TextureCurve ( int num_channels, int resolution, int flags ) #
Sets resolution, number of channels and texture flags for this TextureCurve instance. The pointer to the curve texture is set to null and curves are marked for an update.Arguments
- int num_channels - Number of texture channels.
- int resolution - Width resolution of the curve texture.
- int flags - Texture flags.
TextureCurve ( TextureCurve texture_curve ) #
Curve texture constructor. Creates a new curve texture by copying a given source curve texture.Arguments
- TextureCurve texture_curve - Pointer to a new curve texture.
void ReleaseTexture ( ) #
Deletes the texture and its pointer.void Copy ( TextureCurve src_texture_curve ) #
Copies the curves data of a source texture to the texture.Arguments
- TextureCurve src_texture_curve - Source curve texture.
TextureCurve Clone ( ) #
Duplicates the curve texture and returns a pointer to the copy.Curve2d GetCurve ( int channel ) #
Returns a pointer to the Curve2d for the specified channel.Arguments
- int channel - Required channel.
Return value
Pointer to a Curve2d object.IntPtr AddChangedCallback ( ChangedDelegate func ) #
Adds a callback function to be called on changing the curve texture. The signature of the changed callback function must be as follows:void changed_callback_function_name();
You can set a callback function as follows:
AddChangedCallback(() => changed_callback_function_name());
Arguments
- ChangedDelegate func - Callback function with the following signature: void ChangedDelegate()
Return value
ID of the last added changed callback, if the callback was added successfully; otherwise, nullptr. This ID can be used to remove this callback when necessary.bool RemoveChangedCallback ( IntPtr id ) #
Removes the specified callback from the list of changed callbacks.Arguments
- IntPtr id - Changed callback ID obtained when adding it.
Return value
True if the changed callback with the given ID was removed successfully; otherwise false.void ClearChangedCallbacks ( ) #
Clears all added changed callbacks.Last update:
2020-10-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)