Last active
November 5, 2019 08:57
-
-
Save valentincognito/d811c4a07601d778e9f38376e09c9550 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//snippet to easily include three.js shader chunks in your custom shaders | |
replaceThreeChunkFn(a, b) { | |
return THREE.ShaderChunk[b] + '\n' | |
} | |
shaderParse(glsl) { | |
return glsl.replace(/\/\/\s?chunk\(\s?(\w+)\s?\);/g, this.replaceThreeChunkFn) | |
} | |
//https://github.com/mrdoob/three.js/tree/dev/src/renderers/shaders/ShaderChunk | |
// chunk(shadowmap_vertex); | |
// chunk(bumpmap_pars_fragment); | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment