[applied] Vertex cache optimization
[applied] Vertex cache optimization
I've implemented Forsyth's algorithm for optimizing a mesh for the vertex cache.
The Stanford dragon (smallest one/res4, converted to obj since the ply loader was buggy) gains 15% fps, while the q3 level included has no noticable change. Time taken was 22ms for the Q3 level and 47ms for the dragon.
I suppose the right place would be the mesh manipulator. However, it's some 500 lines, do you still want it in the same file?
I thought of "createForsythOptimizedMesh" for the function name, but better ideas are welcome, that's a bit long
The Stanford dragon (smallest one/res4, converted to obj since the ply loader was buggy) gains 15% fps, while the q3 level included has no noticable change. Time taken was 22ms for the Q3 level and 47ms for the dragon.
I suppose the right place would be the mesh manipulator. However, it's some 500 lines, do you still want it in the same file?
I thought of "createForsythOptimizedMesh" for the function name, but better ideas are welcome, that's a bit long
Last edited by hendu on Sat Jan 21, 2012 4:20 pm, edited 1 time in total.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: Vertex cache optimization
Yes, size is not much of a problem. It's defintely the correct place.
Re: Vertex cache optimization
Posted at
https://sourceforge.net/tracker/?func=d ... tid=540678
I noticed I wasn't packing the verts properly, fixing that slowed it down a bit, the dragon is now at 380ms. Well, it's a one-time event anyway.
https://sourceforge.net/tracker/?func=d ... tid=540678
I noticed I wasn't packing the verts properly, fixing that slowed it down a bit, the dragon is now at 380ms. Well, it's a one-time event anyway.
Re: Vertex cache optimization
Nice work! nonetheless
Re: Vertex cache optimization
Please share the numbers if you do a test.
Re: Vertex cache optimization
I optimized the search with the RB tree, now the dragon is at 50ms. Not bad comparing to 47ms with the buggy implementation.
Re: [applied] Vertex cache optimization
@hybrid
The patch _was_ against SVN, r4040 to be exact? It applies fine using GNU patch. (after line endings are corrected of course, the SVN checkout has a horrible mess of them by default)
On SVN, it's such a PITA to use ...
The patch _was_ against SVN, r4040 to be exact? It applies fine using GNU patch. (after line endings are corrected of course, the SVN checkout has a horrible mess of them by default)
On SVN, it's such a PITA to use ...
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: [applied] Vertex cache optimization
The line ending was correct for me, but the patch format was not correct. Moreover, SVN has a different concept than GIT. You cannot use a single revision for all branches. You made your patch against branches/releases/1.7, while you should do such things against trunk/. Revisions are numbered increasingly over all branches. So yes, there's always something to learn
Re: [applied] Vertex cache optimization
I mean, it was against trunk r4040. It applies against trunk, that revision, using GNU patch.
Google says SVN does not do its own patching, which tool had an issue? TortoiseSVN?
Google says SVN does not do its own patching, which tool had an issue? TortoiseSVN?
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: [applied] Vertex cache optimization
No, the version was definitely not against SVN/trunk. We moved quite a lot of functions inside the mesh manipulator file. And these changes were not visible in the patch. And yes, I use Tortoise.
Re: [applied] Vertex cache optimization
Patch didn't complain, so it was definitely valid. YMMV.
Perhaps Tortoise is set to more strict behavior? Having a fuzz of a couple lines is hardly an issue.
Perhaps Tortoise is set to more strict behavior? Having a fuzz of a couple lines is hardly an issue.
-
- Posts: 12
- Joined: Mon Mar 26, 2012 6:37 am
Re: [applied] Vertex cache optimization
A little confused, where to call the createForsythOptimizedMesh()?
Re: [applied] Vertex cache optimization
you have that method in mesh manipulator (should be present in irrlicht 1.7.3 and in last trunk).
have anyone tried to apply the algorithm for sort similiarly textured vertices? (similiar textcoordinates). in theory that should improve also performance.. or not?
have anyone tried to apply the algorithm for sort similiarly textured vertices? (similiar textcoordinates). in theory that should improve also performance.. or not?
Junior Irrlicht Developer.
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
Real value in social networks is not about "increasing" number of followers, but about getting in touch with Amazing people.
- by Me
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: [applied] Vertex cache optimization
API changes only go into trunk, i.e. will show up in Irrlicht 1.8. This method was not integrated into the 1.7.x branch