• Advertisement
Sign in to follow this  

3D (DX9) Problem Octree with a Big Static Mesh - Urgent Help

Recommended Posts

Hey, Im trying to use this Octree sample from Davig Ang https://www.programmingmind.com/demo/basic-octree

What happens its that works perfectly with small meshes or medium meshes, buuut, with a really big mesh, dont.

 

The mesh I want to use:

01a31144cb.png

What happens on Octree App:

32b881d7e1.png

 

As I said, this happens ONLY with BIG MESHES, small meshes like on the sample all works good. I already tried to change the #defines, because its a big mesh, but nothing works.

Thanks for help.

Share this post


Link to post
Share on other sites
Advertisement
15 minutes ago, Infinisearch said:

Did you change the GPU code to upload and use 32bit indices too?

Ye..

D3DFMT_INDEX32

mGroups.numFaces * 3 * sizeof(UINT);

UINT *indices;

Share this post


Link to post
Share on other sites

I deleted most of the map objects, to turn it into a small mesh, but I got the same problem lol.

4798505ad9.png

 

With this mesh (example), all works good.

6217eb6061.png

 

@Loading the mesh out of this octree system, like DX mesh viewer, I can see normally

Edited by pristondev

Share this post


Link to post
Share on other sites

Probably the problem is here:

// Copy over all the faces and groups from the mesh			
	unsigned int *indices		= NULL;
	unsigned long  *attributes	= NULL;

	newMesh->LockIndexBuffer( D3DLOCK_READONLY, (void**)&indices );	
	newMesh->LockAttributeBuffer(D3DLOCK_READONLY, &attributes );

	for(DWORD i = 0; i < totalFaces; i++)
	{
		mFaces[i].v1 = *indices++; 
		mFaces[i].v2 = *indices++; 
		mFaces[i].v3 = *indices++;
		mFaces[i].group = attributes[i]; // Store the group (attribute) index - this is where the grouping happens

		mGroups[attributes[i]].numFaces++; // Keep count of the number of faces		
	}

	newMesh->UnlockIndexBuffer();
	newMesh->UnlockAttributeBuffer();

Im getting problem with mGroups on my meshes, so CreateIndexBuffer failed and crash the program. What I was doing before to run program, I was simply ignoring when mGroups.indexBuffer is null, but I think that its the problem.

 

Someone?

Share this post


Link to post
Share on other sites

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  

  • Advertisement