How to create a multi-color square grid in OpenGL ES 2.0?

Using Open GL ES 2.0, I want to create a large grid of squares where each square can take on a specific color defined by a definition file. So this is not a simple chessboard with only black and white squares ...
What is the best way to do this to avoid artifacts?

Thanks in advance

+3
source share
1 answer

There is nothing that indirectly causes artifacts when drawing a grid of squares. There are no inherent problems with z-wrestling, depth or transparency, as described in this question.

(, ) . 4 . , . , , .

, :

square0Pos0
color0
square0Pos1
color0
square0Pos2
color0
square0Pos3
color0
square1Pos0
color1
...

, . .

-1.0 1.0, .

, glDrawArrays(GL_TRIANGLES, ...).

+2

Source: https://habr.com/ru/post/1773614/


All Articles