Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Cuculain

Strangely missing 3D

This topic is 5563 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 have a strange problem when executing my DX9 app on another computer. The 2D interface appears as normal and the logs indicate that everything has loaded just fine. But strangely no 3D meshes are rendered (or at least visible) on the screen of the other computers - it''s just black - altough it is still possible to pick the meshes with the mouse. I use a computer with GeForce 4 TI 4600 128 MB and the computers I''ve tried on also had DX9 and G4 TI 4200 64 MB and G2 Ultra 64 MB. Thankful for any ideas...

Share this post


Link to post
Share on other sites
Advertisement
Yes because I can select the models with 3d picking and also when they are not found the function D3DXLoadXFromFile gives the E_FAIL response, but I get S_OK.

Share this post


Link to post
Share on other sites
1. Set your clear colour to something other than black to check whether the meshes are''nt appearing at all or whether they''re just appearing in black.

2. If the meshes are appearing, but they appear in black, check your lighting setup, and check any pixel pipeline states (SetTextureStageState() etc). Doing something that isn''t supported in the hardware/driver you''re running on is a common cause for black meshes.

3. NEVER rely on the default values for render states etc - set them explicitly so you KNOW what they''re all set to, and that there isn''t anything unexpected like user clip planes being enabled.

--
Simon O''Connor
ex -Creative Asylum
Programmer &
Microsoft MVP

Share this post


Link to post
Share on other sites
I agree with Simon, check your lighting.



____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
Thanks for your replies. I removed the terrain from rendering and changed the clear color to white. The other objects then appeared as black in contrast. I guess there is something wrong with the lighting then, which is a bit disturbing because it works fine on my dev computer.

And I do init my light (directional) and turn it on.

Share this post


Link to post
Share on other sites
Also even with the light turned off there is still some ambient light in my scene on the dev computer. But on the others the meshes are pitch black.

Share this post


Link to post
Share on other sites
OK, now I have identified the root of this problem. Thanks to Simon for that

It seems that when using SetTextureStageState with index 2 (or higher probably) the results became strange. When using only stage 0 + 1 it works fine on the other machines, but I really need more than two stages.

The troublesome machine is using GeForce 4 440 GO if that has any impact.


m_pDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_SELECTARG1);
m_pDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TEXTURE);
m_pDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

m_pDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_MODULATE);
m_pDevice->SetTextureStageState(1, D3DTSS_COLORARG1, D3DTA_TEXTURE);
m_pDevice->SetTextureStageState(1, D3DTSS_COLORARG2, D3DTA_CURRENT);
m_pDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

m_pDevice->SetTextureStageState(2, D3DTSS_COLOROP, D3DTOP_ADD);
m_pDevice->SetTextureStageState(2, D3DTSS_COLORARG1, D3DTA_TEXTURE);
m_pDevice->SetTextureStageState(2, D3DTSS_COLORARG2, D3DTA_CURRENT);
m_pDevice->SetTextureStageState(2, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

m_pDevice->SetTextureStageState(3, D3DTSS_COLOROP, D3DTOP_DISABLE);
m_pDevice->SetTextureStageState(3, D3DTSS_ALPHAOP, D3DTOP_DISABLE);

Share this post


Link to post
Share on other sites
You need to check the caps for the number of texture stages available. Based on that you may have to do multipass rendering. That''s where the D3DX Effects framework comes in real handy.

I like pie.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!