My webgl program renders a white square, however whenever I try to pass a varying variable to the fragment shader it disappears, even if all the fragment shader does is: `gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
this renders nothing
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 vertexPos;
attribute vec4 aColor;
varying vec4 color;
void main(void)
{
gl_Position = vec4(vertexPos, 1.0);
color = aColor;
}
</script>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec4 color;
void main(void)
{
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
</script>
this renders a white square
<script id="shader-vs" type="x-shader/x-vertex">
attribute vec3 vertexPos;
attribute vec4 aColor;
varying vec4 color;
void main(void)
{
gl_Position = vec4(vertexPos, 1.0);
//color = aColor;
}
</script>
<script id="shader-fs" type="x-shader/x-fragment">
precision mediump float;
varying vec4 color;
void main(void)
{
gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
}
</script>
aColor
changed the locations of the attributes and so you're not setting them up correctly. – gman