Castle Game EngineIntroduction Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Unit X3DShadowMaps
Description
Shadow maps internal utilities.
Uses
Overview
Functions and Procedures
Types
Constants
Description
Functions and Procedures
procedure ProcessShadowMapsReceivers(Model: TX3DNode; Shapes: TShapeTree; const Enable: boolean; const DefaultShadowMapSize: Cardinal); |
Automatically handle VRML/X3D "receiveShadows" field by inserting appropriate lower-level nodes.
If Enable is True , the appropriate lower-level nodes are added, or replaced (if they already existed, because you call ProcessShadowMapsReceivers again). If Enable is False , the appropriate nodes (added by previous calls to ProcessShadowMapsReceivers ) will be removed instead.
For each shape with "receiveShadows", we:
extend it's "texture" field with appropriate GeneratedShadowMap,
extend it's "texCoord" field with appropriate ProjectedTextureCoordinate,
|
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.
|
Constants
ShadowSamplingNames: array [TShadowSampling] of string =
( 'Simple', 'PCF 4', 'PCF 4 Bilinear', 'PCF 16', 'Variance Shadow Maps (Experimental)' ); |
|
DefaultShadowSampling = ssPCF16; |
|
Generated by PasDoc 0.13.0 on 2014-08-30 12:10:53
|