Recently I was making various improvements possible thanks to new viewport and camera handling. If you haven’t already, see our video about Viewports, cameras and navigation!
Improvements:
-
Few fixes to automatic projection calculation. Long story short: you can probably leave
TCastleCamera.ProjectionNear
andTCastleCamera.ProjectionFar
at zero in your projects, 2D and 3D. They should be always automatically calculated to nice values.-
Default perspective
TCastleCamera.ProjectionNear
doesn’t depend on world box (to not increase when some object flies/falls into infinity). -
Default perspective
TCastleCamera.ProjectionFar
is nowZFarInfinity
, regardless ofShadowVolumesPossible
(which were usually true). So there is no far clipping plane — easy to use. We were testing the perspective matrix with “z far at infinity” already a lot (as it was necessary for shadow volumes anyway), and there’s no perceived loss of Z-buffer precision because of it. -
Default orthographic
TCastleCamera.ProjectionNear
andTCastleCamera.ProjectionFar
are much smarter now, looking at world bounding box. -
Optimized: Do not calculate useless ProjectionFarFinite, do not calculate ItemsBoundingBox when not necessary (never needed for perspective, not needed for orthographic when explicit).
-
-
We have deprecated
TCastleViewport.AutoCamera
,TCastleRootTransform.MainScene
,TCastleRootTransform.UseHeadlight
. I consider it a significant gain for the engine — in particularTCastleRootTransform.MainScene
was a thorn in my side for a long time, it was unnatural we needed to designate some scene as “main” to activate some engine features.Now you can achieve (almost) all their functionality through other means. See their docs for pointers. And the engine usage is simpler when you don’t need to be concerned about setting MainScene etc.
-
Upgraded simple_3d_demo with new Blender models.
New castle Blender model is also part of demo-models, see castle subdirectory.
-
Upgraded fog_and_distance_culling to use glTF model and of course new TCastleFog component.
-
Fixed crash in simple_3d_demo when accessing previews of data files with GeneratedCubeMap.