Skip to content

Conversation

@homerjam
Copy link

@homerjam homerjam commented Feb 11, 2021

This PR includes rather a lot of whitespace and prettier formatting I'm afraid : )

If you like the feature I can tidy it up!

The basic idea is to allow you to easily include chunks from the default threejs shaders in your own, like so:

// myfancyshader.frag

// includes the header chunk
#pragma glslify: import('three/src/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js')(/`(.*)void main/gs)

// custom header

void main() {
  // includes the main chunk
  #pragma glslify: import('three/src/renderers/shaders/ShaderLib/meshbasic_vert.glsl.js')(/void main\(\) {(.*)}/gs)

  // custom main
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant