opengl Shaders

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!


  • #version version_number // Which GLSL version we are using
  • void main() { /* Code */ } // Shader's main function
  • in type name; // Specifies an input parameter - GLSL 1.30
  • out type name; // Specifies an output parameter - GLSL 1.30
  • inout type name; // Parameter for both input and output - GLSL 1.30


typeThe parameter's type, it has to be a GLSL built-in type.


To specify which version of GLSL should be used to compile a shader, use the version preprocessor e.g. #version 330. Each version of OpenGL is required to support specific versions of GLSL. If a #version‚Äč preprocessor is not defined at the top of a shader, the default version 1.10 is used.

Got any opengl Question?