Archived

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

problem with XFile material and Slow simulation

This topic is 4954 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

hey there! I am facing a new problem of material ,when i render Xfile model which contained colourful material as well. It changes my whole background skybox with that material. how can i set material "none or NULL" for skybox? Second problem is, after loading Xfile and rendering it i am having so slow speed and it takes too much time to move camera from one place to other, how can i handle this situation Any ideas? Thanks in advance Regards

Share this post


Link to post
Share on other sites
DX C++ documentation: Tutorial 4 -> step 2:

D3DMATERIAL8 mtrl;
ZeroMemory( &mtrl, sizeof(D3DMATERIAL8) );
mtrl.Diffuse.r = mtrl.Ambient.r = 1.0f;
mtrl.Diffuse.g = mtrl.Ambient.g = 1.0f;
mtrl.Diffuse.b = mtrl.Ambient.b = 0.0f;
mtrl.Diffuse.a = mtrl.Ambient.a = 1.0f;
g_pd3dDevice->SetMaterial( &mtrl );

Share this post


Link to post
Share on other sites
quote:
Original post by farhanx
hey there!
I am facing a new problem of material ,when i render Xfile model which contained colourful material as well. It changes my whole background skybox with that material.
how can i set material "none or NULL" for skybox?


m_pd3dDevice->SetMaterial(NULL);
quote:

Second problem is, after loading Xfile and rendering it i am having so slow speed and it takes too much time to move camera from one place to other, how can i handle this situation Any ideas?


There could be many reasons for this. Perhaps your model is extremely large? Is your graphics card old? Are you loading your model into video or system memory?

neneboricua

Share this post


Link to post
Share on other sites
thanks for replies guys

m_pd3dDevice->SetMaterial(NULL); doesnt works and it immediately shutdown the programe . Instead of this i have used material and diffuse and change the a,r,g,b as 1.0f . so now its working, but still slow.

yes the model is a complex tree and its maybe form 0.0f to 150.0f times tall... yes i am loading it into D3DXMESH_SYSTEMMEM.
i changed it to D3DXMESH_MANAGED but still didnt work ,Shall i change it????

my Vedio card is Nividia Aladdin TNT2, and its not so old i guess but large terrain doesnt works and make my application so much slow that i even cant see any real graphics...

one more thing , i am not using any FPS .. is it necessary for speed???

Thanks again...

Share this post


Link to post
Share on other sites