Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Strange problem with textures

  1. #1
    Newbie Newbie
    Join Date
    Jan 2019

    Strange problem with textures


    I use openGl with Assimp and Qt libraries.

    When I import a 3D model, I get strange textures. The coordinates of UV textures are correct, but there is a perspective effect on the textures visible on the surfaces.

    This reminds me of the problem of the quadrilateral Interpolation

    Is this the case? How can I solve this texture application problem?

    With my thanks,


    Click image for larger version. 

Name:	Sans titre-10.jpg 
Views:	8 
Size:	95.8 KB 
ID:	2922

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Are you trying to map a rectangular region of texture to a non-rectangular surface? If you want a projective transformation, you'll need to provide 3- or 4-dimensional texture coordinates (if you're using fixed-function texturing, you need to use 4-dimensional coordinates, with the third coordinate ignored; if you're using a fragment shader, you only need 3 dimensions; either way, you have to supply the appropriate divisor). If you want a bilinear transformation, you'll have to write a shader to do that. It's much like a projective transformation, but only one of the texture coordinates is divided by the interpolated divisor.

    If both the texture region and the surface are rectangular, then the shaders are doing something odd like performing projective division in the vertex shader or declaring the texture coordinates with the noperspective qualifier.

  3. #3
    Newbie Newbie
    Join Date
    Jan 2019
    I found the solution to my problem ! It was necessary to apply the correction explained here:

    Thank you all!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts