Gl_FragColor = texture2D(texture, texCoord) ![]() Gl_Position = modelViewProjectionMatrix * position How can I make the texture draw correctly? The PERSPECTIVE CORRECTION HINT is not supported because OpenGLĮS 2.0 requires that all attributes be perspectively interpolated. Update: The previous statement is incorrect, according to comment by user infact.įurthermore, I have found this tidbit in the ES 2.0 spec, but do not understand what it means: My code includes some simple Model/View/Projection matrix math, but none of it currently influences my texture coordinate values. I have come to understand that I need to perform "perspective correction," presumably in my vertex and/or fragment shaders, but I am unclear how to do this. It's being drawn completely facing the screen, and is not being tilted (i.e. The trapezoid is being drawn using GL_TRIANGLE_STRIP in OpenGL ES 2.0 (on an iPhone). (Note: the last image is not intended to be a 100% faithful representation, but it should get the point across.) This illustration demonstrates the issue: ![]() ![]() ![]() Instead of appearing as a single unbroken quadrilateral, a discontinuity occurs at the diagonal line where its two comprising triangles meet. I have drawn a textured trapezoid, however the result does not appear as I had intended.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |