I am trying to implement a custom camera with large FOV in blender. I know, that Cycles render engine allows to use a fisheye lense, by it in not enough for me, I need a specific camera with customizable distortion model (e.g. with some specific coefficients in Kannala-Brandt model).
One way to solve this problem is to prepare the rays corresponding to every pixel of my camera (this part is simple, and I know how to do it), cast these rays, trace their path and find colors/intensities for these rays and, as a result, to the corresponding pixels (this part I'm struggling with).
My question is, if there is functionality in Blender Python API to cover the second part, namely, given a ray (direction + starting point) to find color/intensity corresponding to this ray.
I tried to find the answer myself. After reading the docs, I figured that one can shoot a ray and find a place where this ray hits an object, but I have no idea what to do next and how to find the intensity/color and what to do if there are multiple hits with several objects.
I am sorry, if I misuse the terminology, I am completely new to Blender. I would be very grateful for any suggestions.
UPD: I googled some more, and found a project, which could be useful. However, if there is another way to achieve what I want, without modifying Blender's source code, it would be most welcome.
UPD2: I found a similar question with answers here, and it is a way to go, but if there is build-in functionality in Blender Python API, I would again very much appreciate it if you point me in the right direction.