shaderity-node is the core part of the shaderity-loader.
The main feature of this library is the following.
-
If there is a description "#pragma shaderity: require(path)" in the shader code file, substitute the contents of the file in (argument resourcePath)/(path) into it. There is a sample in "How to use".
-
Determines if it is a vertex shader or fragment shader from the extension.
You can use this via shaderity-loader.
Sample of feature 1: Suppose you have two files in the same folder, as shown below.
test.glsl
#pragma shaderity: require(./version.glsl)
void main(){}
version.glsl
#version 100
If you use the requireFile method of this library to read test.glsl, it will load as follows:
#version 100
void main(){}
MIT License