Eliminating fisheye distortion in raytracing

Started by
25 comments, last by TerranFury 22 years, 5 months ago
Anon, I see what you mean; I had thought you meant an additional "inverse fisheye" warping. Actually, what you describe now is what I'm doing anyway, since I'm not normalizing my primary rays. I still say it doesn't affect fisheye distortion, but since I have effectively eliminated that problem, it doesn't matter anyway.

[Edited to remove question I answered myself]

Edited by - TerranFury on November 4, 2001 2:50:15 PM
Advertisement
well... I do not want to say something stupid, but the fisheye effect is something that is quite normal. Every picture and every film has a fisheye effect. But it is quite low, as the FOV is very small. Go take a camera, make a picture and calculate the FOV. It won´t be much more than 20 degrees I think. Many people use FOVs of 90°. If you suppose your monitor has a width of 40cm, then you will have to see your picture from a distance of 20cm to get correct results. Move that close to your monitor, and your fisheye effect will disappear. What I want to say is: Use a more realistic FOV, like 30 degrees for a raytraced picture. If you do somthing like rotating about some axis or some stuff, you might reduce the fisheye effect. But your picture is no longer correct. By the way, your very first algorithm is correct (to my knowledge) but with a screen resolution of 640x480 you will have a FOV of about 100 degrees. This is _very_ unrealistic and results in the fisheye distortion (unless you move very close to your monitor)
I''m currently using an FOV of 55 degrees (A big change from my previous one). Why 55? That''s what POV-ray uses, because it supposedly is the FOV of the "average human." I''m doing this:

  const unsigned int SCREEN_WIDTH = 640;const unsigned int SCREEN_HEIGHT = 480;const float PI = (float)atan(1) * 4.0f;const float RTOD = 180/PI;const float DTOR = PI/180;const float FOV				= 55.0f; //degrees < 180; 55 is average human FOVconst float FOCAL_LENGTH	= (float)(SCREEN_WIDTH/2)/tanf(FOV*0.5f*DTOR);  
quote:Original post by Chock
Go take a camera, make a picture and calculate the FOV. It won´t be much more than 20 degrees I think


Unfortuantely, Chock is chock full of misinformation. I frequently shoot pictures with lenses which have a field of view of about 84 degrees. This corresponds to a 24mm lens when shooting in the 35mm format. I shot this image with a Nikkor 24-50mm lens set at 24mm with a 35mm Nikon camera. The lens was set at 24mm. 24mm lenses are a popular focal length for 35mm wide angle work among photographers. These lenses are designed for minimal distortion. Other popular lenses with minimal distortion include the Nikkor 20mm lens which has a field of view of 94 degrees. Here is another image shot with my 24-50mm lens set at 24mm.

I shot this image with a Caltar 90mm lens using a 4x5 camera. When shooting in the larger format of 4x5, a 90mm lens translates to a field of view of about 68 degrees

___________________________________

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
So I was completely wrong here. Sorry. But I still believe what I said. You said that those lenses are made for minimal distortion. And this is probably the point. I suppose that those lenses create an inverse fisheye effect, and this way simulate a smaller FOV, but the viewer farer away. I suppose (though I do not know) that you would get a similar result, if you used a "standard" lens but took the picture from farer away (if there would be no wall behind you).
But anyways, this is not what you would see if you put a window of that size there and looked through it. If you want to emulate this inverse fisheye effect in your engine, you will have to look at a specification of your lens, and look what is mathematically behind it. I did not know that this is what you wanted to do.
quote:Original post by Chock
I suppose that those lenses create an inverse fisheye effect


They only create an inverse fisheye effect in the sense that they are designed to compensate for any fisheye effect that might be introduced. This is directly analogous to the undertaking in this thread by code.

quote:Original post by Chock
... and this way simulate a smaller FOV, but the viewer farer away. I suppose (though I do not know) that you would get a similar result, if you used a "standard" lens but took the picture from farer away (if there would be no wall behind you).


That is certainly not the case. Such a thing would be impossible. The only way to get the effect of standing further away with a "standard" lens would be to stand farther away. Moving the camera produces an entirely different composition. I will demonstrate with an image. Look at the rock in the lower right. If I moved 100 feet back and took a similar picture, the rock in the lower right would be much smaller in the image, but the east face of Whitney (on the right) and the needles would be about the same size in the image.



Left to right: Third Needle, Crooks Peak, Keeler Needle and Mt. Whitney.


If on the other hand, I popped a wider angle lens on my camera (or zoomed out if I was using a zoom lens) everything in the image would be reduced by a constant factor.

When producing 3d imagery via rendering, one is in general engaging in a task similar to photography or cinematic production. Any movie makes use of lenses of varying focal lengths. A ray tracer should have similar capabilities, and if possible have ''lenses'' of different distorting qualities depending on the job at hand.

___________________________________

_______________________________
"To understand the horse you'll find that you're going to be working on yourself. The horse will give you the answers and he will question you to see if you are sure or not."
- Ray Hunt, in Think Harmony With Horses
ALU - SHRDLU - WORDNET - CYC - SWALE - AM - CD - J.M. - K.S. | CAA - BCHA - AQHA - APHA - R.H. - T.D. | 395 - SPS - GORDIE - SCMA - R.M. - G.R. - V.C. - C.F.
Hmm... You are probably right there. I did not think about it. And then the rotation of the ray might really be correct, as it is equivalent to a curved screen. Are there any raytraced pictures using this rotation technique with a large FOV? It would be really interesting to see the results...

This topic is closed to new replies.

Advertisement