pouët.net

fisheye view: cubemap or single image distortion ?

category: general [glöplog]
Ah, of course, t-junctions. I hadn't thought about those. But how about definining polygons from a list of edges instead of a list of vertices, and then subdivide those edges dynamically each frame until each edge segment is under a certain threshold, and then building a normal vertex list and a list of faces defined from these vertices and then.... OK, fuck, that will be horribly slow. Nevermind.
Simply going through an edge or half-edge list and splitting all edges that are above a certain threshold may produce at least correct meshes (as in no t-junctions) but the geometry coming out of it looks ugly as fuck and this will definitely show if you're then doing funny stuff with the vertices.

A two pass approach that first identifies _all_ edges that have to be split and then generates correctly tesselated triangles with this information is way better.

Try it with pen and paper and one triangle - splitting the edges one after another looks nothing like a correctly tesselated tri.
added on the 2009-01-19 02:35:53 by kb_ kb_
That's what I was saying allready!

But isn't it insanely CPU heavy to do it properly? And it's pretty GPU unfriendly, yes?
@graga: i believe tesselation can be easily done using geometry shaders, but the cost of the calculation is a bit high, true.
added on the 2009-01-19 04:03:23 by decipher decipher
Regarding tesselation, please see here (esp. "Rendering Panoramas" section).
Dynamic LOD subdivision surfaces seem to be the hype soon, but without DX11 hardware I doubt it is really fast enough: There is Bunells method in GPU Gems, but it requires a lot of back and forth between GPU and CPU...
added on the 2009-01-19 11:52:20 by arm1n arm1n
If you tessellate heavily to make this work you incur a whole plethora of other plenalties beyond the increased vertex shader time.
Obviously memory bandwidth costs and increased time in setup, but also some more subtle things. Pixel processing doesnt like small triangles either because they can potentially invalidate zcull tiles, and because you get extra pixels being processed at triangle edges - the more triangle edges you have, the more pixels you get shaded. Besides, these days our shader architectures are unified, so by adding more vertices you're just taking time away from the fragments.
If you were afraid of the fragment-side costs with other techniques like render to bigger texture or render to cubemap it could well be better to go back and improve your pixel pipeline - e.g. move some lighting calculations to deferred, fix your draw order to be more zcull friendly etc - than move to per vertex.
added on the 2009-01-19 13:47:33 by smash smash
... or just don't do the bloody distortion in the first place. I'd be damned if I had to spend weeks pulling my hair out of frustration because my fisheye lense effect wasn't looking as good as in media error :-)
added on the 2009-01-19 14:12:01 by Navis Navis

login