I am using webgl with javascript. Is there a way to render without antialias? I need every pixel to be of a solid color.
my current fragment shader is very simple:
precision mediump float;
varying highp vec3 lighting;
void main(void)
{
gl_FragColor = vec4(lighting, 1.0);
}
UPDATE
Based on @Moormanly's answer, I have achieved the following by setting the antialias attribute in the getContext:
Default aliasing:

Antialias = false:

You can set attributes when creating a context using the ( optional ) second parameter of the getContext method.
Code:
var context = canvas.getContext('webgl', {antialias: false});Check out chapter 5.2 of the WebGL specification for more information.
From forums.tigsource.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With