[fixed] Culling terrain patches according to camera's FOV
Posted: Thu Oct 09, 2008 10:17 pm
The Irrlicht terrain automatically culls itself according to the camera's FOV.
So, any terrain patches outside of your FOV are not rendered for speed.
My dilemma is that I have two cameras; the player's camera, and the player's gun camera, which is attached to his gun, and facing in the same direction.
The player's FOV is 1(radian), and the gun camera's FOV is 0.2. The camera renders to a texture, which appears on the player's screen as a textured cube. It works like a scope, giving the player an always-present zoomed view of what the gun sees.
The terrain culls itself according to the gun camera's FOV, and the player sees large gaps in the terrain off to the sides of the screen.
*************
*************
I've tried loading the gun camera first, or last, or resetting the FOV of the camera(s) in different order, but no matter what I do, the terrain culls itself according to the gun camera, which always has a narrower FOV. I've tried changing or disabling the culling mode for the terrain, but it seems to be for something different, and has no effect.
Is there a way to force the terrain to use a particular camera to cull with, or perhaps even 2 cameras? Or better yet, disable this FOV culling altogether? Or perhaps I need to make my own terrain mesh instead of using the Irrlicht terrain?
Any help greatly appreciated, thanks.
****
And a related question; is it possible to prevent the terrain from ever changing LODs? I understand it is effective to improve performance, but sometimes bullets will strike apparent thin air above the peak of a hill in the distance, with unpleasant results.
So, any terrain patches outside of your FOV are not rendered for speed.
My dilemma is that I have two cameras; the player's camera, and the player's gun camera, which is attached to his gun, and facing in the same direction.
The player's FOV is 1(radian), and the gun camera's FOV is 0.2. The camera renders to a texture, which appears on the player's screen as a textured cube. It works like a scope, giving the player an always-present zoomed view of what the gun sees.
The terrain culls itself according to the gun camera's FOV, and the player sees large gaps in the terrain off to the sides of the screen.
*************
*************
I've tried loading the gun camera first, or last, or resetting the FOV of the camera(s) in different order, but no matter what I do, the terrain culls itself according to the gun camera, which always has a narrower FOV. I've tried changing or disabling the culling mode for the terrain, but it seems to be for something different, and has no effect.
Is there a way to force the terrain to use a particular camera to cull with, or perhaps even 2 cameras? Or better yet, disable this FOV culling altogether? Or perhaps I need to make my own terrain mesh instead of using the Irrlicht terrain?
Any help greatly appreciated, thanks.
****
And a related question; is it possible to prevent the terrain from ever changing LODs? I understand it is effective to improve performance, but sometimes bullets will strike apparent thin air above the peak of a hill in the distance, with unpleasant results.