Page 2 of 2

Posted: Sat Dec 10, 2005 2:44 pm
by pr3t3nd3r_guest
nice shoots :wink:

cold be culling ... from what i see in pictures ... now it depends how the colision works ...

Posted: Sat Dec 10, 2005 4:00 pm
by Spintz
MasterD wrote:To come back to the topic, I have the same problem:
(heightmap: bmp, 129^2)

The second picture is made after rotating the cam just a bit.

Could this be a problem of culling large amounts of terrain to early?
Since it seems to me, that it is like culling one half of the terrain.

Like
------
|V|V|
--P---
|C|C|
------
where v=visible; C=culled; P="player" watching nearly complete north
To illustrate what I mean.
Do you can setCameraMovementDelta or setCameraRotationDelta and if you do what do you change them to. I admit, the default culling is bad, very inaccurate. In my current version of IrrSpintz, I've fixed a bug in the overloaded constructor in SViewFrustrum for a core::matrix4. I've also changed the view frustrum culling to be much more accurate, here's the code -

Code: Select all

patchBox = TerrainData.Patches[j].BoundingBox;

if( ( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_NEAR_PLANE] ) != core::ISREL3D_BACK ) &&
	( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_FAR_PLANE] ) != core::ISREL3D_BACK ) &&
	( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_LEFT_PLANE] ) != core::ISREL3D_BACK ) &&
	( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_RIGHT_PLANE] ) != core::ISREL3D_BACK ) &&
	( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_BOTTOM_PLANE] ) != core::ISREL3D_BACK ) &&
	( patchBox.classifyPlaneRelation( frustrum->planes[SViewFrustrum::VF_TOP_PLANE] ) != core::ISREL3D_BACK ) )
And the fix in SViewFrustrum is to remove all '-', as they end up making the normals of the planes of the frustrum point away from the frustrum( the front faces of the planes should be inside the frustrum, not outside it ). For some screenshots in the differences in culling, check these out -

Current bad culling -

Image

New enhanced culling -

Image

Look at the Patch Visible Information GUI window, and also notice the FPS increase! Notice that with the new culling ~5000 indices are removed and the FPS increase is about 20%

Posted: Fri Dec 16, 2005 11:42 am
by MasterD
First off: That advancement is real nice!

About the setCamera...() methods:
I had set them both to "0.0", which I thought was needed by our system, because the camera sticks to (0 | 0 | 0) - Irrlicht Coordinates for rendering precision.

Now I played around with the parameters a bit and it was quite interesting.

With both parameters set to 0:
It seems that LOD 0 gets displayed all the time and everywhere. The holes in the terrain depend on the point of view and stay if you don't move.

..MovementDelta(> 0):
No difference, but cam stays in (0|0|0), so no wonder.

..RotationDelta(> 0):
Holes are only visible while turning, disappear when rotation stops. While rotating, the Holes flicker and the LOD system "works" at the same times (which means: "Hole visible" -> LOD works).

About the collision I can not say anything, because we use PhysX (former Novodex) for Collision. [But there, unusual but happended, the player fell through the Terrain too. ;)]