Sign in to follow this  

Optimize drawing

This topic is 4561 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 am making a 3D Pool Game. I have made the physics rules, the game rules and I have the computer playing against its self. The balls are simple spheres with textures on them. And I need to draw the table. I downloaded a table model, an x file. But when I draw the table model the game runs very slow. What can I do to speed up drawing? I have an ATI Rage AGP Video Card with 8 MB. I create the 3D device like this: HRESULT hr; D3DDISPLAYMODE DisplayMode; p_pDirect3DObject->EnumAdapterModes ( D3DADAPTER_DEFAULT, 0, &DisplayMode ); DisplayMode.Width = 640; DisplayMode.Height = 480; hr= p_pDirect3DObject->CheckDeviceType( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, DisplayMode.Format, DisplayMode.Format, FALSE); ZeroMemory( &m_thePresentParams, sizeof(m_thePresentParams) ); m_thePresentParams.Windowed = FALSE; m_thePresentParams.BackBufferCount = 0; m_thePresentParams.MultiSampleType = D3DMULTISAMPLE_NONE; m_thePresentParams.SwapEffect = D3DSWAPEFFECT_COPY; m_thePresentParams.EnableAutoDepthStencil = TRUE; m_thePresentParams.AutoDepthStencilFormat = D3DFMT_D16; m_thePresentParams.hDeviceWindow = p_hWndTarget; m_thePresentParams.BackBufferWidth = DisplayMode.Width; m_thePresentParams.BackBufferHeight = DisplayMode.Height; m_thePresentParams.BackBufferFormat = DisplayMode.Format; hr = p_pDirect3DObject->CreateDevice( D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, p_hWndTarget, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &m_thePresentParams, &m_p3DDevice );

Share this post


Link to post
Share on other sites
i agree, try the hardware vertex processing and dont specify the back buffer count.
and how are you refering the drawing is slow? are you refering it to a FPS count u r doing?
i think the ATI 8 MB vga can do alot better than that, i had S3 8MB on my laptop and i played vice city on it, but it was slow.

Share this post


Link to post
Share on other sites
1) Specifying the number of backbuffers to 0, is the same as 1. Read the documentation, please.

2) A swap effect of COPY is slower than DISCARD. Use D3DSWAPEFFECT_DISCARD instead.

3) Given that you're not running in windowed mode, there's no need to set your backbuffer format to that of the desktop. You can specify another one if you want.

4) Look in the debug output for hints about why you're getting bad performance.

5) Make a release build of your game, switch to the retail runtime and run your application and see what happens.

6) How many polygons are there in your table model?

Share this post


Link to post
Share on other sites
Thanks to all for their replies.
I know my video card can do more than that. I tried to use hardware vertex processing but the CreateDevice failed.
Before inserting the table model I was compiling to release version. But I don't know how to change to DirectX retail version, I hope the solution is not reinstalling SDK. I will check it out when I get home where I have the project.
I will also check the swap effect and the backbuffer format.
I don't know how many polygones the table model contains. I just downloaded it. I will have to check that too. Or maybe I should make my own.
Thanks again.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ratmil
I know my video card can do more than that. I tried to use hardware vertex processing but the CreateDevice failed.

The ATi Rage doesn't support hardware vertex processing (Hardware TnL).

Quote:
Before inserting the table model I was compiling to release version. But I don't know how to change to DirectX retail version, I hope the solution is not reinstalling SDK. I will check it out when I get home where I have the project.

You can change the runtime used from the DirectX control panel. Check NeXe: Debugging, it shows how to do it with screenshots.

Quote:
I don't know how many polygones the table model contains. I just downloaded it. I will have to check that too. Or maybe I should make my own.

When artists don't work with polygon limits in mind, they tend to make high-poly models, so this could be your problem.

Share this post


Link to post
Share on other sites

This topic is 4561 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this