Sign in to follow this  

Strange blue dots on small textures with glTexImage3D

This topic is 4397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I noticed some strange blue pixels on the edges of terrain and at a far, so I assumed that there was a bug in my mipmap generation code. I turned off mipmapping and loaded each mipmap level into the texture looking for a problem, and strangely enough at level 5 there was a big blue dot on the texture. I spent a while looking for the bug and finding nothing I just put in a 'memset(data,0,bytes)' call in. All the lower levels turned black, but level 5 continued to have a blue dot on it (but with black everywhere else). I spent a while wondering what was going on and out of desperation I created a buffer of size bytes*2 (where bytes is the right size of bytes per pixel * width * height * depth) and set it to 0, then passed a pointer to that to glTexImage3D, and strangely enough I got all black. I'm somewhat confounded as to what's going on here, perhaps it has something to do with the fact that level 5 is 2x2x1; however I found nothing in the documentation about a minimum that that is below. The value of bytes is 12, the format is GL_RGB, type is GL_UNSIGNED_BYTE. Here is a picture of what's going on: Sorry to post so often, I spend at least a half hour (and often longer) messing with things before I post. Thanks, ~SPH EDIT: Interestingly if I create a buffer twice as large, set it to 0, then copy the correct image in at the beginning then I get this (only one tile drawn so that the pattern is clearer): [Edited by - ShmeeBegek on November 27, 2005 3:20:31 PM]

Share this post


Link to post
Share on other sites
mipmaps must go down to 1x1x1
how are u generating the mipmaps
* yourself
* glubuildmipmaps
* SGIS_GENERATE_MIPMAP (+ arb func)

i wouldnt recommend glubuldmipmaps (slow + also im not sure about its reliabilty with 3d data, does it even work?)

Share this post


Link to post
Share on other sites
I'm building them myself as I said, but right now I'm just setting it to 0 (as the memset call above shows). Also I said that I don't have mipmapping enabled so it shouldn't matter, right now I'm just having an issue with glTexImage3D.

Thanks, ~SPH

Share this post


Link to post
Share on other sites
I had a similar problem applying a texture to my terrain, whereby I would get some odd coloured pixels along one edge. For me it turned out to be a problem of not setting GL_CLAMP_TO_EDGE for the procedural texture I was generating, and I was getting a slight wrap around effect.

F451

Share this post


Link to post
Share on other sites

This topic is 4397 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this