To keep it short: As we all know, opengl draws many triangles on the screen.
What I want to know:
If opengl draws triangles, it has to know, which triangle belongs to which pixel on the screen, right?
Can I get this information too? For example call a function after a draw (like gl_retrieve_object_map()
or anything similar) where I get to know which pixel shows which triangle?
its like doing picking for every pixel
I am thinking of an 2 dimensional array telling me the triangle index or whatever:
on a 10x10 pixel screen for example:
0 0 1 1 1 1 1 0 0 0
0 0 0 1 1 1 1 0 2 0
0 0 0 0 1 1 1 2 2 0
0 0 0 0 0 1 1 2 2 0
0 0 0 0 0 2 1 2 2 0
0 0 0 0 2 2 2 2 2 0
0 0 0 2 2 2 2 2 2 0
0 0 2 2 2 2 2 2 2 0
0 2 2 2 2 2 2 2 2 0
0 0 0 0 0 0 0 0 0 0
for an image like:
___
\ |
\ |
\|/|
/ |
/ |
/ |
/____|
is there anything that i could use?