Class TCastleSceneLoadOptions
Unit
Declaration
type TCastleSceneLoadOptions = class(TCastleComponent)
Description
Optional model load options. Models are typically loaded using LoadNode or by setting TCastleScene.Url.
An instance of this class can be provided to LoadNode or set as TCastleScene.LoadOptions. It will then be passed to the model loader event TModelFormat.OnLoad.
Future notes: In the future this may be more extensible, as we will move all format-specific flags (like glTF specific) to a separate format-specific class (e.g. TGltfLoadOptions defined only in unit like CastleLoadGltf). This class TCastleSceneLoadOptions should then be a collection of such options (like glTF options, Spine options, etc.), e.g. map MimeType -> descendant of TModelLoadFormatOptions or just a list of TModelLoadFormatOptions (since their class already determines the format to which they apply). This way: caller LoadNode should not need to choose between format-specific options on its own (for simplicity) and also we need to allow exposing TCastleSceneLoadOptions in the editor as a component. For now, we just put all format-specific options in one large class, as this is the simplest.
Source: src/scene/load/x3dload.pas (line 55).
Hierarchy
- TObject
- TPersistent
- TComponent
- TCastleComponent
- TCastleSceneLoadOptions
Overview
Properties
![]() |
property GltfPhongMaterials: Boolean
read FGltfPhongMaterials write FGltfPhongMaterials default false; |
Description
Properties
![]() |
property GltfPhongMaterials: Boolean
read FGltfPhongMaterials write FGltfPhongMaterials default false; |
|
Makes model loaded from glTF use Phong materials (TMaterialNode) instead of Physically-Based Rendering materials (TPhysicalMaterialNode). Phong is a worse lighting model in general (less realistic, and most authoring tools now expose parameters closer to PBR, like Blender). However Phong lighting model is cheaper to compute, and it allows both Gouraud and Phong shading. And Phong lighting model combined with Gouraud shading is very cheap to render, which in effect means that your models render fast. If this is | |
Generated by PasDoc 0.17.0.snapshot.
