IFSRenderer icon indicating copy to clipboard operation
IFSRenderer copied to clipboard

Tilted fisheye projection

Open bezo97 opened this issue 1 year ago • 4 comments

Some planetarium domes have their projectors set up with an offset/angle away from the center. Adding an extra parameter to the fisheye projection would solve the issue. I'm not too familiar with the math so it might take a while. Here's a resource to start off with that looks useful.

The request comes from @vitos1k in this forum discussion.

bezo97 avatar May 23 '24 18:05 bezo97

i've succesfully added tilting into the ifs_kernel.comp.shader into project_fisheye section It works as intended, but for now with hardcoded tilting values, because i'm not sure where to add 3 parameters (TiltX, TiltY, TiltZ) in the interface. And i'm not quite sure where in the code should i initialize those parameters

On the video bellow you can see that center of interest is tilted 30 degrees down

https://youtu.be/obu7SuASQsI

vitos1k avatar May 23 '24 22:05 vitos1k

@vitos1k That's great, you did the difficult part! Send a Pull Request and I'll finish up the rest for the next release

bezo97 avatar May 24 '24 14:05 bezo97

@vitos1k After merging your PR #38 I did a tiny optimization to do the tilting on cpu instead of the shader, so it is now included in the projection matrix when the type is fisheye - see 3ac7717 Also I added sliders to the camera panel. I'm not sure if its the best there.. Let me know if you have any feedback, you can try it on the dev branch

image

bezo97 avatar May 26 '24 16:05 bezo97

@vitos1k After merging your PR #38 I did a tiny optimization to do the tilting on cpu instead of the shader, so it is now included in the projection matrix when the type is fisheye - see 3ac7717 Also I added sliders to the camera panel. I'm not sure if its the best there.. Let me know if you have any feedback, you can try it on the dev branch

image

Looks good, and works as intended! Thanks alot! Yeah, it's better to calculate tilting once, before rendering, in projection matrix, rather than for each point in the shader, nicely done! Sliders in camera panel are most logical placement imho

vitos1k avatar May 27 '24 06:05 vitos1k

Closing this issue as the feature has been released in 1.4.1

bezo97 avatar Apr 27 '25 10:04 bezo97