I'm trying to create a skybox using a cube and using one of this textures: http://forum.unity3d.com/threads/mundus-skybox-pack-01-released.202748/

I've got it working well, but I noticed there are some bugs on the edges of the cube, as it can be seen here: enter image description here

I found that this could be fixed using clamping, so I set D3DSAMP_ADDRESSU and D3DSAMP_ADDRESSV to D3DTADDRESS_CLAMP. This, however, produced the following result: enter image description here

Half of the cube wasn't being shown and the other half was only showing a one-pixel wide texture region. I saw this similar question (which uses wrapping though), but I'm already using 4 vertices per face. So, what could be causing this?


What are the texture coordinates that you're using for those vertices? With D3DTADDRESS_CLAMP, they must be in the [0;1] range, anything else will be clamped to [0;1]. So, for example, using the [-1;0] coordinate range could cause this as it would make all of them effectively 0.

| improve this answer | |
  • \$\begingroup\$ Thanks, that fixed it (I forgot I was flipping the V coordinate xD). But to remove the seams completely, I had to extend all squares some more pixels, so the UVs didn't touch the border directly. \$\endgroup\$ – eric.m Dec 6 '15 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.