pouët.net

fisheye view: cubemap or single image distortion ?

category: general [glöplog]
I mean.. why do actual fisheye-effects when you can just do a table-effect instead? ;)
added on the 2009-01-16 12:43:04 by gloom gloom
Isn't increasing the FOV sort of a fisheye effect already?
added on the 2009-01-16 12:49:27 by imbusy imbusy
Just an idea Navis: Do you common render, put it inside Photoshop, filter-distort-spherize. Look if the result is good enough after resizing down... I'm sure it can give you an idea of how it would look without the need of coding it...
added on the 2009-01-16 12:49:46 by texel texel
imbusy: no, it is a sort of wide angle lenses.

All true lenses have curvature, but in the common wide angle there is a very very low curvature. In fish eye there is a big curvature.
added on the 2009-01-16 12:51:21 by texel texel
raytrace! :D
added on the 2009-01-16 12:52:51 by bonzaj bonzaj
texel: ah yes, ofcourse !! I'll do that straight away
added on the 2009-01-16 12:53:36 by Navis Navis
You can avoid the cubemap by doing it manually, but that means you'll have to deal with the edges (and N times the geometry). I did that for A Significant Deformation Near the Cranium, although it was used only briefly in one scene for (crappy) reflections. But the basic idea was the same and gave a full 180 degree view. You can have the sourcecode if you will.

If your fov is less than, let's say 120 degrees, i think you'll manage with one bigger texture and distorting it afterwards.
added on the 2009-01-16 12:55:09 by kurli kurli
thanks. Actually using photoshop one can see the problems with a variety of distortion schemes and why a larger (and how much larger) map is needed...
added on the 2009-01-16 13:00:38 by Navis Navis
i dont know the "render to cubemap" stuff, only when the entire screen is simply copy into a texture (like a screenshot) then the texture modifed (ex : blur with a shader) then the texture is draw into the screen with a flat quad....

what are the advantage/difference of rendering it to a "cubemap" ?
and what does it gives as result?
something like this?
BB Image

basically i only use this kind of stuff to do environement mapping on objects
added on the 2009-01-16 13:02:23 by Tigrou Tigrou
Yep what bonzaj said..

It is impossible to get the fisheye effect correct with rasterizing hardware as, e.g. an edge in your 3d space becomes a curve when projected and not a line...
added on the 2009-01-16 13:06:52 by nystep nystep
Ah stupid me. maybe a postprocessing approximation can be good enough.
added on the 2009-01-16 13:08:11 by nystep nystep
Tigrou: You can get a real 360 degrees field of view with that, as we've eg. done in http://www.pouet.net/prod.php?which=27000.
added on the 2009-01-16 13:09:18 by kb_ kb_
Can't the FOV angle be adjusted to whatever value you want by changing the projection matrix using glFrustum?
added on the 2009-01-16 14:28:35 by Adok Adok
Adok: yes.
added on the 2009-01-16 14:34:26 by texel texel
i just think navis wants:
-NO cubemap
-NO shaders involved

the only way to do it is software-rendering then...own 3d-engine...no lens, but FOV-fucking a lot !

what adok described for oGL in dX:
D3DXMatrixPerspectiveFovLH( &matProj, D3DXToRadian( 45.0f PLAY WITH ME ),SCREEN_WIDTH / SCREEN_HEIGHT, 0.1f, 100.0f );

^^ mega-ugly tho and no real fisheye ! missing curvature !
There's a demo or 64kb intro that does a fisheye'ish effect using vertex shaders. I don't remember it's name. It had some toys and a room. But you need a lot of subdivision to make it look decent.
added on the 2009-01-16 14:48:34 by xernobyl xernobyl
Found it:
http://www.pouet.net/prod.php?which=13621
This is just like doing the perpixel distortion, only per vertex. with some decent subdivision it can look OK.
added on the 2009-01-16 14:52:35 by xernobyl xernobyl
people complaining about needing shaders :-)
added on the 2009-01-16 14:54:31 by Navis Navis
The shaders are just for the lighting. Not the distortion, you can do that on the CPU.
added on the 2009-01-16 15:01:07 by xernobyl xernobyl
BB ImageBB Image (from this url)

good to spot fraggers coming at your back!
added on the 2009-01-16 15:10:21 by Zest Zest
Zest: that's the cubemap + shader distortion algorithm, but in software.
added on the 2009-01-16 15:14:13 by xernobyl xernobyl
Navis: So you need an angular fisheye projection?
added on the 2009-01-16 15:20:16 by ham ham
Quote:
people complaining about needing shaders :-)

I think it's fair to say "too bad" to those people in 2009.
added on the 2009-01-16 15:33:44 by gloom gloom

float3 DirV =float3 (UV.x,UV.y,0.7);
DirV/=length (DirV);
UV.xy=UV.xy+(DirV.xy-UV.xy)*0.4;


job done
added on the 2009-01-16 16:59:41 by Navis Navis
hehe !
every non-coder: u see how easy it all is ?

navis: i really thought you wanted to have a solution withOUT shaders !

login