Jump to content
  • Advertisement
Sign in to follow this  
BornToCode

OpenGL Sky Box Edge Problem

This topic is 5107 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 am trying to figure out how to make the edge of the sky box dissapear. the problem that i am having is that as i rotate the sky box you can see the edge of the box showing up like a line or something which kills the illusion. i know how to remove it in OpenGl but how do you do so with Direct3D. Thanks in Advance for the help.

Share this post


Link to post
Share on other sites
Advertisement
set the sampler state to clamp :

m_pd3dDevice->SetSamplerState(i, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
m_pd3dDevice->SetSamplerState(i, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);

Share this post


Link to post
Share on other sites
You could specify that the texture addressing be clamped or wrapped. You might find edges due to the way direct3d handles the texture addressing. You could solve this by changing/modifying some sampler states as described below.
D3DTADDRESS_WRAP
Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.

D3DTADDRESS_CLAMP
Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.


Something like this should help

Device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
Device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);

//or
Device->SetSamplerState( 0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP );
Device->SetSamplerState( 0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP );


I hope this helps.
Take care.

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!