Jump to content

  • Log In with Google      Sign In   
  • Create Account

How to deal with mipmaps on the mirrored mesh?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 03 September 2013 - 10:56 PM

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, 04 September 2013 - 01:27 AM.


Sponsor:

#2 Krypt0n   Crossbones+   -  Reputation: 2685

Like
0Likes
Like

Posted 04 September 2013 - 04:19 AM

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_).



#3 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 04 September 2013 - 04:49 AM

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~



#4 Krypt0n   Crossbones+   -  Reputation: 2685

Like
1Likes
Like

Posted 04 September 2013 - 06:04 AM

 

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.



#5 dragon.R   Members   -  Reputation: 247

Like
0Likes
Like

Posted 04 September 2013 - 10:04 AM

 

 

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.



#6 JohnnyCode   Members   -  Reputation: 335

Like
0Likes
Like

Posted 05 September 2013 - 03:29 PM

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.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS