Rift custom lens cups experiment

geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

remosito wrote:
geekmaster wrote:I am experimenting with variations of simple "approximate" pre-warp algorithms that will work on small devices like the Raspberry Pi, where any incorrect distortion is hopefully in the outer extremes where not visible, or at least not distracting. Computer graphics has a long history with approximate solutions (and still does)...
After reading the fresnel stack thread I have been wondering about that custom pre-warp.

Couldn't one use an interactive pre-warp design application:

Where you display a series of increasingly dense grids. Lets say start with 2-3 grid points in each axis. Then each iteration you add another 1-3 per axis.
The perfect onscreen grid will look all wonky after it passes through your lenses and be all warped.

For each iteration you make each intersection point selectable and moveable. Then the user can move the grid points until he sees a perfect grid with his eyes. The offset correction of the gridpoints would be the pre-warp. Or am I overlooking something?

The more iteration the user works himself through the more accurate the resulting pre-warp. One could as well start instead of a virgin grid by providing a number of pre-warps the user can choose the one that looks best. And iteration x+1 new gridpoints could be estimated/predicted by using prewrap offsets from iterations 1 through x. Maybe even different predictions based on different models the user quickly rotates through for the one being best.

All cutting down a lot on required user work.
I was planning something similar, with onscreen sliders. The more advanced literature out there suggests that real world lenses do not completely match the formulas anyway, so real camera lenses usually have their distortion tables computed from photographs of a calibrated "grid and bullseye" target (or other static or animated targets), and use software (or eyeball it) to determine how much and in which direction things moved from their correct position.

And yes, tables are used (with interpolation) for the most accurate results, because a single lens distortion formula cannot accurately apply to the entire lens diameter. But the formulas are fine for less critical apps, like the Rift DK. Whereas for something more complex like stacked lenses, I believe that a user interactive approach would be much more effective (with a variety of pre-adjusted profiles to select from for those who do not want to use the sliders).
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

msfreemind wrote:I don't think customizing an eyecup for IPD makes sense anymore, since the latest release of the SDK removed IPD from the distortion projection. IOW, the distance between the projection centers is fixed at 64mm.

You could probably create your own demo where the distortion is handled differently (or you can find games/demos that use an older SDK version), but anything that uses the new SDK distortion handling will be assuming 64mm lens separation.
I only use portions of the Rift SDK to obtain tracker data. Instead of doing "pre-warp" AFTER rendering (i.e. "post-warp"?), I plan to do the pre-warp on the INPUT side, where the effective viewing direction of each little pixel "window" on the Rift display determines what gets rendered (i.e. LCD pixel-sized "viewing frustrum"), somewhat like warping the path of a ray-tracing vector before it strikes anything in the virtual world to determine its color. That avoids causing blur from doing pre-warp as the last step in the rendering pipeline. I plan to warp it in the first step, not the last step, for a much better (IMHO) final image quality AND less computation.

Of course, I need to actually IMPLEMENT my method to determine if it will actually work as good as I expect it to. Ideas sound cool, but translating them to finished products often turn of obstacles to overcome or work-around with a "cheat".

For my "PixelBall" (GMsphere) code, instead of using any lens pre-warp, I decided to just create a virtual environment that benefits from the lens-induced curvature, like viewing a projection in a planetarium dome. No pre-warp needed for some content, and that is exactly the kind of VR content that I plan to explore in the near future.
lordbinky
One Eyed Hopeful
Posts: 9
Joined: Sun Apr 07, 2013 12:07 pm

Re: Rift custom lens cups experiment

Post by lordbinky »

I had got some 5x lenses from some magnifying glasses (2" and 2.5" diameters) and some various fresnel lenses. After four days I finally got the chance to play with them for an hour to try them out as custom lens setup. I figured I could get something good to work because my glasses just aren't playing nice, I'm near sighted w/ astigmatism such that I can't get contacts because my astigmatism is too much for regular contacts and not bad enough for astigmatism contacts (╯ಠ益ಠ)╯ ┻━┻ ....

Anyways, I may be missing something important but I couldn't get the single glass lenses to work out correctly in the short time I had until..... I put the 2.5" lens, which fits almost perfectly between the cup tabs, with the 2" lenses in a tube on top of them. Some slight shifting in the 2" lenses and everything lines up for the 3d effect, with a larger FOV and readable text (although some of the outer horizontal is cut off). I'll be able to put more work into it in a few days, but until I just went 'Maybee.....' and tried stacking the lenses, I couldn't get the 3D effect.

If I'm missing something obvious, I'd really appreciate any hints, tips, or helpful suggestions. Thanks.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

lordbinky wrote:I had got some 5x lenses from some magnifying glasses (2" and 2.5" diameters) and some various fresnel lenses. After four days I finally got the chance to play with them for an hour to try them out as custom lens setup. I figured I could get something good to work because my glasses just aren't playing nice, I'm near sighted w/ astigmatism such that I can't get contacts because my astigmatism is too much for regular contacts and not bad enough for astigmatism contacts (╯ಠ益ಠ)╯ ┻━┻ ....

Anyways, I may be missing something important but I couldn't get the single glass lenses to work out correctly in the short time I had until..... I put the 2.5" lens, which fits almost perfectly between the cup tabs, with the 2" lenses in a tube on top of them. Some slight shifting in the 2" lenses and everything lines up for the 3d effect, with a larger FOV and readable text (although some of the outer horizontal is cut off). I'll be able to put more work into it in a few days, but until I just went 'Maybee.....' and tried stacking the lenses, I couldn't get the 3D effect.

If I'm missing something obvious, I'd really appreciate any hints, tips, or helpful suggestions. Thanks.
Lens focal length is important. Not just any 5x lens do. I bought the lenses recommended in the DIY Rift thread. You need lenses that will focus about 2-inches or so away while held next to your eye.
lordbinky
One Eyed Hopeful
Posts: 9
Joined: Sun Apr 07, 2013 12:07 pm

Re: Rift custom lens cups experiment

Post by lordbinky »

Ugh, too much time passed between me receiving the lenses and ordering them. I had forgotten I went with cheap mystery specs instead of paying for knowing stuff.

So what I found was that the 2.5" lens have a 4" focal length, and the 2" lens have a 3" focal length. Played around with them, came to the same conclusion that the slight warp change was just a little too distracting for satisfactory swapping.

What I didn't expect was going back to my setup of stacking them made it get roughly the correct warp. The doorway in the Tuscany demo was straight instead of bulged for example, so no noticeable warp from what I could see.

I had the 2.5" lens sitting in between the lock tabs in the rift, then had my 2" lens in a cardboard tube about the same height as the rift A cup sitting on top of the larger lens. I adjust the 2" to align for proper viewing, and I get my, larger than necessary, increased viewing area with better focus. I haven't tested it yet but I think this will work better for making text in games less frustrating. I am putting some thermoplastic to use and mounting the lenses better.

I'm not an optics person so I don't know technical jargon, but it seems to make sense to me that the distortion clears up when I compare the two lens setup to the rift lenses. I say that because the significantly convex portion of the lens (inside the cup) seems to be about double that of each the magnifying lenses I'm playing with.

When I get the lens in a fixed cup, I'll see if I can note anything else of significance like the degree of chromatic aberration if there's any interest.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

<accidental post deleted>
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Rift custom lens cups experiment

Post by Fredz »

geekmaster wrote:Spheric lenses have more chromatic aberration (color fringes near the edges). That can be corrected somewhat by software, but better to use aspheric lenses (created specifically to reduce chromatic aberration).
Aspheric lenses have been created to correct spherical aberration, not chromatic aberration.

Chromatic aberration happens because the light can't be focused to the same convergence point for different wavelengths. This also happen with aspheric lenses because it depends on the refractive material and its surface treatment. That's why it was observable on the Rift before software chromatic aberration correction was implemented in the SDK.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

Fredz wrote:
geekmaster wrote:Spheric lenses have more chromatic aberration (color fringes near the edges). That can be corrected somewhat by software, but better to use aspheric lenses (created specifically to reduce chromatic aberration).
Aspheric lenses have been created to correct spherical aberration, not chromatic aberration.

Chromatic aberration happens because the light can't be focused to the same convergence point for different wavelengths. This also happen with aspheric lenses because it depends on the refractive material and its surface treatment. That's why it was observable on the Rift before software chromatic aberration correction was implemented in the SDK.
I had just been reading about hybrid aspheric lenses when I posted that, which influenced my thinking while I posted. They are designed to eliminate chromatic aberration:
Plastic Hybrid Aspheric Lenses Eliminate Chromatic Aberration:
http://www.mdtmag.com/product-releases/2010/06/plastic-hybrid-aspheric-lenses-eliminate-chromatic-aberration wrote:The unique aspheric base eliminates spherical aberration, allowing for greater image quality. The diffractive surface features a negative optical dispersion, which yields excellent color correction and minimized chromatic aberration. This characteristic makes the lenses perfect for a wide variety of applications in the imaging and ophthalmic industries.
The Rift uses "ordinary" aspheric lenses (no surface treatment), which is why software CA-correction is needed.

Different wavelengths of light bend differently while travelling through a lens, requiring either additional lenses to bend them the other way to converge the wavelengths, or a diffractive surface coating to achieve the same purpose.

I try to balance between too many words, and not enough adjectives, and sometimes I mess up trying to find a balance, causing over-simplification or just plain mistakes. I updated the post you referred to to change "chromatic aberration" to "spherical aberration", and also provided a link to this post. Thanks for the correction! :D
Inscothen
Binocular Vision CONFIRMED!
Posts: 203
Joined: Fri Aug 31, 2012 11:21 pm

Re: Rift custom lens cups experiment

Post by Inscothen »

So hearing the Rift's lenses were 1.5 inches and there are the 50mm we have, I ordered some 6x 45mm lenses(as-6 model) thinking I could get something between the two. So I got them today and noticed they were as big as the 50mm. Thicker and heavier too. :evil: They do have a coating on them and do seem more optically clear. :D

Effectively, they do give a larger screen space visible somewhere between the Rift's and 50mm lenses, but there's too much edge to fit comfortably with my nose if I wanna look through the center. The focal length is between the Rift and 50mm, so that's a plus for compactness compared to the 50mm.

I measured all the lenses to not include the non magnifying parts of the lenses for the Rifts, the 50mm, and my new 45mm lenses and notice that the lenses are really around 34mm(rift), 48mm(50mm), and the 45mm are actually 45mm.

So if I were to grind off the extra edges I could get my 45mm to be a more suitable fit for nose comfort and give a better quality image over the Rift lenses, but I may save these for another day and try to find something a little smaller.

...but does anyone know of any 6x lenses that are around 40-42mm diameter(actual optical portion not including the edges)?
User avatar
Fredz
Petrif-Eyed
Posts: 2255
Joined: Sat Jan 09, 2010 2:06 pm
Location: Perpignan, France
Contact:

Re: Rift custom lens cups experiment

Post by Fredz »

UltraOptix SV-2LPLED 7X Aspheric LED Lighted Magnifier
http://www.amazon.com/UltraOptix-Powerf ... B0054H1XYQ
Diameter : 1 1/2″

That's the one used in the FOV2GO project, the Socket HMD and the Unofficial Modified Oculus Rift Eye Cups IIRC.
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

With 7x you will lose a lot of pixels (sort of like the C cup in the Rift DK), unless you have a small display. I like the 5x lenses myself (even with my Rift).
Inscothen
Binocular Vision CONFIRMED!
Posts: 203
Joined: Fri Aug 31, 2012 11:21 pm

Re: Rift custom lens cups experiment

Post by Inscothen »

Fredz wrote:UltraOptix SV-2LPLED 7X Aspheric LED Lighted Magnifier
http://www.amazon.com/UltraOptix-Powerf ... B0054H1XYQ
Diameter : 1 1/2″
Thank you for the info. I'm kinda worried those lenses would be like the Rift lenses where it says 1.5" but it's really 38mm for the whole lens and the actual optical portion is around 35mm diameter. The same way the the 50mm lenses are listed(the optical portion is really 48mm). With my new lenses it listed the optical portion's diameter(45mm) but the whole lens diameter is 50mm.

I'm kinda hoping to find a ~40-42mm optical diameter after finding the Rift lenses(and possibly those 7x lenses) are around 35mm.

What are the magnification power of the Rift lenses? I always thought it was around 7-7.5x...
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

Inscothen wrote:
Fredz wrote:UltraOptix SV-2LPLED 7X Aspheric LED Lighted Magnifier
http://www.amazon.com/UltraOptix-Powerf ... B0054H1XYQ
Diameter : 1 1/2″
Thank you for the info. I'm kinda worried those lenses would be like the Rift lenses where it says 1.5" but it's really 38mm for the whole lens and the actual optical portion is around 35mm diameter. The same way the the 50mm lenses are listed(the optical portion is really 48mm). With my new lenses it listed the optical portion's diameter(45mm) but the whole lens diameter is 50mm.

I'm kinda hoping to find a ~40-42mm optical diameter after finding the Rift lenses(and possibly those 7x lenses) are around 35mm.

What are the magnification power of the Rift lenses? I always thought it was around 7-7.5x...
Somebody at the OculusVR forums had their optician measure them. Although cybereality said the A/B/C eyecups all use the same lenses, the optician reported a range from about 6.5x to 7.5x or so, as I recall. So about 7x average, with pixel coverage depending on distance to screen (cone of intersection).

Somehow after trying the 5x with my Rift, I think 7x is a bit too much, but then it also depends on distance.
Inscothen
Binocular Vision CONFIRMED!
Posts: 203
Joined: Fri Aug 31, 2012 11:21 pm

Re: Rift custom lens cups experiment

Post by Inscothen »

so the UltraOptix SV-2LPLED lenses are probably the same or very similar to the Rift uses? Probably since Palmer was involved with the FOV2GO project.

Would keeping the same diameter but having a lower magnification power change the focal length? So if I were to replace the Rift lenses with a 1.5" 5x would it be the same lens-to-screen distance?
geekmaster
Petrif-Eyed
Posts: 2708
Joined: Sat Sep 01, 2012 10:47 pm

Re: Rift custom lens cups experiment

Post by geekmaster »

I do not know lens optics all that well. I look stuff up when I need it. The FOV2GO lenses were meant for cellphone displays, so a lot of pixels would be wasted on a larger display (which should need less magnification). Depending on your prescription, that will affect what focal distance you need (which is why the Rift has different eyecups).

I think the Rift lenses have too much magnification (at least for my eyes).
Inscothen
Binocular Vision CONFIRMED!
Posts: 203
Joined: Fri Aug 31, 2012 11:21 pm

Re: Rift custom lens cups experiment

Post by Inscothen »

Ok, thanks geekmaster. I think I'll look for some that have the same or similar magnification to diameter ratio as the 50mm, depending on focal length. Maybe that way we can find some lenses that are Rift size without the excessive warping/wasting pixels on larger displays like the devkit.
rupy
Two Eyed Hopeful
Posts: 81
Joined: Wed Feb 20, 2013 9:26 am
Contact:

Re: Rift custom lens cups experiment

Post by rupy »

So apparently the lenses in the three cups are the same!?

So then why can't we just print our own cups that fits our prescription?

Of course games might have to take these custom cups into account but waiting for Oculus to act on this front wont happen before CV1.

I would really like something similar to this: http://projects.ict.usc.edu/mxr/diy/eye ... culus-rift

But with one stl file per 0.25 diopter, but I guess the FOV will be off then... hm, right now I have a -0.5 lens under my right C-cup to fix the difference in my sight between left and right eye.

It works well but the FOV is really suffering from the C-cups. So maybe the best option for a prescription correction system is to have something that corrects your total nearsightedness with the A-cups. but in my case that's -5.5 and -6.0!!! Some thick lenses that would be! Specially if not high index...
Image
"It's like Homeworld in first person."
Disable Aero and vSync for a completely simulator sickness free experience with 2xHz FPS.
Keep the 0.4.4 config utility open for tracking to work.
Post Reply

Return to “Oculus VR”