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? ;)
Isn't increasing the FOV sort of a fisheye effect already?
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...
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.
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.
raytrace! :D
texel: ah yes, ofcourse !! I'll do that straight away
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.
If your fov is less than, let's say 120 degrees, i think you'll manage with one bigger texture and distorting it afterwards.
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...
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?
basically i only use this kind of stuff to do environement mapping on objects
what are the advantage/difference of rendering it to a "cubemap" ?
and what does it gives as result?
something like this?
basically i only use this kind of stuff to do environement mapping on objects
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...
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...
Ah stupid me. maybe a postprocessing approximation can be good enough.
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.
Can't the FOV angle be adjusted to whatever value you want by changing the projection matrix using glFrustum?
Adok: yes.
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 !
-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.
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.
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.
people complaining about needing shaders :-)
The shaders are just for the lighting. Not the distortion, you can do that on the CPU.
Zest: that's the cubemap + shader distortion algorithm, but in software.
Navis: So you need an angular fisheye projection?
Quote:
people complaining about needing shaders :-)
I think it's fair to say "too bad" to those people in 2009.
float3 DirV =float3 (UV.x,UV.y,0.7);
DirV/=length (DirV);
UV.xy=UV.xy+(DirV.xy-UV.xy)*0.4;
job done
hehe !
every non-coder: u see how easy it all is ?
navis: i really thought you wanted to have a solution withOUT shaders !
every non-coder: u see how easy it all is ?
navis: i really thought you wanted to have a solution withOUT shaders !