Jump to content
  • Advertisement
Sign in to follow this  
pristondev

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

This topic is 390 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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!