Method GL.GLSLUtils.GLSLProgram()->compile_string()
- Method
compile_string
int
compile_string(string
code
,string
path
)- Description
Compile the given string as a pixel/vertex shader. The string is compiled twice, once with VERTEX_SHADER defined, the other time with FRAGMENT_SHADER defined.
The functions vertex_main and fragment_main are special, in that when the vertex shader is compiled vertex_main is renamed to main and fragment_main is totally removed from the source. When the fragment shader is compiled it's the other way around.
This is done to make it easier to develop shaders, it's generally speaking more convenient to have them in one file that it is to have them in two.