40MTri/s for my last Catmull-Rom code
Today I switched from an old OpenGL 1.1 arrays model to the ARB_vertex_buffer_object extension, giving a 50% performance boost to my rendering pipeline :-)
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzF8Yq7VB1UCVOhPMj86ENw9lWdj5XepNS7Q-zoJenSsISi90F4qf3cwx63I2yrkH_g7bwtFIDsTlX3OIN01WyJtSxGjKbHg2GtszyX00ac5uUkZ8whJNXbRF-byxfOtTVEI4TSPnuqYQ/s400/GLoria2005.png)
- Patch tesselation: edges are subdivided by 200, giving 200x200x2 = 80000 triangles for each patch.
- FPS: 250/s at 1024x768@32bit, on a 1800MHz Barton.
- Drawn patches: 2
- MTri/s: 2x80000x250/1000000 = 40MTri/s! Quite decent.
The design has got ugly and I still have to refactor everything, but it look promising. For now, I use a T2F_V3F interleaved array. The texture is applied on the patch but it will likely be used as a shader lookup in the future.
Todos
- Test whether interleaved arrays is the way to go or I should switch back to separate vertex/texcoord arrays.
- Move the Catmull-Rom code to a vertex shader.
- Generate normals on the fly in shader code.
- Add a border stripe for avoiding boundary artifacts when doing C-LOD.
- Manage patches with quadtree, so it's scalable and well suited for heightmap rendering.
- Display models with patches.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIwogaNptG2ztwUlUbOD-iE_rs6vEBxhNQ-NX1SsxoV1TDMOhWNPDmICukAHXmFwQbEU6-VHcGCMMglKAYsJukCamN0Hs5BFQOAz8ftq4OT6X7CFDDefHeozc-tHvmpElLUfvD98umIcw/s400/GLoria2005-2.png)
Catmull-Rom Subdivision Surfaces
CRSS are bicubic surfaces like Bezier patches. Here is a visual explanation about the differences between Bézier surfaces, B-Splines and CRSS:
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5rW0ntiVdCGMjSZDjgFUFuxACFATv5HsxMrG_cNRgIzvv9-fTEAx9Fo8Renrw20dEwM1GWx1jtIUYLVZxwdrOXrHVNbgHgfYFSyRp6VSOZ3fNLit8UrA3LjshlbuEFcCpl22wsj3AtlQ/s400/bezier-nvidia.jpg)
Leave a Comment