Hacker News new | ask | show | jobs
by corysama 1077 days ago
FYI: https://docs.gl/es2/glShaderSource takes an array of strings and just internally appends them together. So, rather than trying to #include common code for all my shaders, I just pass a common_code_string and a shader_specific_code_string every time.
1 comments

I could have definitely used that and I'm surprised I didn't realise it when researching how to include shader code. Luckily my setup required very little work and with my system I could share snippets between GLES and GL.