Skip to content

Instantly share code, notes, and snippets.

@greggman
Created August 3, 2017 09:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greggman/71e081485f2153af2709cc33aaed9ed5 to your computer and use it in GitHub Desktop.
Save greggman/71e081485f2153af2709cc33aaed9ed5 to your computer and use it in GitHub Desktop.
mod your shader in js
function getShaderSource(needsBGRA) {
const twizzle = needsBGRA ? '.bgra' : '';
return `
...
imageColor = texture2D(u_image, v_image_coordinates)${twizzle};
...
`;
}
// or however you want to patch up the shader
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment