Creating User Interfaces for Effects Parameters

The parameters defined in an effects (.cgfx or .fx) file dynamically generate user interfaces when loaded into the render tree. Every global variable that is not bound to SAS is automatically displayed in the shader's property editor unless specified otherwise.

User interfaces are defined in the effects file using annotations. An annotation is a list of variables and values denoted by angle brackets immediately following a declaration. The effects file format does not interpret the meaning of annotations in any way. Therefore, annotations make it possible to attach additional information to parameters for use by Softimage.

Specifically, annotations that define the UIWidget or SasUiControl variable are used to generate an appropriate user interface control that the artist can use for tweaking parameter values. You can specify a "Color" or "Slider" type of control. Use "None" when no user interface is required.

The texture image nodes required by the effects shader are automatically created and connected to the shader node if you defined a ResourceType for your texture samplers.

TipAlternatively, you can control the property editor's interface using a plug-in script. For an example, see rts_fixup.js in the Addons\RTUserTools\Application\Plugins folder of the installation location.

"Slider" Control for Scalar Values

float SpecularPower
	string UIWidget = "Slider";
	string UIName = "Specular Power";
	float UiMin = 1;
	float UiMax = 200;
> = 20.0f;

"Color" Control for Color Values


Defines sliders for the R,G,B color channels.


Defines sliders for the R,G,B,A color channels.

float3 SpecularColor
	string UIWidget = "Color";
	string UIName = "Specular";
> = {1.0f, 1.0f, 1.0f};

Texture Clip Control for On-Disk Images

ResourceType = "2D"; "3D"; and "Cube"

texture2D AlbedoMap
	string ResourceName = "default_surface_map.png";
	string ResourceType = "2D";
sampler2D AlbedoSampler = sampler_state
	Texture = <AlbedoMap>;
	MinFilter = LinearMipMapLinear;
	MagFilter = Linear;
	WrapS = Repeat;
	WrapT = Repeat;