Skip to content

Instantly share code, notes, and snippets.

Last active September 29, 2018 03:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?

Converting a GLSL 3 Shader back to GLSL 1 for webgl1

Let's say you have a modern shader written in glsl 300, but you need to make it work with webgl1.

Remove: #version 300 es


in,out -> varying
texture -> texture2D


With webgl es, you define whatever variable you will use for color. In webgl2 with GLSL 300, it's always gl_FragColor

Set color with:

gl_FragColor = whatever_vec4_variable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment