The Shaderity-Graph is a tool to resolves a node graph.
- shaderity-graph: This. a runtime for node graph processing.
- shaderity: for runtime features
- shaderity-loader: for static features
- shaderity-node: The internal component for shaderity-loader.
- shaderity-loader: for static features
- shaderity: for runtime features
Currently, we only support node graph resolving for GLSL shaders.
By providing a node graph of the shader in the specified JSON format, you can create a shader for GLSL ES 3.0.
Note:
-
In combination with the Shaderity, the output shader can be transformed for GLSL ES 1.0.
-
Currently, dynamically changing node graphs are not supported. You cannot break the connection between nodes.
$ yarn install
$ yarn build
The built files will be created under the dist folder.
You can convert the specified json format into vertex and fragment shader codes using the ShaderityGraphConverter.createShaderCodesFromJsonFile method or ShaderityGraphConverter.createShaderCodesFromJsonObject method.
import _ShaderityGraph from '../../dist/esm/index';
declare const ShaderityGraph: typeof _ShaderityGraph;
(async () => {
const shaderCodes = await ShaderityGraph.ShaderityGraphConverter.createShaderCodesFromJsonFile('./shaderNodeGraph.json');
console.log(shaderCodes.vertexShader);
console.log(shaderCodes.fragmentShader);
})();
You can create a document under the doc folder with the following command:
yarn doc
You can run tests with the following command:
yarn test