Engine icon indicating copy to clipboard operation
Engine copied to clipboard

Shader language custom features

Open mouse0w0 opened this issue 6 years ago • 3 comments

A Shader Language preprocessor processes the shader code to add some custom features.

~'#include'~'#import' statement

Include statement to include the code of another shader file into the code of current shader file. For example:

#import "library/another.shader"

Collecting shader information

Collecting the shader source code information into the data structure. Including but not limited to uniforms, vertex attributes, ins, outs, consts, functions.

mouse0w0 avatar Dec 06 '19 16:12 mouse0w0

#include can only be supported if the graphics card has this extension supported: GL_ARB_shading_language_include If we have to support this on any cards, we do need some tricks to simulate it

cvrunmin avatar Dec 07 '19 09:12 cvrunmin

#include can only be supported if the graphics card has this extension supported: GL_ARB_shading_language_include

No, I want to preprocess this statement before compiling shader code.

mouse0w0 avatar Dec 07 '19 09:12 mouse0w0

decided to refer https://github.com/KhronosGroup/glslang for 'collecting shader information' to help us build the parser

cvrunmin avatar Jan 07 '20 12:01 cvrunmin