Strangely missing 3D

Started by
9 comments, last by Cuculain 20 years, 10 months ago
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...
Advertisement
are you sure that the meshes files are available?
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.
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

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

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.

No no no no! :)
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.
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.
Are your textures loaded? Sometimes missing textures will cause the object to appear black.
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); 

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.
[sub]My spoon is too big.[/sub]

This topic is closed to new replies.

Advertisement