-
Notifications
You must be signed in to change notification settings - Fork 32
08. Variable Editor
The line: uniform float Angle; slider[45.00,0,360] in the GLSL editor will make a simple variable editor widget appear.
To create widgets for other types of uniforms
uniform type name widget[min,default,max] locktype logarithmic
The keyword uniform must always be present at the beginning of the line.
locktype can be one of locked notlocked notlockable alwayslocked defaults to notlocked
In the Menu/Edit/Preferences dialog you can select the behaviour of lock handling.
Locked uniforms can be interpreted as #define or as const in the final GLSL code that gets sent to the GPU.
type and widget can be one of these GLSL valid types and corresponding Fragmentarium widget.
| - | Type | - | Widget |
|---|---|---|---|
| uniform | int | name | slider[min,default,max] |
| uniform | bool | name | checkbox[true,false] |
| uniform | float | name | slider[min,default,max] |
| uniform | vec2 | name | slider[(min,min),(default,default),(max,max)] |
| uniform | vec3 | name | slider[(min,min,min),(default,default,default),(max,max,max)] |
| uniform | vec4 | name | slider[(min,min,min,min),(default,default,default,default),(max,max,max,max)] |
| uniform | vec3 | name | color[R,G,B] color selector only |
| uniform | vec4 | name | color[min,default,max,] slider with color selector |
| uniform | sampler2D | name | file[imageFileName] can be any supported format |
| uniform | samplerCube | name | file[cubemap.png] |
| uniform | double | name | slider[min,default,max] |
| uniform | dvec2 | name | slider[(min,min),(default,default),(max,max)] |
| uniform | dvec3 | name | slider[(min,min,min),(default,default,default),(max,max,max)] |
| uniform | dvec4 | name | slider[(min,min,min,min),(default,default,default,default),(max,max,max,max)] |
| uniform | dvec3 | name | color[R,G,B] color selector only |
| uniform | dvec4 | name | color[min,default,max,] slider with color selector |
If the keyword Logarithmic is at the end of the line the slider will respond with output on a logarithmic scale. (float, vec, double and dvec types only)
float type sliders have 9 decimal places while double types have 18.