Skip to reading
New Features Workbook: 35 Hands-on Lessons

Set a shader default and override one surface

Edition 0.86.4.7

37-page workbook using example workbenches included with the Studio release. The separately attached PDF is byte-identical to this ZIP copy and is included once.

Download PDFView illustrations

Animate a scene and its materials

STUDIO 0.86.4.7 • LESSON 20 OF 35

Share a shader between two targets, then give just one a stronger effect. A uniform is a named input declared by the shader, such as strength, tint or an image.

1. Import a compatible source

In Asset Designer import a .gdshader file, or a supported .glsl, .frag or .fs fragment. Use a canvas shader for a GUI element and a spatial shader for a 3D surface. Studio checks the converted source on the active renderer. Select the saved asset and inspect the uniforms the renderer reports.

2. Choose the shared starting value

For a float named strength, check its override in the asset parameters and set it to 0.5 if that fits its declared range. If your shader uses a different name, use that field. For a color use the color picker. For a texture choose a compatible image asset. Assign the shader to two compatible targets.

3. Change just one target

Open the first element, object, region, room or overlay that owns the effect. In its imported shader parameters, check strength and set it to 0.75. Leave the second target’s local checkbox clear. Inspect both in Runtime Preview. Clearing the first checkbox should restore the shared asset default.

Local strength set to 0.75. An obsolete override is retained below the current shader fields.

WHAT TO CHECK

If the two surfaces look identical, check that the shader actually uses the uniform in its output. If changing one affects both, confirm that you edited the first owner’s override rather than the shared asset.

Page 22 of 37Permalink
Go to page