#version 300 es // fragment shaders don't have a default precision so we need // to pick one. mediump is a good default. It means "medium precision" precision mediump float; in vec3 pos; uniform vec4 u_color; out vec4 outColor; void main() { vec3 color = pos.xyz; color.z = color.z + 1.0; color.z = color.z / 2.0; color.z = color.z * 255.0; outColor = vec4(color, 1.0); }