Adding Shader Library Functions

SDK ›› OpenGl ››
Parent Previous Next

Registering new openGl Functions




New openGl functions can be registered with Mari's Shader API


Adding functions


glslc & glslh files are automatically registered when placed inside the following folder structure


~\Scripts\ExtensionPack_XvXX\Shaders\FunctionLibrary\


Its best to try to follow how the folder and file naming convection are currently set so using the


fileFunctionName.glslc -- This is the equivalent of a source file

fileFunctionName.glslh -- This is the equivalent of a header file


Create your own Sub-folder to keep things separate and organized, while also allowing to give credit to developers.


Example:


~\Scripts\ExtensionPack_XvXX\Shaders\FunctionLibrary\USER_FunctionLibrary


With this system you can prefix any nodes added into the library from the XML nodes, to Function libraries


Example: USER_NewNode.xml, USER_Procedurals.glslc etc...


Beautify Python Console Output


You can  properly name your function library so that the output of the python console load up is nicer by

setting the LibraryNamer.xml in the \FunctionLibrary\

This allows you to set a custom Python Register Printout in the console for your library.



Example:   <DT3D_ProceduralLib>DT3D Procedural Lib</DT3D_ProceduralLib>

                 <ID_ProceduralLib>Ideascale Procedural Lib</ID_ProceduralLib>


The name inside of the Tag must be the exact name of the file for your function file you are registering

into the library. So in the previous examples the file names are DT3D_ProceduralLib.glslc/glslh It is

important that the file name and tag match exactly, because that is how the renamer XML file works with the

autoloader.


Documenting new Functions


We would encourage you to document new functions added to the library so that others can use them.

A common place to document them is the MariFunctionLib_FunctionOverview.txt on our GitHub.


Existing Functions


Existing Functions can be found in the Function Overview Section of this SDK


Created with the Personal Edition of HelpNDoc: Free help authoring tool