• Advertisement
Sign in to follow this  
  • entries
    3
  • comments
    4
  • views
    3571

About this blog

[]

Entries in this blog

Hi,
I'm rendering texture with alpha channel in 3D space. I'm getting some bad quality of texture, as you can see on the right of picture:

gamedevnetcomp.png
(the left is original image in Windows viewer, right is screenshot from my app).
What can I do, to get exact image as original(or similar quality).
I'm loading image with QImage, then I initialize it in Opengl with following parameters(I've tried few combinations with no result):

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
gluBuild2DMipmaps(GL_TEXTURE_2D,(isAlpha?GL_RGBA:GL_RGB),width, height,(isAlpha?GL_RGBA:GL_RGB), GL_UNSIGNED_BYTE,data);

,and then draw with blend options as follows:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
.
For any help given, I'm giving away 3 sweet little cats( http://goo.gl/vJJZq ).
Thanks.

Source: Opengl texture quality
Hi,
I'm rendering texture with alpha channel in 3D space. I'm getting some bad quality of texture, as you can see on the right of picture:

gamedevnetcomp.png
(the left is original image in Windows viewer, right is screenshot from my app).
What can I do, to get exact image as original(or similar quality).
I'm loading image with QImage, then I initialize it in Opengl with following parameters(I've tried few combinations with no result):

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
gluBuild2DMipmaps(GL_TEXTURE_2D,(isAlpha?GL_RGBA:GL_RGB),width, height,(isAlpha?GL_RGBA:GL_RGB), GL_UNSIGNED_BYTE,data);

,and then draw with blend options as follows:

glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
.
For any help given, I'm giving away 3 sweet little cats( http://goo.gl/vJJZq ).
Thanks.

Source: Opengl texture quality
Sign in to follow this  
  • Advertisement