Update 26.09.07

Custom ShaderTemplates, sky ShaderType and some new nodes

You can now provide a custom ShaderTemplate that implements the one of 3 currently available ShaderTypes with your own custom code. 
  Keep in mind this is an evolving feature and is subject to change. 

 Template Editor

General tab is where the main properties other than code reside.


Code tab is where your template code goes.

It is recommended that you prepare your template code in an external text editor as the built in TextArea is subpar for editing multiline text. 

Shader Template Tags


The tags specify what goes where in each block of the shader template while also letting you inject whatever you need in between each tag. However each tag can only be placed within their original shader block that they appear in in the default Shader Template. 

Currently there is a lack of error checking for any misplacement of a tag outside of their respective block/main stage function which results invalid shader to be generated.

Here's a list of all the current Shader Template Tags and what they are for :

  •  /*sgp_shader_description*/ -  Shader description string. 

  • /*sgp_shader_feature_defines*/ - ShaderFeatures from the Blackboard and or GraphCompiler. 

  • /*sgp_shader_common*/ - Common block code. 

  • /*sgp_vertex_input_data*/ - Vertex input struct data . 
     
  • /*sgp_pixel_input_data*/ - Pixel input struct data . 
       
  • /*sgp_vertex_globals*/ - Vertex shader stage globals .

  • /*sgp_vertex_combo_rules*/ - Vertex shader stage combo rules . 

  • /*sgp_vertex_functions*/ - Vertex shader stage functions.

  • /*sgp_vertex_code*/ - Vertex shader stage MainVs locals.

  • /*sgp_pixel_globals*/  - Pixel shader stage globals . 

  • /*sgp_pixel_combo_rules*/  - Pixel shader stage combo rules. 

  • /*sgp_pixel_functions*/  - Pixel shader stage functions. 

  • /*sgp_pixel_code*/ - Pixel shader stage MainPs locals. 

  • /*sgp_pixel_output*/ - Pixel shader stage result.
 

Using Custom Template


Using a custom ShaderTemplate is as simple as choosing it from the ShaderType dropdown.
Added the ability to create and preview sky shaders.

Sky shaders require that the string "sky" be in the name. Primarily due to a requirement in the 2D Skybox Component.


Added Four new nodes :
  • RandomFloats node - Random floats in each component, values change every frame.
  • Sun node - Info of the sun direction and color.
  • ProjectionToView node - Projection-space coordinates to view space .
  • InverseProjectionRow3 node - Row 3 of the inverse projection matrix.
The result node now displays the name of the ShaderGraphPlus asset in its node header.

Exposed  g_vCameraUpDirWs  and  g_flCameraFOV on the Camera node as the DirectionUp & FOV inputs.

Its nice to work on and "mostly" finish a new feature. But I plan on doing a bit more in the future. Which primarily consists of a bit of polish and some documentation on every node and system within Shader Graph Plus

Update 26.09.07

26.09.07
5 September 2026
18 changes in this update

Added

8 changes
  • RandomFloats node.

  • Sun node.

  • ProjectionToView node.

  • InverseProjectionRow3 node.

  • DirectionUp and FOV outputs to camera node.

  • Ability for the user to provide a semi-custom base shader template in the form of the .shdrtpl assets.

  • Sky shader type.

  • Ability to preview sky shaders.

Improved

5 changes
  • Show the asset path in the title of the ShaderGraphPlus editor window.

  • Show the asset name in the Result node header.

  • Replaced Domain property with ShaderType property which integrates both the built-in ShaderTemplates along with the custom user provided ones.

  • Updated Generate Code dock TextEditArea so that the text TabSize is more reasonable.

  • Check Parameter names to see if they conflict with internally defined shader global parameters. And if so, show an error to the user.

Fixed

1 change
  • Fixed duplicate plugs when a subgraph input is referenced more than once (community fix from LeDernierPoisson).

Removed

1 change
  • Project Creator Dialog.

Known Issues

3 changes
  • Lack of stricter error checking on where the ShaderTemplate tags are. Resulting in invalid shaders being generated.

  • Compiling with the Gradient Constant Node will produce slang errors.

  • Some nodes may break due to a ShaderTemplate not having certain VertexInput/PixelInput struct items.

people
Log in to reply
You can't reply if you're not logged in. That would be crazy.