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.
#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; } }
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?
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.
jsmackThe equidistant projection shader works fine but when it calculate deep value, the deep is equals to z, while renderer like arnold and clarisse will treate distance as deep when you choose a fisheye camera. Is there any way to modify houdini's fisheye shader to output distance as deep value?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.