Fix skybox under orthographic view

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


maz_1
Gnoblar
Posts: 9
Joined: Tue Aug 24, 2021 7:52 am

Fix skybox under orthographic view

Post by maz_1 »

I am testing SkyPostprocessing in a object-centered control style. It works totally fine under perspective view, the challenge is to make it behave normal under orthographic view.
Under perspective view , when I want to zoom in/zoom out on a object, I only need to move the camera towards or away from the object.
But under orthographic view, moving the camera won't change the rendered size of the object, so I have to change the extents of the frustums to make rendered size bigger or smaller. The problem is that changing the frustum extents will change how skybox is rendered, making it distorted.
Under perspective view, I can easily understand how the fov of camera is related to the visible area of skybox. But under orthographic view, all camera rays are parallel to each other, so I'm not sure how skybox work under this situation.
Could I possibly modify the SkyPostprocess vertex shader so the projection matrix always has a fixed size of frustum?

Last edited by maz_1 on Wed Apr 23, 2025 1:19 pm, edited 4 times in total.
maz_1
Gnoblar
Posts: 9
Joined: Tue Aug 24, 2021 7:52 am

Re: Fix skybox under orthographic view

Post by maz_1 »

When I zoom out (increase frustum size)
https://imgur.com/a/8GmQGBv

When I zoom in (decrease frustum size)
https://imgur.com/a/BdZtypc