Use triangles to draw points with WebGL
This commit is contained in:
@@ -4,20 +4,19 @@
|
||||
|
||||
//! COMMON
|
||||
|
||||
|
||||
//! VERTEX
|
||||
attribute vec2 a_position;
|
||||
attribute vec2 a_offsets;
|
||||
|
||||
uniform mat4 u_projectionMatrix;
|
||||
|
||||
void main(void) {
|
||||
gl_PointSize = 10.0;
|
||||
gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);
|
||||
gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.) + vec4(a_offsets, 0., 0.);
|
||||
}
|
||||
|
||||
|
||||
//! FRAGMENT
|
||||
|
||||
void main(void) {
|
||||
gl_FragColor = vec4(1.0, 1.0, 0.0, 0.7);
|
||||
gl_FragColor = vec4(1.0, 1.0, 0.0, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user