Sky box

Started by
3 comments, last by FantasyGuy 22 years, 4 months ago
I have added a sky box to my scene. Everything was fine except for the edges of the box that I can still see. I checked the original bitmap images of the sky box and I didn''t see anything wrong with it. I still don''t know what''s the cause of the problem. The lighting is turned off. The skybox was loaded from an x file which I have taken from one of the samples of DX8 SDK. What made me baffled is that I found that the same problem exist in Unreal Tournament. Couldn''t they solve this problem? My VGA card is a TNT II with 32MB of VRAM. I''ll be grateful if anyone helps me solving this.
Advertisement
add the following code before render the skybox and see it this hleps.

m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_MIRROR );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_MIRROR );

best wishes
Edidas
I''m assuming you have linear filtering enabled or something like that right?

If so, then do this before rendering the skybox:

m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP );
m_pd3dDevice->SetTextureStageState( 0, D3DTSS_ADDRESSV, D3DTADDRESS_CLAMP );

Even though your tex. coords may be in range (0-1) when the filtering happens it may be looking slightly past 1 and getting a dark value and blending it for the final pixel. Just clamp it.
Then it will take the value at 1 instead...

ao



If neither of those work I have a piece of code that will fix it. I am a bit busy at the moment, so I don''t have the time to post it unless you need it (I don''t have the internet on the computer that has my programming stuff on).

Moe''s site
You''re right, linear filtering is enabled. Your piece of code worked perfectly. Thanks a lot.

This topic is closed to new replies.

Advertisement