Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: Scene Triangle Count Problem  (Read 1294 times)
harikumar001
Customers
Community Member
*****
Posts: 65


« on: October 08, 2010, 10:45:01 AM »

Hey Guys,

Been testing my application and found a new problem.

Of late I had experienced a serious drop in performance due to huge triangle count of my meshes. I used several techniques like bump mapping, removing unnecessary details etc. And my mesh triangle count has come down to 30% of its original count.

Looking to optimize my application even more I decided to keep a watch on the triangle count of the scene. So I did the following:

1. I setup a room with 4 walls, a roof and floor.
=> Scene Triangle Count (Scene.GetTriangleNumber): 100

2. I add a new mesh which has 464 Triangles and after a while:
=> Scene Triangle Count jumps to 2884(100+6*464) instead of the expected 564 (100+464)

The results after some testing show that the scene triangle count increases 6 times the actual mesh triangle count after I add a single mesh to the scene. The same applies for deletion. After I call mesh.Destroy() 6x actual mesh triangles are reduced from total scene triangles.

FYI, every mesh I add only has one Scene.CreateMeshBuilder("meshname") call. But I do copy meshes to temporary TVMesh variables for calculation. But does that add it to the scene?
Need your input guys.

There are some functions like
TVMesh colMesh = collisionresult.getCollisionMesh() which I believe gets a copy of the mesh. Is that the problem? Your suggestions are important

Regards


Logged
harikumar001
Customers
Community Member
*****
Posts: 65


« Reply #1 on: October 08, 2010, 11:48:52 PM »

Hey guys, been working on the scene triangle count problem and found some interesting results. I started off with a fresh project for testing:

I started the application with no meshes:
Scene Triangle Count: 0

I create a TVMesh called Temp and add a wall using AddWall function
Mesh Triangles: 2
Scene Triangles: 4
(I searched the forum and some others are also getting similar results, i mean double the triangle count, so i believe this is fine)

To the same variable Temp I make another AddWall call to add a new wall
Mesh Triangles: 4
Scene Triangles: 12

I add another wall
Mesh Triangles: 6
Scene Triangles: 24

And another wall:
Mesh Triangle: 8
Scene Triangle: 40

So now total 4 walls, mesh triangles: 8, scene triangle:40


I start all over again and create two mesh variables TEMP and TEMP2
To Temp I add two walls
To Temp2 I add two walls also, so that I have 4 walls like before but separated into 2 meshes
Now I get 4 walls, mesh triangle : 4+4=8, scene triangle:16

I do not know where the problem occurs. But hope it does not affect my application performance in any way. Just concerned.

regards

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks