pouët.net

fisheye view: cubemap or single image distortion ?

category: general [glöplog]

Hi all,

I've been thinking about this for quite a while since I saw a couple of demos from Farbrausch and Fairlight featuring very good fisheye view rendering.

I know that they render into a cube and then do some pixel shader magic.

I was wondering what is the effect if you can only render into a single texture (render the scene as normal, without the side "panels"). It is possible ? how much worst will it be ? Anyone that has tried it ?
added on the 2009-01-16 10:49:40 by Navis Navis
Yes it's possible, but you need to render to a very very big texture for that to work, so the cube-map is generally faster if you're pixel-shader bound.
added on the 2009-01-16 10:51:58 by kusma kusma
If your scene is highly tesselated, you could imagine reducing the size of that "very very big texture" by doing some fish eye hoolahoops in the vertex shader... i guess. If your life really depends on escaping the cubemap, that is.
added on the 2009-01-16 10:59:56 by Hyde Hyde
In DX10, you can render to all of the cube-map faces in one pass. That kind of solves the 6x draw-call overhead problem.
added on the 2009-01-16 11:03:59 by kusma kusma
lets say there is no way of cubemap rendering and no vertex shader bending path. No fisheye view then ? :-(
added on the 2009-01-16 11:18:07 by Navis Navis
well in such a system i assume the video memory (and even the system memory) is limited. in that case, if you can't cover a decent portion of the framebuffer i guess it is quite unlikely.
added on the 2009-01-16 11:20:53 by decipher decipher
Render scene to texture, render texture on lens-shaped mesh.. fish eye.

Of course, where the image is distorted a lot, it will be very stretched and blurry so you need to pump the res up a lot. And you'll only want the centre of the image, as the sides + bottom will be very curved and you don't normally want to see the missing part..
added on the 2009-01-16 11:22:35 by psonice psonice
psonice won't that expose the image to the problem of map projection? despite the fact that all of them distort the texture, cubemap somehow sounds healthier.
added on the 2009-01-16 11:25:18 by decipher decipher
Well, you can always get your FOV up to almost 180 degrees (no 360 tho, sorry) and render into a planar texture followed by a pass that applies the fisheye distortion, but as kusma said, that texture has to be very big (at least 2 times bigger than the screen I presume) if you want it to look any good.
added on the 2009-01-16 11:26:34 by kb_ kb_
you can render to a bigger 2d texture and post distort it but a) you need a big texture and b) it limits the amount of distortion a lot. doesnt look too cool.
you can do fisheye in the vertexshader as hyde said, but you need a highly - and consistently - tessellated scene for that to work.

you dont necessarily need all the faces of the cubemap for it to work btw. and of course you can visibility cull per face. and hey, who said at what stage you have to do the lighting and so on? (deferred..) :)

added on the 2009-01-16 11:32:25 by smash smash
psonice: Render scene to texture, render texture on lens-shaped mesh.. WORLD's UGLIEST fish eye.
added on the 2009-01-16 11:32:53 by smash smash
smash: it's passable, if you can't do it any other way. But looking back, it seems navis wasn't suggesting doing it without shaders at all, just vertex shaders, so yeah not recommended :)
added on the 2009-01-16 11:37:01 by psonice psonice
psonice: no, it's butt ugly. :)
added on the 2009-01-16 11:38:02 by smash smash
Navis, it should depend on the angle. If you just want the curvature effect and not a very big angle, then maybe one texture is enough. If you want near 180 or more, cube mapping looks needed.
added on the 2009-01-16 11:49:05 by texel texel
... or you render two almost-180° views into two fucking big textures and do a bit of pixel shader blending magic to put them back together, not caring about the seams. Then again, the seams you don't care about are always in the same places of the screen, so it might look ugly.
added on the 2009-01-16 11:56:47 by kb_ kb_
render-to-texture, draw fullscreenquad with it + mapping to polar coords and other faking math in pixelshader = super hacked, super ugly?

Do you need a _perfect_ fisheye? Or just something similar?
added on the 2009-01-16 12:06:41 by arm1n arm1n
kb... I don't really understand your 2 almost 180 but...

Maybe with 2 textures, one near 180º and other with a lower angle, one for the borders and other for the inside of the screen... it might be a good solution...
added on the 2009-01-16 12:07:07 by texel texel
I wonder if there is an online image of what it looks like in all these cases
added on the 2009-01-16 12:11:59 by Navis Navis
Navis, I believe so... don't you remember the images of the fish-eye quake?
added on the 2009-01-16 12:13:26 by texel texel
Ups... memory confusion... it doesn't show different methods, only cube-map, sorry
added on the 2009-01-16 12:15:09 by texel texel
kb: dual parabaloid, yes?
added on the 2009-01-16 12:15:56 by smash smash
smash: I'm note sure if it's exactly dual paraboloid what I was describing but very related, yes :)
added on the 2009-01-16 12:20:36 by kb_ kb_
I was basically thinking of this rather:

BB Image
added on the 2009-01-16 12:24:33 by Navis Navis
Navis, that looks like a 90/100 angle... I'm pretty sure that it can be done reasonably good with one texture, just a bit bigger than the final output.

http://strlen.com/gfxengine/fisheyequake/compare.html
added on the 2009-01-16 12:36:17 by texel texel
FOV = 1000 ftw ;)

BB Image

added on the 2009-01-16 12:42:30 by gloom gloom

login