Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
glsl-conditional-loader
Advanced tools
A webpack loader for glsl files that support conditional #include tags. The loader loads a function that receives a properties object.
In webpack.config:
module:{
rules:{
{
test: /\.(glsl|frag|vert)$/,
use: [
{
loader: 'glsl-conditional-loader',
options: {
verbose: false, //default = false
es5: true //default = true
},
}
],
}
}
}
in your .glsl files, include other files with the #include tag and relative path add if statement to make this include conditional.
#include ./path/to/other.glsl
#include ./path/to/shaderA.glsl if shaderToUse==="A"
#include ./path/to/shaderB.glsl if shaderToUse==="B"
#include ./path/to/shaderC.glsl if shaderToUse==="A" && isUsingC === true
The loader substitutes the first line with the content of "./path/to/other.glsl" and substitutes the second line only if in the options object, the property 'shaderToUse' is 'A'.
You can use #include tags in included files recursively. Circular dependency will throw an error.
const shaderCreator = require('./path/to/shader');
shaderSource = shaderCreator({
shaderToUse: "A",
isUsingC: false
});
FAQs
Webpack loader for conditional includes in glsl files
The npm package glsl-conditional-loader receives a total of 0 weekly downloads. As such, glsl-conditional-loader popularity was classified as not popular.
We found that glsl-conditional-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.