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.
[fixed] Culling terrain patches according to camera's FOV
-
- Posts: 22
- Joined: Mon Sep 08, 2008 1:22 am
Interesting problem.
When you said that you tried changing the culling mode for the terrain, do you mean you tried setting the Level Of Detail to 0 in the TerrainSceneNode argument list?
If that doesn't do it, you may need to take a performance hit and switch to using the TerrainMesh instead.
EDIT/
Sorry, think I may have misread your post. Try setting TerrainNode->setAutomaticCulling(EAC_OFF).
/END EDIT
--Carl
When you said that you tried changing the culling mode for the terrain, do you mean you tried setting the Level Of Detail to 0 in the TerrainSceneNode argument list?
If that doesn't do it, you may need to take a performance hit and switch to using the TerrainMesh instead.
EDIT/
Sorry, think I may have misread your post. Try setting TerrainNode->setAutomaticCulling(EAC_OFF).
/END EDIT
--Carl
Setting the LOD argument to 1 does solve the terrain morphing (0 is crash).
I thought of setting the patch size to ETPS_127 (basically the entire terrain in one patch), but I get the error on runtime that there are 'cannot draw triangles, too many primitives'.
I suppose there's a maximum number of polygons per object (patch).
EAC_OFF doesn't seem to have an effect.
Thanks, that terrainmesh should work good.
I thought of setting the patch size to ETPS_127 (basically the entire terrain in one patch), but I get the error on runtime that there are 'cannot draw triangles, too many primitives'.
I suppose there's a maximum number of polygons per object (patch).
EAC_OFF doesn't seem to have an effect.
Thanks, that terrainmesh should work good.
Sounds like a bug to me. The terrain should cull its patches depending on the current camera, not a previous one. Looks like CTerrainSceneNode::preRenderLODCalculations() could do with a test that works when a camera changes the FOV but not the position.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.
No time to look at this atm, but can move this thread to bug reports
I've seen the same problem. should have some time to fix this on wednesday.
[url=irc://irc.freenode.net/irrlicht]irrlicht irc[/url] - corrodinggames.com
One further thing to add; originally the gun camera was a CameraFPS.
When I changed it to a standard camera, the terrain glitches ceased. Just like that.
I'm new to this, so I can't begin to understand why. But if my app will help you track the bug, you can download the vcproj and media files here.
http://members.shaw.ca/evilgryphon1/boxwander.rar
When I changed it to a standard camera, the terrain glitches ceased. Just like that.
I'm new to this, so I can't begin to understand why. But if my app will help you track the bug, you can download the vcproj and media files here.
http://members.shaw.ca/evilgryphon1/boxwander.rar
should be fixed now in the SVN.
sorry it took so long, been busy.
sorry it took so long, been busy.
[url=irc://irc.freenode.net/irrlicht]irrlicht irc[/url] - corrodinggames.com