Skip to content

Includes_File

Aiekick edited this page Mar 19, 2019 · 1 revision

you can put in code : #include "file.glsl"

the content of this include file will be merged by NoodlesPlate for compiling in the parent shader

by the way in this include file, you can define Sections :

@UNIFORMS @FRAMEBUFFER @COMMON @FRAGMENT @VERTEX @GEOMETRY @NOTE

by example if your main shader is like that

/////////////

@UNIFORMS

code

@VERTEX

#include "toto.glsl" code

@FRAGMENT

#include "toto.glsl" code

////////////

and if toto.glsl contain :

@UNIFORMS

code_toto_unif

@FRAGMENT

code_toto_frag

////////////

as you see toto.glsl not contian veretx section

so the only section whill be merge are UNIFORMS in Parent VERTEX and Parent FRAGMENT, and FRAGMENT in Parent Fragment, like that :

@UNIFORMS

code_toto_unif code

@VERTEX

code

@FRAGMENT

code_toto_frag code

teh include file can have his own uniforms and as a include file can be common to many buffer, all the unfirosma re grouped. so you tune this include file for all buufer who use it :) powerfull no ? :)

Clone this wiki locally