Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers
|
Unit CastleShapes
Description
Shape (TShape class) and a simple tree of shapes (TShapeTree class).
Uses
Overview
Classes, Interfaces, Objects and Records
Types
Constants
Variables
Description
Types
TShadowSampling = (...); |
Values
-
ssSimple
-
ssPCF4: Percentage Closer Filtering improve shadow maps look, by sampling the depth map a couple of times. They also make shadow more blurry (increase shadow map size to counteract this), and a little slower. They may also introduce new artifacts (due to bad interaction with the "polygon offset" of shadow map).
-
ssPCF4Bilinear
-
ssPCF16
-
ssVarianceShadowMaps: Variance Shadow Maps, see http://www.punkuser.net/vsm/ . This may generally produce superior results, as shadow maps can be then filtered like normal textures (bilinear, mipmaps, anisotropic filtering). So shadows look much nicer from very close and very far distances. However, this requires new GPU, and may cause artifacts on some scenes.
|
TShapeSpatialStructure = (...); |
Possible spatial structure types that may be managed by TShape, see TShape.Spatial.
Values
-
ssTriangles: Create the TShape.OctreeTriangles. This is an octree containing all triangles.
|
TShapeTraverseFunc = procedure (Shape: TShape) is nested; |
|
TTestShapeVisibility = function (Shape: TShape): boolean of object; |
|
TShapeTreeList = specialize TObjectList<TShapeTree>; |
|
TPlaceholderName = function (const Shape: TShape): string; |
Detect the 3D placeholder name set in the external modeler, like 3D object name set in Blender or 3DS Max. Assumes that a specific modeler was used to create and export this 3D model. Each TPlaceholderName function is made to follow the logic of a single modeler, and they are gathered in PlaceholderNames.
Returns empty string if none.
When implementing this, you may find useful the following properties of the shape: TShape.OriginalGeometry.X3DName, TShape.Node.X3DName, TShape.GeometryParentNodeName, TShape.GeometryGrandParentNodeName, TShape.GeometryGrandGrandParentNodeName.
Preferably, the result should be unique, only for this VRML/X3D shape. But in practice it's the responsibility of the modeler and model author to make it true. For example, modelers that allow multiple materials on object (like Blender) must split a single 3D object into many VRML/X3D shapes sometimes. So just don't use shapes with multiple materials if this shape may be meaningful for a placeholder.
This is used only by TGameSceneManager.LoadLevel placeholders. Ultimately, this should be something that is easy to set when creating a 3D model in given external modeler. Nothing else in our engine depends on a particular modeler strategy for exporting VRML/X3D models.
This should be object name (to allow sharing a single mesh underneath). Except when it's not possible (like for old Blender VRML 1.0 exporter, when only mesh names are stored in VRML/X3D exported files), in which case it can be a mesh name.
|
Constants
ShadowSamplingNames: array [TShadowSampling] of string =
( 'Simple', 'PCF 4', 'PCF 4 Bilinear', 'PCF 16', 'Variance Shadow Maps (Experimental)' ); |
|
DefLocalTriangleOctreeMaxDepth = 10; |
|
DefLocalTriangleOctreeLeafCapacity = 32; |
Default octree leaf capacity for TShape.OctreeTriangles.
This is slightly larger than DefTriangleOctreeLeafCapacity, as this octree will usually be used interactively for collision detection, not by ray-tracer. So octree construction speed is somewhat important, and cannot be too large...
|
Variables
DisableAutoDynamicGeometry: Cardinal; |
If nonzero, disables automatic TShape.DynamicGeometry detection on every node modification. This is useful if you do some interactive editing of the shape, but you don't want the shape octree to be replaced by it's approximation.
|
LogShapes: boolean = false; |
Log various information about shapes. This displays quite a lot of non-critical information when opening non-trivial models.
Meaningful only if you initialized log (see CastleLog unit) by InitializeLog first.
|
Generated by PasDoc 0.15.0.
|