performance problem of the vertex buffer

Win32 Programming

    Next

  • 1. Major problem...
    Anyone ever hear of this here happening... ANY of my directx applications freeze the computer... be it my own stuff..samples..dx diag when testing Direct3D (dx8 and above, dx7 works fine).... I went as far as wiping the OS and reinstalling everything from scratch.... any ideas anyone? Thanks, Stephan
  • 2. Rendertarget problem
    Well after a lot of cursing, crashes, whatnot. Got the render target situation I had asked about earlier resolved, and even got things running on the other machine. Didn't realize my depth buffer had to be larger than the render target (even if I'm not even using one for the new render target, using transformed coords). Everything is working flawlessly here on my system too. On the other system however, my artists system, things aren't quite as fortunate. While things no longer crash...the sky texture retains garbage data...stuff that shouldn't be on it. Here's what I do.. Backup z-buffer Backup render target Set new z-buffer previously created for new target Set new target (my texture) Clear it...(which normally I shouldn't need to do as the quads take up the entire area). Render my quads to it..transformed verts. Switch back to my old zbuffer switch back to my old rendering target Done. Works great over here... Does not work great on the other system. I check all calls against failure. Check all pointers created against NULL. Everything passes, no failures. Anyone have any idea why it may be working here...but not there? Stephan
  • 3. .3ds to .x exporter
    I've tried both the Panda exporter plugin and the converter that comes in the Extras folder of the DX SDK. Both export my "model" just fine, however the texture coords never go. The microsoft converter does it's thing without reporting any errors, yet still no textures. Panda seg faults 3D Studio Max everytime I try to export. It writes the .x file even though it crashes, but without the texture coords. My models are always rendered black when the texture is present in the proper directory. If I take away the textures the models are then rendered white. Anyone else come across this problem? My guess is that I've got something set wrong on my models in 3D Studio Max (using 5.0). What am I doing wrong in 3D max that these exporters won't work properly?
  • 4. Checking for D3DUSAGE_RENDERTARGET
    How can I check for the above capability? I am using a rendertarget texture to create my texture for my skydome. Works beautifully. However, this seems to utterly fail on my artists machine, who has a mothboard w/ one of those built in vid cards, that can't even do hardware processing. Not only do things fail, I cannot even check the hResults because the calls fail so bad, the app crashes before I ever even get a hresult returned!! I checked the devicecaps to see if I can test ahead of time for the ability to use rendertarget textures, but I don't see anything in the devicecaps that would tell me. Nothing that stands out to me anyway.. Some help would be greatly appreciated. :) Stephan

performance problem of the vertex buffer

Postby newbie » Fri, 19 Dec 2003 21:37:30 GMT

I have a vertex buffer of about 4000 vertices and also a index buffer of
8000 indices. The problem: when I render all these vertices I got a very
poor performance, 1 or 2 frame per sec. But the cpu usage is only 4%. I
don't know why.

The vertex buffer and index buffer were created with D3DPOOL_MANAGED. I
tried D3DPOOL_SYSTEMMEM, but no improvement.

thanks.



Re: performance problem of the vertex buffer

Postby Julien CELLE » Sat, 20 Dec 2003 01:16:53 GMT

You should post some code, that would help ...

"newbie" < XXXX@XXXXX.COM > a rit dans le message de





Re: performance problem of the vertex buffer

Postby Julien CELLE » Sat, 20 Dec 2003 01:17:45 GMT

You should post some code and your config.
That would help...

"newbie" < XXXX@XXXXX.COM > a rit dans le message de





Re: performance problem of the vertex buffer

Postby newbie » Sat, 20 Dec 2003 14:20:58 GMT

The large vertex buffer was generated once and rendered 
multiple times. The following is the rendering code.

In face, I render the large vertex buffer I mentions to a 
texture. So the following code is before the BeginScene
()/EndScene() pair. If I delete the line of 
DrawIndexedPrimitives() in the following code, the frame 
rate will be normal, so I think the bottle-neck is 
between the followings lines.

m_pRefVB and m_pRefIB is the large vertex buffer and 
index buffer I mentioned.
m_renderprocess is variable, which encapsulates the 
routine of rendering to any surface.(I do not use 
ID3DXRenderToSurface, because I find it can use 
multisample type).

The vertex buffer has the D3DFVF_XYZRHW set, with which I 
want to bypass the vertex processing and pass my data 
directly to the pixel shader.

Thanks a lot!
/////////////////////////////////////////////////////////
D3DVERTEXBUFFER_DESC desc;
	m_pRefVB->GetDesc(&desc);
	UINT numVertex=desc.Size/sizeof(TMeshFVF);

	D3DINDEXBUFFER_DESC indexdesc;
	m_pRefIB->GetDesc(&indexdesc);
	UINT numIndices=indexdesc.Size/2;

	IDirect3DSurface9* pSurface;
	m_pShadowTexture->GetSurfaceLevel(0, &pSurface);
	D3DVIEWPORT9 vp;
	vp.Width=(DWORD)((m_rtWnd.right-
m_rtWnd.left)/2.0f);
	vp.Height=(DWORD)((m_rtWnd.bottom-
m_rtWnd.top)/2.0f);
	vp.MinZ=0.0f;
	vp.MaxZ=1.0f;
	vp.X=vp.Y=0;
	m_renderprocess.EnableMultiSample
(FALSE,D3DMULTISAMPLE_NONE,0);
	m_renderprocess.BeginRender(pSurface, vp);
	m_pD3DDev9->Clear(0, NULL, 
D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB
(255,255,255), 1.0f, 0);

	m_pEffect->SetTechnique("ObjApproximate");
	m_pEffect->SetFloatArray("vLightPos", 
&m_sceneInfo.lightx, 3);
	m_pEffect->SetFloat("sLightRange", 
m_sceneInfo.lightrange);

	UINT numPass;
	m_pEffect->Begin(&numPass, 0);
	m_pEffect->Pass(4);
	m_pD3DDev9->SetFVF(SHADOWMAPFVF);
	m_pD3DDev9->SetStreamSource(0, m_pRefVB, 0, sizeof
(TMeshFVF));
	m_pD3DDev9->SetIndices(m_pRefIB);
	HRESULT hr=m_pD3DDev9->DrawIndexedPrimitive
(D3DPT_TRIANGLELIST, 0,  0, numVertex, 0, numIndices/3);
	m_pEffect->End();

	m_renderprocess.EndRender();
	pSurface->Release();

/////////////////////////////////////////////////////////



Re: performance problem of the vertex buffer

Postby Phil Taylor » Sat, 20 Dec 2003 15:28:43 GMT

what does the nvidia sample BenMark do on this machine?








Similar Threads:

1.Changing vertex color after vertex buffer and index buffer definition

Hi,

Say you have this custom vertex structure:

struct CUSTOMVERTEX
{
	float x, y, z;
	DWORD color;
};

Is it possible once you've defined values for a vertex 
buffer using that structure to subsequently change the 
color for a vertex that you defined? If so, how?

Thanks :)

2.Static vertex buffer performance

Hi,

I just bought a GeForce FX 5950 Ultra.  It seems to lock static
vertex/index buffers about 20 times slower than my Radeon 9700 Pro. 
This is seriously, hampering performance, since putting my large model
into static buffers now takes ages.

Any ideas? This can't be right. Otherwise the benchmark results would
(surely?) indicate this. (It's about 25% faster than my old radeon).

Regards,
Shaun

3.double buffering performance problems

On Sat, 19 Jul 2003 14:00:58 GMT, fungus < XXXX@XXXXX.COM > wrote:

>> glutInitDisplayMode(GL_DOUBLE | GLUT_RGB | GLUT_DEPTH);
> Should that be           GLUT_DOUBLE
yes

Florian

4.Problem cleaning up after using vertex buffer.

Ok.. so I tried to take my first step to create a 3D object with VertexBuffers but I have a problem cleaning up. For some reason, after I do CreateVertexBuffer call and I try to exit the application, it keeps saying "reference count for D3D object is non-null". I am releasing the vertex buffer before I exit the application, and I'm using D3DPOOL_MANAGED for vertex buffer. 
Am I missing an important step here? Tutorial doesn't really have any special clean up either but it works fine for tutorials and samples. If anyone can give me few pointers or things to watch out for, I would appreciate it. Or if anyone can tell me what I"m doing wrong, that would even be better. ^^; Thanks. 

5.Vertex buffer problems

6. Vertex Buffer Object problem

7. Vertex Buffer Objects Problem

8. vertex buffer, index buffer



Return to Win32 Programming

 

Who is online

Users browsing this forum: No registered users and 58 guest