Create Additive Blend Shader

You need the following Simdify® modules to complete this exercise: Simdify® Free Edition

In this exercise you'll learn to use the Outline app and the Module app to create a shader module that implements additive blending. The following table shows the skills required to complete this exercise.

Skill Description
Starting Applications You need to be able to access the Windows Start Menu, find applications, and start them.
Opening Files You need to be able to open files from disk.
Tree View You need to be able use a Windows tree view to expand and contract nodes. You need to be able to right click on the nodes to access node command menus.
Text Editor You need to be able to start a text editor such as Notepad, Notepad++, or Visual Studio and open a text file from the hard disk. You need to be able to edit the text file and save the changes.

Open Simdify Data Project

In this exercise, you'll learn to create new folders for your shader module project.

  1. Start the Outline app. (Start > Programs > Scenomics > Outline) or (Windows® key and then type 'Outline' to find the app icon.)

    The application displays a splash screen and then the application desktop appears.

    This is a picture of the Outline application desktop.
  2. Select File > Open from the main menu. ALT + F + O or CTRL + O

    The application presents the file open dialog in the Outline application library folder. Note that there is a directory called Simdify Data.

    This is a picture of the file open dialog in the Outline application library.
  3. Enter the directory named Simdify Data. This is a picture of the Simdify Data.box in the Simdify Data directory.
  4. Open Simdify Data.box

    The document appears in the Outline app.

    This is a picture of the Simdify Data.box opened in the Outline application.
  5. Select Graph > Set View Compact from the main menu. ALT + A + W

    The software contracts nodes until you can see all the main child nodes in the hierarchy.

    This is a picture of the hierarchy with a compact view.
  6. Examine the hierarchy and find the <LibraryConfigNode> named Application Documents. This is a picture of the hierarchy showing the Application Documents folder.
  7. Right click over the <LibraryConfigNode> named Application Documents and select Find Module Library Folder from the listed options. This is a picture of the hierarchy with the application documents folder expanded.

    This finds the Module library folder and selects it so that it's easy to see.

    This is a picture of the hierarchy with the application documents folder expanded.

    The Simdify Data project contains all the information associated with your Simdify installation. Think of it like the 'north star' for everything you're doing with Simdify. You can always find all your documents in this project.

Create New Shader Module

In this exercise, you'll learn to create a new shader module project.

  1. Examine the hierarchy and find the <FolderConfigNode> named Module. This is a picture of the hierarchy showing the Module folder.
  2. Right click over the <FolderConfigNode> named Module and select New > Folder from the listed options. This is a picture of the hierarchy with the FolderConfigNode command menu showing the New commands popup.The software presents a dialog that allows you to set the name of the new folder.

    This is a picture of EnterTextDialog prompting you to set the name of the new folder.
  3. Type FBO Image Processing Tiles and click OK or hit ENTER when you are finished.

    The software creates the folder on disk and adds a new folder to the hierarchy.

    This is a picture of the hierarchy showing the new folder.
  4. Right click over the <FolderConfigNode> named FBO Image Processing Tiles and select New > Blank Shader Module from the listed options.

    The software presents a dialog that allows you to create a new shader module.

    This is a picture of the hierarchy with the FolderConfigNode command menu showing the New commands popup.
  5. Set Module Name to Additive-Blend-Module .
  6. Set Module Info to Implements a shader module for additive blending. .
  7. Set Usage Hint to Usage-Shader-Tile-Module.
  8. Set GLSL Version to 430 (or the highest version listed).
  9. Click OK or hit ENTER when you are finished.

    The application creates the new shader module.

  10. Select File > Save from the main menu. ALT + F + S

Open Shader Module

In this exercise, you'll learn to open the new shader module project in the Module app.

  1. Examine the hierarchy and find the <FolderConfigNode> named FBO Image Processing Tiles. This is a picture of the hierarchy showing the new folder.
  2. Right click over the <FolderConfigNode> named FBO Image Processing Tiles and select Expand All from the listed options.

    You can see all the files associated with the new shader module.

    This is a picture of the hierarchy with the new FolderConfigNode fully expanded.
  3. Examine the hierarchy and find the <FileConfigNode> named Additive-Blend-Module-430.box. This is a picture of the hierarchy showing the additive blend module file.
  4. Right click over the <FileConfigNode> named Additive-Blend-Module-430.box and select Open File from the listed options.

    The Module application loads the new shader module.

    This is a picture of the Module application desktop.
  5. Select Graph > State > Expand All Tree Items from the main menu. ALT + X This is a picture of the hierarchy showing the new shader module.

    If you're interested, you can learn about Simdify document rendering.

Modify Fragment Shader Source

In this exercise, you'll learn to implement the additive blend shader.

  1. Examine the hierarchy and find the <Program> node named Visual. This is a picture of the hierarchy showing the new shader module.
  2. Right click over the the <Program> node named Visual and select Copy Source Path > Fragment Shader from the listed options.

    The software displays a dialog that allows you to select the source file you wish to open. This includes any files #included by the shader. (While GLSL itself doesn't automatically support preprocessing shader source code, Simdify design applications DO allow you to use #include to create modular shaders.)

    This is a picture of the select source dialog.
  3. Left click fragment_shader.glsl and click OK or hit ENTER when you are finished.

    The application displays a dialog box that informs you the path has been copied to the clipboard.

    This is a picture of the select source dialog.
  4. Start a text editor such as Notepad, Notepad++, or Microsoft Visual Studio.
  5. Select the menu option to open a file from disk.
  6. Use CTRL + V to paste the path from the clipboard into the field that allows you to specify the path and filename.

    You'll see path such as: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\430\fragment_shader.glsl

  7. Open the fragment shader.

    All shaders are separated into two sections. Declarations are stored at global scope. The fragment shader itself is stored inside void main(void). Later, when we add nodes to the document to build our shader module, we're only going to be concerned with things declared at global scope. The body of all shaders is effectively invisible to Simdify design applications such as Module.

    // #version 430
    // The version number is automatically injected by the application.
    // It is included above for reference purposes only.
    #include <SPA_Version.glsl>
    #include <SPA_Constants.glsl>
    #include <Modules/SPA_EditStateFragmentColorOverride.glsl>
    #include "vertex_attributes.glsl"
    
    in Data { vertexData attributes; } DataIn;
    out vec4 fragColor;
    
    void main(void)
    {
       fragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
       SPA_EditStateFragmentColorOverride( fragColor );
    }

    Although you can't see it in your shader code, the OpenGL shader compiler on your machine also "inserts" built-in variables so they are visible to your shader.

  8. Find the following line:
    fragColor = vec4( 1.0, 0.0, 0.0, 1.0 );

    This line assigns red to the fragment shader output.

  9. Replace it with the following:

    Copy Text To Clipboard

    fragColor = vec4( 0.0, 1.0, 0.0, 1.0 );

    This line assigns green to the fragment shader output.

  10. Save the changes to the fragment shader source code and return to the running Module application. This is a picture of the Module application rendering the geometry with green instead of red.
  11. Return to the text editor that contains the fragment shader source code.
  12. Replace the entire fragment shader with the following:

    Copy Text To Clipboard

    // #version 430
    // The version number is automatically injected by the application.
    // It is included above for reference purposes only.
    #include <SPA_Version.glsl>
    #include <SPA_Constants.glsl>
    #include <Modules/SPA_EditStateFragmentColorOverride.glsl>
    #include "vertex_attributes.glsl"
    
    in Data { vertexData attributes; } DataIn;
    
    layout( binding = 0 ) uniform sampler2D lhs;
    layout( binding = 1 ) uniform sampler2D rhs;
    uniform float blend_opacity;
    
    out vec4 fragColor;
    
    vec4 add_images( vec4 base, vec4 blend, float opacity )
    {
       return ( base * opacity ) + blend * ( 1.0 - opacity );
    }
    
    void main(void)
    {
       vec4 lhs_sample = texture( lhs, DataIn.attributes.texcoord );
       vec4 rhs_sample = texture( rhs, DataIn.attributes.texcoord );
    
       vec4 res = add_images( lhs_sample, rhs_sample, blend_opacity ); // Performs additive blending using a standard algorithm.
    
       fragColor = res;
       SPA_EditStateFragmentColorOverride( fragColor );
    }
  13. Examine the following code in the fragment shader declarations.
    layout( binding = 0 ) uniform sampler2D lhs;
    layout( binding = 1 ) uniform sampler2D rhs;
    uniform float blend_opacity;

    In the next section, we'll create nodes that represent these declarations.

  14. Save the changes to the fragment shader source code and return to the running Module application.

Add Fragment Shader Resources

In this exercise, you'll learn to add resources required by the additive blend shader.

  1. Examine the worksheet.

    The new shader code is running, but we haven't provided the textures and uniforms needed to generate a result. You might see white or black depending on your GPU.

    This is a picture of the Module application rendering the geometry with the additive blend shader.
  2. Right click over the the <ProgramBindNode> node named Bind Visual and select Create Source Code Item from the listed options.

    The software presents a dialog that shows you items that have been declared in your shader.

    This is a picture of the source code items dialog box.
  3. Left click layout( binding = 0 ) uniform sampler2D lhs.
  4. Hold down CTRL and left click layout( binding = 0 ) uniform sampler2D rhs and uniform float blend_opacity. This is a picture of the source code items dialog box with source code items selected.
  5. Click OK or hit ENTER when you are finished.

    The software adds the items to the hierarchy. You'll notice some of the new items have red lines underneath them. This means that there is an error.

    This is a picture of the source code items added to the hierarchy.

    Move your mouse over the <SamplerNode> named layout( binding = 0 ) uniform sampler2D lhs. You'll see a tooltip appear that displays information the error.

    This is a picture of the SamplerNode validation tooltip displaying an error message.

    To make a long story short, both of the <SamplerNode> objects expect a <Texture>.

Load First Texture From Disk

In this exercise, you'll learn to load a texture from disk.

  1. Right click over the <SamplerNode> named layout( binding = 0 ) uniform sampler2D lhs and select Load Texture From Disk from the listed options.

    The software presents a dialog that allows you to select a texture from disk.

    This is a picture of the open file dialog in the texture library.
  2. Enter the folder named IPF_8888_ARGB .
  3. Select additive_lhs.png from the listed options.
  4. Click Open or hit ENTER when you are finished.

    The software adds a <Texture> node to the document and connects the <SamplerNode> to the new <Texture> node.

    Previously the rendered square in the middle of the worksheet was rendered with white or black. Note that the rendered square in the middle of the worksheet may change color. It may become white or black. This is because we've provided only a single texture and the shader requires two textures.

  5. Select Graph > State > Expand All Tree Items from the main menu. ALT + X

    You can see the new <Texture> node named additive_lhs.

    This is a picture of the hierarchy showing the new texture.

Load Second Texture From Disk

In this exercise, you'll learn to load a texture from disk.

  1. Right click over the <SamplerNode> named layout( binding = 1 ) uniform sampler2D rhs and select Load Texture From Disk from the listed options.

    NOTE: Make sure you are selecting the second sampler, not the first!

    The software presents a dialog that allows you to select a texture from disk.

    This is a picture of the open file dialog in the texture library.
  2. Enter the folder named IPF_8888_ARGB .
  3. Select additive_rhs.png from the listed options.
  4. Click Open or hit ENTER when you are finished.

    The software adds a <Texture> node to the document and connects the <SamplerNode> to the new <Texture> node.

    Now you can see something other than black or white. It shows only one texture because we haven't configured the <Float32Node> that sets the blending opacity. In this case, blending opacity is still 0.0, which means that it will render 100% of one of the textures.

    This is a picture of the rendered results after setting the second texture.

    You can see the new <Texture> node named additive_rhs.

    This is a picture of the hierarchy showing the new texture.

Configure Opacity Uniform

In this exercise, you'll learn to configure a uniform.

  1. Right click the <Float32Node> named uniform float blend_opacity and select Edit... from the listed options.

    This displays a property editor that allows you to edit the value of the node.

    This is a picture of the Float32Node editor.
  2. Set Fill Value to 0.5 and hit ENTER or click OK when you are finished.

    Now the shader is rendering a useful result.

    This is a picture of the rendered results after setting the blend opacity to 0.5.
  3. Select File > Save from the main menu. ALT + F + S

Export To Simdify Window Runtime

In this exercise, you'll learn to export the document to the Simdify runtime.

  1. Select File > Export > Windows 64-Bit... from the main menu.

    The software displays a dialog that allows you to configure the export parameters. We'll use the default values, which means we don't need to make any changes.

    This is a picture of the Windows export dialog.
  2. Click OK or hit ENTER when you are finished.

    The software exports the document and opens a folder that contains the exported data.

    This is a picture of the folder containing the exported data.
  3. Find the file named run_engine.cmd. This is a picture of run_engine.cmd file in the folder containing the exported data.

    The Simdify Runtime starts and loads the file from disk.

    This is a picture of shader module in the Simdify Runtime.

    This is your first OpenGL workload running in the Simdify Runtime.

  4. Hit ESC to exit the Simdify Runtime.
  5. Close the folder containing the exported data.
  6. Return to the running Module application.
  7. Examine the output window at the bottom of the workspace.

    You'll see the export log in the output window.

    --- <Executing Export 'C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Additive-Blend-Module-430.box - Invoking Function: Execute'> ---
    
    Processing <Model3D> named Module.
    Traversing <Group> named Module.
    Processing <IncludePaletteNode> named Includes.
    Traversing <Group> named Includes.
    Processing <DataPaletteNode> named Locals.
    Traversing <Group> named Locals.
    Traversing <Group> named Inputs.
    Traversing <Group> named Texture Constraint.
    Traversing <Group> named Outputs.
    Processing <ShaderPaletteNode> named Shaders.
    Traversing <Group> named Shaders.
    Processing <Program> named Visual.
    Traversing <Group> named Visual.
    Processing <TexturePaletteNode> named Textures.
    Traversing <Group> named Textures.
    Processing <Texture> named additive_lhs.
    Processing <Texture> named additive_rhs.
    Processing <GeometryPaletteNode> named Geometry.
    Traversing <Group> named Geometry.
    Processing <ParametricMesh> named Mesh.
    Traversing <Group> named Mesh.
    Processing <ShaderResourceNode> named Visual.
    Traversing <Group> named Visual.
    Processing <ProgramBindNode> named Bind Visual.
    Traversing <Group> named Bind Visual.
    Processing <Float32MatrixNode> named uniform mat4x4 modelViewMatrix.
    Processing <Float32MatrixNode> named uniform mat4x4 modelViewProjectionMatrix.
    Processing <SamplerNode> named layout( binding = 0 ) uniform sampler2D lhs.
    Processing <SamplerNode> named layout( binding = 1 ) uniform sampler2D rhs.
    Processing <Float32Node> named uniform float blend_opacity.
    Processing <ShaderResourceNode> named Render.
    Traversing <Group> named Render.
    Processing <NodeLink> named Mesh.
    Traversing <Group> named Mesh.
    Validating <Program>: /Shaders/Visual
    Validating vertex shader: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\430\vertex_shader.glsl
    Validating fragment shader: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\430\fragment_shader.glsl
    Validating <Float32MatrixNode>: /Visual/uniform mat4x4 modelViewMatrix
    Validating <Float32MatrixNode>: /Visual/uniform mat4x4 modelViewProjectionMatrix
    Validating <SamplerNode>: /Visual/layout( binding = 0 ) uniform sampler2D lhs
    Validating <SamplerNode>: /Visual/layout( binding = 1 ) uniform sampler2D rhs
    Validating <Float32Node>: /Visual/uniform float blend_opacity
    
    Exporting Document...
    Exported <EditModel3D> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Module-91A8A638-8410-4EC7-8709-6D8ED55AA13B.spa_binary_node
    Exported <IncludePaletteNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Includes-19FC5DE5-BB8D-4964-931A-D62BED309514.spa_binary_node
    Exported <DataPaletteNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Locals-523C30B4-04D4-4169-9A6D-78C2AC94B1A0.spa_binary_node
    Exported <ShaderPaletteNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Shaders-1FD306BD-63D5-4389-9F9C-ACBECD4A0442.spa_binary_node
    Exported <Program> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Visual-E7274A5C-F421-4C62-9E3F-8E9F58E3E419.spa_binary_node
    Exported <TexturePaletteNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Textures-65EFE395-C794-4336-B8A6-8345FDACD875.spa_binary_node
    Exported <Texture> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\additive_lhs-250ACD95-4D63-4047-B637-D297E0BACC24.spa_binary_node
    Exported <Texture> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\additive_rhs-E319EB15-2608-49CB-AF26-0341884360EE.spa_binary_node
    Exported <GeometryPaletteNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Geometry-0C262F07-A870-4B87-AF2B-7D0474E2266A.spa_binary_node
    Exported <ParametricMesh> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Mesh-EB1E6E0B-3F48-48DC-8A7E-AC3E37AD331C.spa_binary_node
    Exported <ShaderResourceNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Visual-512B61D4-6E6C-4448-AD59-E1A354AB420C.spa_binary_node
    Exported <ProgramBindNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Bind_Visual-19884730-8F44-439A-A26E-2EBFA07E801E.spa_binary_node
    Exported <Float32MatrixNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\uniform_mat4x4_modelViewMatrix-3A226123-F7DA-46DD-B6E5-278285C663FF.spa_binary_node
    Exported <Float32MatrixNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\uniform_mat4x4_modelViewProjectionMatrix-2E389D77-B629-4F22-954D-BFCB95A7BDCF.spa_binary_node
    Exported <SamplerNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\layout(_binding_=_0_)_uniform_sampler2D_lhs-09224924-F224-4B4F-824E-41B02B134A0E.spa_binary_node
    Exported <SamplerNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\layout(_binding_=_1_)_uniform_sampler2D_rhs-7CECECD8-1930-4182-9A66-D7145B31AD22.spa_binary_node
    Exported <Float32Node> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\uniform_float_blend_opacity-3F3A0EA1-9EF0-4931-80E6-9206895C8193.spa_binary_node
    Exported <ShaderResourceNode> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Render-4AC8B059-9665-44FF-9A2F-9424373177B9.spa_binary_node
    Exported <NodeLink> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Mesh-58AABF99-DF82-4C91-98FA-561E057A217B.spa_binary_node
    Exported <Model3D> to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\Additive-Blend-Module-430.spa_binary_graph
    Exported to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\E7274A5C-F421-4C62-9E3F-8E9F58E3E419_vertex_shader.glsl
    Exported to disk: C:\Users\Installer Test 0\Documents\Scenomics\Library\Module\FBO Image Processing Tiles\Additive-Blend-Module\Export Win64 Additive-Blend-Module-430\E7274A5C-F421-4C62-9E3F-8E9F58E3E419_fragment_shader.glsl
    
    Document export complete.

    The export log provides information about the nodes that were visited during the export process and whether or not the export was successful. You don't generally need to pay too much attention to the export log unless there's an error.

  8. Select Desktop > Clear Ouput Window from the main menu. ALT + D + C

Create Left-Hand Side Texture Input Metadata

Question: what if we want to create a workflow that uses multiple shaders? Answer: we can use the Layout app. The Layout app allows you to build workflows from by creating tiles and connecting their inputs and outputs. This means that for any shader module we want to use with the Layout app, we need to make a model of the shader module's inputs and outputs. This additive blend shader takes two input textures and adds them together, using an opacity value to determine how to blend the two images together. That means we need to create three inputs. For outputs, the additive blend shader module renders to the screen buffer. In that case we can use a <Texture> to model the output.

  1. Examine the hierarchy and find the <SamplerNode> named layout( binding = 0 ) uniform sampler2D lhs. This is a picture of the hierarchy showing the left-hand side SamplerNode.
  2. Right click over the <SamplerNode> named layout( binding = 0 ) uniform sampler2D lhs and select Make Input Constraint from the listed options.

    The software presents a dialog that allows you to set the name of the new constraint.

    This is a picture of the rename dialog.
  3. Set the name to In LHS Texture Constraint and click OK or hit ENTER when you are finished.

    The software adds the new constraint to the document:

    This is a picture of the hierarchy showing the new TextureContraintNode.
  4. Select File > Save from the main menu. ALT + F + S

Create Right-Hand Side Texture Input Metadata

  1. Examine the hierarchy and find the <SamplerNode> named layout( binding = 1 ) uniform sampler2D rhs. This is a picture of the hierarchy showing the right-hand side SamplerNode.
  2. Right click over the <SamplerNode> named layout( binding = 1 ) uniform sampler2D rhs and select Make Input Constraint from the listed options.

    The software presents a dialog that allows you to set the name of the new constraint.

    This is a picture of the rename dialog.
  3. Set the name to In RHS Texture Constraint and click OK or hit ENTER when you are finished.

    The software adds the new constraint to the document:

    This is a picture of the hierarchy showing the new TextureContraintNode.
  4. Select File > Save from the main menu. ALT + F + S

Create Opacity Input Metadata

  1. Examine the hierarchy and find the <Float32Node> named uniform float blend_opacity. This is a picture of the hierarchy showing the opacity side Float32Node.
  2. Right click over the <Float32Node> named uniform float blend_opacity and select Make Input Constraint from the listed options.

    The software presents a dialog that allows you to set the name of the new constraint.

    This is a picture of the rename dialog.
  3. Set the name to In Opacity Constraint and click OK or hit ENTER when you are finished.

    The software adds the new constraint to the document:

    This is a picture of the hierarchy showing the new VariableContraintNode.
  4. Select File > Save from the main menu. ALT + F + S

Create Texture Output Metadata

This shader module writes directly to the screen. For that reason, it can be a little tricky to imagine how we can create output data. The screen is generally going to require RGBA data, but we might have shaders that need to write integer or floating point data. In this case, we'll use texture.

  1. Examine the hierarchy and find the <Float32Node> named uniform float blend_opacity. This is a picture of the hierarchy showing the opacity side Float32Node.
  2. Right click over the <Float32Node> named uniform float blend_opacity and select Make Input Constraint from the listed options.

    The software presents a dialog that allows you to set the name of the new constraint.

    This is a picture of the rename dialog.
  3. Set the name to In Opacity Constraint and click OK or hit ENTER when you are finished.

    The software adds the new constraint to the document:

    This is a picture of the hierarchy showing the new VariableContraintNode.
  4. Select File > Save from the main menu. ALT + F + S