![]() To get the usual normalized range across the visible viewport, we just need to make the corresponding texcoords for the vertices tiwce as big, and the barycentric interpolation will yield exactly the same results for any viewport pixel as when using a quad. We also do not need to worry about the texcoords. This needs to be used along with a Platform Binding (e.g. ![]() For a triangle to cover this area just completely, we need to have two sides to be twice as long as the viewport rectangle, so that the third side will cross the edge of the viewport, hence we can for example use the following coordiates (in counter-clockwise order): (-1,-1), (3,-1), (-1,3). dear imgui: Renderer for modern OpenGL with shaders / programmatic. In NDC (and also clip space, if we set w=1), the viewport will always be the square. For a triangle to cover the full screen, it needs to be bigger than the actual viewport. I'm going to argue that the most efficient approach will be in drawing a single "full-screen" triangle.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |