Unit CastleScene

Description

Rendering of scenes (TCastleScene).

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TCastleScene Complete loading, processing and rendering of a scene.
Class TCastleSceneList  
Class TCastleRootTransform Root of transformations and scenes (tree of TCastleTransform and TCastleScene).
Class TCastleAbstractPrimitive Base class to express primitives that can be easily added and adjusted inside TCastleViewport.
Class TCastleText Text that is displayed and transformed as TCastleTransform, inside TCastleViewport, and can be manipulated in 3D.
Class TCastleBox Box with configurable size, position and material.
Class TCastleSphere Sphere with configurable size, position and material.
Class TCastlePlane Plane with configurable size, position and material.
Class TCastleCone Cone with configurable size, position and material.
Class TCastleCylinder Cylinder with configurable size, position and material.
Class TCastleImageTransform Image (that you can place within TCastleViewport) with configurable size and repeat.
Class TCastleBackground Background, a skybox with a color gradient to represent sky and ground behind.
Class TCastleFog Control fog in 3D world.
Class TCastleAbstractLight Base class to express lights that can be easily added and adjusted inside TCastleViewport.
Class TCastlePunctualLight Ancestor class for all punctual lights: point, spot, directional.
Class TCastlePointLight Point light is a point in 3D space that shines uniformly in all directions.
Class TCastleDirectionalLight Directional light shines along a direction in 3D space, simulating a light source far away (like a sun).
Class TCastleSpotLight Spot light shines a cone of light, from a given location, along a direction (-Z in local coordinates).

Types

TBeforeShapeRenderProc = procedure (Shape: TShape) of object;
TRenderingAttributesEvent = TCastleRenderOptionsEvent deprecated 'use TCastleRenderOptionsEvent';
TSceneRenderingAttributes = TCastleRenderOptions deprecated 'use TCastleRenderOptions';
TPrepareResourcesOption = CastleTransform.TPrepareResourcesOption;
TPrepareResourcesOptions = CastleTransform.TPrepareResourcesOptions;
TTransformOptimization = (...);
TCastleSceneClass = class of TCastleScene;
TTriangle4List = specialize TStructList<TTriangle4>;
TUseHeadlight = (...);
TPrimitiveMaterial = (...);

Constants

prRenderSelf = CastleTransform.prRenderSelf;
prRenderClones = CastleTransform.prRenderClones;
prBackground = CastleTransform.prBackground;
prBoundingBox = CastleTransform.prBoundingBox;
prShadowVolume = CastleTransform.prShadowVolume;
weNormal = CastleRenderOptions.weNormal;
weWireframeOnly = CastleRenderOptions.weWireframeOnly;
weSolidWireframe = CastleRenderOptions.weSolidWireframe;
weSilhouette = CastleRenderOptions.weSilhouette;

Variables

InternalEnableRendering: Boolean = true;
DynamicBatching: Boolean = false deprecated 'use TCastleViewport.DynamicBatching';

Description

Types

TBeforeShapeRenderProc = procedure (Shape: TShape) of object;

This item has no description.

TRenderingAttributesEvent = TCastleRenderOptionsEvent deprecated 'use TCastleRenderOptionsEvent';

Warning: this symbol is deprecated: use TCastleRenderOptionsEvent

This item has no description.

TSceneRenderingAttributes = TCastleRenderOptions deprecated 'use TCastleRenderOptions';

Warning: this symbol is deprecated: use TCastleRenderOptions

This item has no description.

TPrepareResourcesOption = CastleTransform.TPrepareResourcesOption;

This item has no description.

TPrepareResourcesOptions = CastleTransform.TPrepareResourcesOptions;

This item has no description.

TTransformOptimization = (...);

Possible values for TCastleScene.TransformOptimization.

Values
  • toAutomatic: Automatically decide whether the transformation of this scene changes often enough to prefer optimizations for toStatic or toDynamic case.

    Right now, this behaves like toDynamic when the scene is present multiple times in the TAbstractRootTransform hierarchy, for example when using TCastleTransformReference to render the same scene many times. Otherwise this behaves like toStatic.

    This automatic detection may make unoptimal decision, which is why you can set TCastleScene.TransformOptimization explicitly to toStatic or toDynamic if you "know better". Examples when it makes sense to manually select optimization:

    • When the scene is present multiple times in the TAbstractRootTransform hierarchy (e.g. when using TCastleTransformReference) but all these occurences are very close to each other, thus are within radiuses of the same lights.

      In this case, automatic detection makes unoptimal decision to behave like toDynamic, which means shaders calculate more light sources. Setting TCastleScene.TransformOptimization to toStatic in this case is better.

    • When the scene is present only once in the TAbstractRootTransform hierarchy, but you know that you will change the scene translation very often (e.g. almost every frame) and the translation change will be large enough to make the scene affected by different light sources. Or maybe you know you will change the light's positions or radiuses very often by large values.

      In this case, automatic detection makes unoptimal decision to behave like toStatic, which means that shaders will be often recreated when the scene (or light sources) move. Setting TCastleScene.TransformOptimization to toDynamic in this case is better, it means that shaders for this shape will not change.

  • toStatic: Choose optimizations that are beneficial for TCastleScene instances whose world transformation (translation, rotation, scale of this and all parents) never changes, or rarely changes, or changes only by a very small amount.
  • toDynamic: Choose optimizations that are beneficial for TCastleScene instances whose world transformation (translation, rotation, scale of this and all parents) changes often and by large values.
TCastleSceneClass = class of TCastleScene;

This item has no description.

TTriangle4List = specialize TStructList<TTriangle4>;

This item has no description.

TUseHeadlight = (...);

Possible value of TCastleRootTransform.UseHeadlight.

Values
TPrimitiveMaterial = (...);

Primitive material type, used by TCastleAbstractPrimitive.Material.

Values
  • pmPhysical
  • pmPhong
  • pmUnlit

Constants

prRenderSelf = CastleTransform.prRenderSelf;

This item has no description.

prRenderClones = CastleTransform.prRenderClones;

This item has no description.

prBackground = CastleTransform.prBackground;

This item has no description.

prBoundingBox = CastleTransform.prBoundingBox;

This item has no description.

prShadowVolume = CastleTransform.prShadowVolume;

This item has no description.

weNormal = CastleRenderOptions.weNormal;

This item has no description.

weWireframeOnly = CastleRenderOptions.weWireframeOnly;

This item has no description.

weSolidWireframe = CastleRenderOptions.weSolidWireframe;

This item has no description.

weSilhouette = CastleRenderOptions.weSilhouette;

This item has no description.

Variables

InternalEnableRendering: Boolean = true;

This item has no description.

DynamicBatching: Boolean = false deprecated 'use TCastleViewport.DynamicBatching';

Warning: this symbol is deprecated: use TCastleViewport.DynamicBatching

This item has no description.


Generated by PasDoc 0.16.0-snapshot.