• Advertisement
Sign in to follow this  

How to deal with mipmaps on the mirrored mesh?

This topic is 1599 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

Hi~Recently I downloaded some skined meshes for my demo,some of them were mirrored and just have a half of contents in the texture(since the UV in mesh were also mirrored). Then I found a problem that when the mip level increases,a black line appears in the middle of mesh.Is it because the GPU  samples some background color in the border of the actual image content when  I sample the smaller mipmap? How can I sovle this problem ? Do I need to make some bias or clamp the mip level ?

Edited by dragon.R

Share this post


Link to post
Share on other sites
Advertisement

maybe you've set the wrong wrapping mode, try GL_CLAMP_TO_EDGE.

 

or your texture has already some dark pixels? in that case you'd need to use a 'dilate' filter to fill all the empty area in your texture. you might not see those pixels if the best mip level is used, but those pixels bleed into really used pixel the further you go down the mip chain (in the end, there is just 1 pixel that is average of the whole texture, not the _really_used_texture_).

Share this post


Link to post
Share on other sites

maybe you've set the wrong wrapping mode, try GL_CLAMP_TO_EDGE.

 

or your texture has already some dark pixels? in that case you'd need to use a 'dilate' filter to fill all the empty area in your texture. you might not see those pixels if the best mip level is used, but those pixels bleed into really used pixel the further you go down the mip chain (in the end, there is just 1 pixel that is average of the whole texture, not the _really_used_texture_).

 

Yes,the texture have a background color of black. What is the 'dilate' filter ? Can I use this in D3D9 ? Thank you~

Share this post


Link to post
Share on other sites

 

maybe you've set the wrong wrapping mode, try GL_CLAMP_TO_EDGE.

 

or your texture has already some dark pixels? in that case you'd need to use a 'dilate' filter to fill all the empty area in your texture. you might not see those pixels if the best mip level is used, but those pixels bleed into really used pixel the further you go down the mip chain (in the end, there is just 1 pixel that is average of the whole texture, not the _really_used_texture_).

 

Yes,the texture have a background color of black. What is the 'dilate' filter ? Can I use this in D3D9 ? Thank you~

 

simply said: for every 'background' pixel search the closest non-background pixel and use that color instead. that's done when you generate the mipmaps. for testing you could e.g. in photoshop select all black areas, apply a blur filter repeatedly until no background color is visible anymore.

Share this post


Link to post
Share on other sites

 

 

maybe you've set the wrong wrapping mode, try GL_CLAMP_TO_EDGE.

 

or your texture has already some dark pixels? in that case you'd need to use a 'dilate' filter to fill all the empty area in your texture. you might not see those pixels if the best mip level is used, but those pixels bleed into really used pixel the further you go down the mip chain (in the end, there is just 1 pixel that is average of the whole texture, not the _really_used_texture_).

 

Yes,the texture have a background color of black. What is the 'dilate' filter ? Can I use this in D3D9 ? Thank you~

 

simply said: for every 'background' pixel search the closest non-background pixel and use that color instead. that's done when you generate the mipmaps. for testing you could e.g. in photoshop select all black areas, apply a blur filter repeatedly until no background color is visible anymore.

 

Thanks~I will try it.

Share this post


Link to post
Share on other sites

there is a certain logic to when bilinear , or any, filtering founds itself needing a pixel out of bound. It does travel to oposite wrap, would there be a seam? the wraped pixel is fetched, for that is a pixel realy appearing in case of tilling, and, the tilling is reason for this dilema encounter anyway.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement