Are there triangles as a gpu constraint or are there other transport paths?

To pose this question, I have a good understanding of OpenGL and the mathematics behind it, and although I have never touched anything related to DirectX, I assume the concepts are similar.

There is a lot of information about why triangles are used for 3D graphics (they are necessarily flat, indivisible, with the exception of small triangles, etc.). However, I would like to know if triangles are just a convenient way to store and process 3D data (simpler mathematical data regarding interpolation, etc.) or if there is a hardware constraint in the graphics card that realistically allows the rendering of triangles (e.g. , instructions that can essentially ONLY apply to triangles).

Following this, is there a way to achieve pixel-based control over graphical rendering (as summarized in response to this question ). Although I believe that direct control over individual pixels is done through the driver, is there any way to get such control over the rendering environment? Is it possible to "completely avoid triangles"?

+4
source share
2 answers

Yes and no. View.

Current GPUs are designed to render triangles, since triangles are a pleasure to work with. And since modern GPUs are designed to work with triangles, people use triangles, so GPUs need to process triangles, and therefore they are designed to process only triangles.

As you say, triangles just have advantages that make them easy to use. GPUs can be made (and made) to render other primitives natively, but it's just not worth it. If you say a modern graphics processor for rendering an ATV, it breaks it into two triangles and displays them.

Not because there is a technical reason why the GPU cannot display the squares initially, but because it is not worth spending transistors. It is much more useful to focus the GPU on triangles as quickly as possible, and then simply emulate other primitives if needed.

So, modern GPUs have hardware limitations, so they do not work with quadrants, for example, but not because it is impossible to create a graphics processor that works with ATVs. That would be less efficient. :)

As for the "avoidance of triangles", I’m sure that basically what the fragment shader does is: it fills one pixel. The GPU simply runs it several million times in parallel to fill the entire screen. You could draw two large triangles that form a square that fills the entire screen, and then simply specify a fragmented shader that fills it with the content that you like.

If you want more control over the process, do it in software, and then: paint one pixel at a time on the surface of the memory, and then load it as a texture onto the GPU. But this is slow. :)

+14
source

As far as I know, every modern CAN-rendering, four-legged and some even N-corners, but comparing the rendering time of a quadrant with two triangles shows the advantage of a triangle. This is mainly due to the fact that the GPU is optimized for rendering triangles and that auxiliary equipment has more “steam processors” (for triangles) than others, for example, textures. Some other types of processors on the GPU can display squares directly, but usually you can find a thousand pairs for several texture processors. Please note that getting a texture unit to render an ATV is extremely difficult. This is possible in theory, but no one used pricip for a serious case.

If you are not working with very tight hardware operation, the software will take care of the triangles (e.g. Auto-Convert from from quads)

-2
source

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


All Articles