Last active
August 29, 2015 14:17
-
-
Save mattebb/cfec15c859cf83bd3f4f to your computer and use it in GitHub Desktop.
Mantra stereo pano camera lens shader (wip)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float theta = -$PI * x; | |
float phi = $PI * 0.5 * y; | |
float sin_theta = sin(theta); | |
float cos_theta = cos(theta); | |
float sin_phi = sin(phi); | |
float cos_phi = cos(phi); | |
i.z = sin_theta * cos_phi; | |
i.y = sin_phi; | |
i.x = cos_theta * cos_phi; | |
if (eye == 0) { | |
p.z = -0.5 * ipd * cos_theta * cos_phi; | |
p.x = -0.5 * ipd * sin_theta * cos_phi; | |
} else { | |
p.z = 0.5 * ipd * cos_theta * cos_phi; | |
p.x = 0.5 * ipd * sin_theta * cos_phi; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Notes:
https://support.solidangle.com/display/mayatut/Creating+the+Stereoscopic+Panoramic+Camera
http://www.sidefx.com/docs/houdini14.0/props/mantra#lensshader