Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    3
  • comments
    4
  • views
    3659

About this blog

[]

Entries in this blog

 

From: 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:


(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

Maciekp

Maciekp

 

From: 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:


(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

Maciekp

Maciekp

Sign in to follow this  
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!