Page 2 of 2

Posted: Sun Apr 13, 2008 10:46 am
by sio2
This is the modification I used for 02.Quake3Map:

Code: Select all

	scene::IAnimatedMesh* animMesh = smgr->getMesh("20kdm2.bsp");
	scene::ISceneNode* node = 0;

	if (animMesh) {
		scene::IMesh *mesh = animMesh->getMesh(0);
		for (unsigned int i=0; i<mesh->getMeshBufferCount(); i++)
		{
			mesh->getMeshBuffer(i)->setHardwareMappingHint(scene::EHM_STATIC);
		}
		node = smgr->addMeshSceneNode(mesh);
	}
I'm getting 2850fps with DX9 on Vista. I'll test on XP when I get the chance.

Posted: Sun Apr 13, 2008 10:58 am
by sio2
Another issue is that the usage hint is for for both VB and IB's. Usually you'll want the VB to be static and the IB dynamic so you can dynamically update the indices.

Posted: Sun Apr 13, 2008 12:25 pm
by Nadro
I also tested 02.Quake3Map with similar modification to Sio2 modification in it (without OCT node only normal addMeshSceneNode, bacause speedup in OCT nodes is very low), I will apply Sio2 improvments to DirectX code and I will test it again on my Radeon 2600 Pro (Catalyst 8.3).

Posted: Sun Apr 13, 2008 12:45 pm
by BlindSide
Thanks for the tips Sio2, I'll try them out right away and update the patch accordingly.
Performance penalty could be severe.
That could certainly explain a few things. :P

Please note that I didn't write all the code for this, I mostly just merged raedwulf's implementation with Luke's interface.
Another issue is that the usage hint is for for both VB and IB's. Usually you'll want the VB to be static and the IB dynamic so you can dynamically update the indices.
Or the other way for terrain rendering or the likes. Unfortunately Irrlicht normally seeks to provide ease of use at the cost of customisability. I simply followed Luke's interface so I had no say in this matter. Looking at what we've got it would be a 5 minute change to implement this, allowing setHardwareMappingHint() to set flags for boths indices and vertices, and providing 2 other functions eg setVertexHardwareMappingHint to allow the user to set this more discreetly.

Offcourse this would be quite pointless if the changed id dirty method wasn't altered to support both index buffers and vertex buffers individually. Currently it will upload both regardless of what changed. (Although looking at CMeshBuffer.h now it seems that hybrid recently changed the function header for setDirty() to allow for the user to specify the type buffer in question, so something along these lines must already be in the works.)

Cheers

Posted: Sun Apr 13, 2008 8:20 pm
by Nadro
My Windows XP is dead:( I will reinstall winxp and test this new patch tomorrow:) I hope than this modification allow heigh speedup similar to OpenGL speedup:)

Posted: Mon Apr 14, 2008 5:08 pm
by Nadro
I repaired my WinXP and I tested this patch again with Sio2 modifications. With EHM_STATIC on my Radeon 2600 PRO works good:) SpeedUp is very good similar proportions to OpenGL SpeedUp. Good work:)

Posted: Mon Apr 14, 2008 7:08 pm
by sio2
I've submitted by fix to the patch tracker (includes original patch).

Posted: Tue Apr 15, 2008 3:16 am
by BlindSide
Thanks guys, I'm glad it works now.

Posted: Tue Apr 15, 2008 11:17 am
by MasterGod
Can you post a binary please for me to check too. Just for statistics :wink:

Posted: Tue Apr 15, 2008 12:15 pm
by Luke
sorry I haven't been active lately.

thanks BlindSide and sio2, for the dx vbo patch, I'll look into applying it.
(Although looking at CMeshBuffer.h now it seems that hybrid recently changed the function header for setDirty() to allow for the user to specify the type buffer in question, so something along these lines must already be in the works.)
Yep, I think that was me, yep it’s in the works, usage hint will be updated to.

Posted: Mon Apr 28, 2008 11:52 am
by christianclavet
Hi, Do you think OCCTREE's in DX will benefit from this in DX? As someone given a code example to use the VBO (It's now implemented in the last SVN)

Posted: Mon Apr 28, 2008 12:11 pm
by Raedwulf
Octrees are quite possible to be optimised using vbos.... however, i believe i struggled a little last time attempted to do that.
I modified the interface to support chosing between dynamic indices/static vertices etc...
and proceeded to modify irrlicht to use VBOs everywhere... but it got terribly messy and i was a bit unhappy with it :P.

Ill search for my code to see how far i got with it.