Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Normal mapping pixelates textures

  1. #1
    Junior Member Newbie
    Join Date
    Nov 2018
    Posts
    11

    Normal mapping pixelates textures

    After implementing normal mapping I'm seeing a pixellation in my textures. I'm trying to understand how to fix this.

    Texture loading options:

    Code :
            glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
    	glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);

    Without normal mapping
    Click image for larger version. 

Name:	no-mapping-no-pixelated.jpg 
Views:	22 
Size:	15.3 KB 
ID:	2887

    With normal mapping
    Click image for larger version. 

Name:	pixelated.jpg 
Views:	25 
Size:	19.2 KB 
ID:	2888

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,006
    Quote Originally Posted by mccloud35 View Post
    After implementing normal mapping I'm seeing a pixellation in my textures. I'm trying to understand how to fix this.
    It's hard to say without having any details about how normal mapping is implemented.

    What texture filters are you using on the normal map? If you're using GL_NEAREST, then the pixel boundaries in the normal map will show up in the lighting. If you're using a linear filter, are you normalising the values obtained from sampling the normal map? The result of linear interpolation between unit-length vectors typically doesn't have unit length.

  3. #3
    Junior Member Newbie
    Join Date
    Nov 2018
    Posts
    11
    I'm using the above mentioned texture parameters. So GL_LINEAR is the filture I'm using. I tried normalizing after reading from the normal map, but to no effect. After reading up I see something about sRGB could be the reason?

    I'm doing normal mapping in a standard way. Computing the tangents, bitangents, and then uploading them and forming the TBN matrix. Then sampling from the normal texture, and converting it to TBN space. It overall looks correct. It's just the pixellation that's the issue.

Tags for this Thread

Posting Permissions

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