• Advertisement
Sign in to follow this  

skybox edges are visible

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

Hello, i'm making a terrain viewer. results are ok except that i have a problem with the skybox : its edges are visible. does anyone has already had this problem ? picture is at : http://eldeann7.chez.tiscali.fr/error_skybox.htm the skybox edge is visible on the reflection on the water. thanks Eldeann

Share this post


Link to post
Share on other sites
Advertisement
This problem is sometimes due to using the wrong sampler state. If you're using D3D try setting the sampler states ADDRESSU = CLAMP and ADDRESSV = CLAMP - the default is wrap which means pixels at the edge can filter with pixels from the other side of the texture. Using clamp stops that happening. I don't know what the equivalent setting for OpenGL is but there is probably something similar.

Another option is to render your skybox with a cubemap - that has the advantage that you don't have to change textures to render the six faces. If you want to get really clever you can use a cubemap to draw your 'skybox' with a single full screen quad and no texture changes.

Share this post


Link to post
Share on other sites
if your under opengl look up GL_CLAMP and GL_CLAMP_TO_EDGE which have been availible since opengl 1.1.

Share this post


Link to post
Share on other sites
i've been away last few days that's why i didn't answer you,
but thanks much, i'll try your solutions

Share this post


Link to post
Share on other sites
i did as you said (for direct3d), and that works perfectly :

pDevice->SetSamplerState( 0, D3DSAMP_ADDRESSU , D3DTADDRESS_CLAMP );
pDevice->SetSamplerState( 0, D3DSAMP_ADDRESSV , D3DTADDRESS_CLAMP );


thanks much, and about the cubemap, i prefer to pay attention to performance for the terrain rendering, it's my big bottleneck yet.

Share this post


Link to post
Share on other sites
try to set the texture coords such that they address the mid of the pixels rather than one edge.

like if you have a 256x256 texture,
the right upper coorner of the texture would be (255.0/256.0, 255.0 + 255.0/256.0) instead of (0.0,1.0)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you're right, setting the sampler states to D3DTADDRESS_CLAMP is not enough, it's better, but edges are still a bit visible.
i set the coordinates to ( 0.002 , 1.0-0.002) instead of ( 0.0,1.0) and that's much better

Share this post


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

  • Advertisement