Jump to content
  • Advertisement
Sign in to follow this  
Temjin

Skybox - Software and Hardware Vertex Processing Problem

This topic is 4832 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 there, I am encountering a percurliar problem with implementing a skybox in my DirectX programs. If the program is running using software vertex processing then the render of the scene is fine, however, should the vertex processing be set to hardware, the rendered scene is completey corrupt with strange lines and no disernable shapes. I managed to narrow down the problem to the rendering of the skybox by simple elimination, once commented out (so the skybox doesn't render) the scene is fine in hardware mode. At first i tryed to elevate the problem by using the Skybox render function found in the DirectX billborad sample program (which uses a skybox and hardware vertex processing succesfully)....this was to no avail as the exact same problem persisted. The skybox itself is a .X file using JPG's as textures for the different sides and is loaded using CD3DMesh, and for the time being is the exact same .X file used by the billboard sample program. The contents of the function I am using is as follows : // Render the Skybox { // Center view matrix for skybox and disable zbuffer D3DXMATRIXA16 matView, matViewSave; m_pd3dDevice->GetTransform( D3DTS_VIEW, &matViewSave ); matView = matViewSave; matView._41 = 0.0f; matView._42 = -0.3f; matView._43 = 0.0f; m_pd3dDevice->SetTransform( D3DTS_VIEW, &matView ); m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, FALSE ); // Some cards do not disable writing to Z when // D3DRS_ZENABLE is FALSE. So do it explicitly m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); // Render the skybox m_pSkyBox->Render( m_pd3dDevice ); // Restore the render states m_pd3dDevice->SetTransform( D3DTS_VIEW, &matViewSave ); m_pd3dDevice->SetRenderState( D3DRS_ZENABLE, TRUE ); m_pd3dDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE); } As far as I am aware this should work fine, (using a SkyBox.X file, and having the above contents posistioned at the start of the main render function...as it seemingly does in the billboard example program) Can anyone suggest why I am experiencing such corruption in hardware mode, and provide a solution? Thanks, Pete

Share this post


Link to post
Share on other sites
Advertisement
Thanks Trip99 that indeed seems to be the reason!!! :)

Could you just do me one more favour and explain why this is the case? Also how would I explicitly set it NOT to use a pure device in the code (at the moment I am having to change the vertex processing in the dialogue menu in the app)

Thanks again, you've been a great help!

Pete

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!