Hi, can we make fisheye lens shader working in karma xpu 1.0? since physicallens is working, how to render a 180 degree fisheye image?
Thanks for any help.
Can we get a fisheye lens shader in Karma xpu 1.0
2216 7 0- zzhj
- Member
- 10 posts
- Joined: June 2009
- Offline
- zzhj
- Member
- 10 posts
- Joined: June 2009
- Offline
Is karma physicallens made with vex? if so, is it posible to add the fisheye mode to it?
#pragma opname fishLens #pragma oplabel "Fisheye Lens" #pragma hint x hidden #pragma hint y hidden #pragma hint P hidden #pragma hint I hidden #pragma hint valid hidden //CUSTOM #pragma lable fov "Fov" #pragma range fov 0 180 #include "math.h" cvex fisheye_lens( /*equiangular fisheye lens shader with adjustable FOV and circular image format*/ // Inputs float x = 0; float y = 0; // Outputs export vector P = 0; export vector I = 0; export int valid = 0; // Shader arguments float fov = 180.0; ) { float radius = sqrt(x*x+y*y); /*calculate distance from center of image plane*/ /*following if statement means I is only computed inside r<=1, so that areas of image outside circular format aren't rendered*/ if (radius <= 1){ /*using 1.0 produces blurriness(bug?), but 1.01 works fine*/ float phi = atan2(y,x); float theta = radians(fov/2.0 * radius); I = set(sin(theta)*cos(phi),sin(theta)*sin(phi),cos(theta)); valid = 1; } }
Edited by zzhj - Nov. 9, 2023 03:47:34
- tamte
- Member
- 8772 posts
- Joined: July 2007
- Offline
zzhjI believe only CPU version uses vex, XPU most likely uses equivalent but blackbox shader
Is karma physicallens made with vex? if so, is it posible to add the fisheye mode to it?
So if you modify the VEX shader you are essentially just modifying the CPU version, introducing disparity
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- jsmack
- Member
- 8037 posts
- Joined: Sept. 2011
- Offline
zzhj
Hi, can we make fisheye lens shader working in karma xpu 1.0? since physicallens is working, how to render a 180 degree fisheye image?
Thanks for any help.
In Houdini 20, the physical lens shader has all four fisheye projections: Stereographic, Equidistant, Equisolid, and Orthographic. It also has the non-fisheye fisheye "rectilinear" projection for completeness.
Your shader code looks like an equidistant projection since radius maps directly to angle.
Edited by jsmack - Nov. 12, 2023 13:56:00
- zzhj
- Member
- 10 posts
- Joined: June 2009
- Offline
- zzhj
- Member
- 10 posts
- Joined: June 2009
- Offline
I'm trying to render a 150 degree fisheye with the physicallens shader, tweaking the quadratic distortion type(curvature at 0.51), don't know how to match the same result as the equidistant projection(150 degree), the best result I can get is a similar render checking with eye.
Is there any tips? thanks anyway.
Is there any tips? thanks anyway.
- jsmack
- Member
- 8037 posts
- Joined: Sept. 2011
- Offline
- zzhj
- Member
- 10 posts
- Joined: June 2009
- Offline
-
- Quick Links