Lots of trees

Started by
28 comments, last by bsekerci 20 years, 6 months ago
Maybe I''m just too drunk to really understand the problem but the trees in your shot seems to be very detailed so I will assume that one tree is 15k gons.

Even if your 4000 trees are using the same VB again and agin, there are still some TnL to do each time you draw a tree.

You are transforming 4000*15000*3 vertices on each frame (assuming you are using a tri-list). 180,000,000 TnL operations. Whouch.

That sounds enormous.

--
Emmanuel
Advertisement
i still believe to have read something about 12 polys per tree, so billboarding might help but not make that much of a difference.

but if i get that right youre drawing thousands of small objects one by one. i dont know d3ds overhead for drawing calls but you should really try and group them together. at least for a test place all trees in one big buffer and draw them with just one call.
f@dzhttp://festini.device-zero.de
Hi,

I want to answer VladR''s questions;

1. I am using two kind of culling. LOD and frustum culling. Database is a "Bounding Volume Hierarchy".
There are group, LOD(derived from group), geometry,... nodes. Every node in the tree has bounding boxes.
Every node renders itself. For example LOD node checks camera position, if the distance is inside of range it renders children.
Also every group node checks frustum culling, if bounding boxes are inside of frustum, it renders children.

2. chunk?
3. My geometry is indexed triangle list.
4. In this part of terrain thera are 5 texture.
5. I am not locking/unlocking every frame.
6. The size of FVF is 36. Does it make a big difference between 24 and 36?
7. I don''t sort terrain. I am rendering according to database hierarchy.


I created one vertex buffer per database. It didn''t help. I am creating vertex buffers using D3DPOOL_MANAGED. I think they stay in video card memory.

One tree has only 12 polygons. The detail comes from texture.

Thank you for helping me.

Bsekerci.
What do you mean, per database? Ideally you would have one vertex buffer per texture, or maybe a few per texture. 5 textures should require at most 20 vertex buffers total, if the vertex count is really high.

~CGameProgrammer( );

-- Post screenshots of your projects. 100+ posts already in the archives.
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Normally, I hold geometries in GeometryNodes. Every GeometryNode has one vertex/index buffer and one texture.

I tried to create one vertex buffer per database. So, GeometryNodes have no vertex buffer just index buffer.
I used the SetStreamSource command once every frame.

It didn''t change FPS.
Are you rendering all of your trees in one batch? I know there is a glitch in my ATI driver that rendering past a certain number of vertices at a time completely kills things.
____________________________________________________________AAAAA: American Association Against Adobe AcrobatYou know you hate PDFs...
I don''t render all trees in one batch.
Actually I don''t use this technique anymore. But I can enable.

When using one vertex buffer for all geometries, I am using this command for every tree;

DrawIndexedPrimitive( PrimitiveType, BaseVertexIndex,
MinIndex, NumVertices, 0, NumberOfPrimitives);

In here, vertex number is limited with "NumVertices";



What parameters do you use in the call that creates the vertex buffers? It should be D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC, created in the D3DPOOL_DEFAULT memory pool. EDIT: Why don't you release a quick demo for us? Then we can get a better idea of what it's doing. Or, showing a screenshot in wireframe mode should do the trick as well.

~CGameProgrammer( );

-- Post screenshots of your projects. 100+ posts already in the archives.

[edited by - CGameProgrammer on October 10, 2003 8:07:50 AM]
~CGameProgrammer( );Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
Question:

what dimension is your tree texture? If it is something like > 32x32, look there. (for your purpose 32x32 should suffice, and >=512x512 on that card will cause a HUGE performance hit)

super genius
Doing draw calls is expensive in D3D. You need to make fewer drawindexedprimitive calls, right now youre probably horribly CPU bound. Try drawing as many pokygons as your current trees but with a single draw call and see if you get better performance.

This topic is closed to new replies.

Advertisement