DOC PREVIEW
OSU CS 519 - LECTURE NOTES

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

1mjb – January 3, 2012Creating More Realistic Lens EffectsMike [email protected] State Universitymjb – January 3, 2012Center1Center2R2(>0)R1(>0)PEye- Z?Convex Lens Definitionsmjb – January 3, 2012Center2Center1R1(<0)R2(<0)PEye- Z?Concave Lens Definitionsmjb – January 3, 2012out vec3 vRefractVector;uniform float uR1, uR2;const float ETA = 0.66;const vec3 EYE = vec3( 0., 0., 0. );. . .vec3 P = vec3( uModelViewMatrix * aVertex );vec3 FromEyeToPt = normalize( P - EYE ); // vector from eye to ptvec3 Center1 = vec3( 0., 0., P.z - uR1 );vec3 Normal1;if( uR1 >= 0. )Normal1 = normalize( P - Center1 );elseNormal1 = normalize( Center1 - P );vec3 v1 = refract( FromEyeToPt, Normal1, ETA ); // eta = in/outv1 = normalize( v1 );vec3 Center2 = vec3( 0., 0., P.z + uR2 );vec3 Normal2;if( uR2 >= 0. )Normal2 = normalize( Center2 - P );elseNormal2 = normalize( P - Center2 );RefractVector = refract( v1, Normal2, 1./ETA ); // 1./eta = out/ingl_Position = uModelViewProjectionMatrix * aVertex;-ZEyev1zero thicknesslens.vert – Setup for a Cube Map TexturePmjb – January 3, 2012Convex Lenses (R1>0, R2>0)mjb – January 3, 2012Convex Lenses (R1>0, R2>0)2mjb – January 3, 2012Concave Lenses (R1<0,R2<0)mjb – January 3,


View Full Document

OSU CS 519 - LECTURE NOTES

Download LECTURE NOTES
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view LECTURE NOTES and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view LECTURE NOTES 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?