Gorilla.DefTypes

Unit Gorilla.DefTypes.pas
The following XML-Tag notation shows the internal structure of the definition types used inside of Gorilla3D. @ - is a reference to a specific instance List - represents an object list of a specific classtype -TModelDef // holds a list of TMeshDef instances -List::Children -TMeshDef|TVertexGroupDef|TLightDef|TCameraDef|TSegmentDef|... -@Model::TModelDef -/TMeshDef|TVertexGroupDef|TLightDef|TCameraDef|TSegmentDef|... -/List::Children -List::Materials -TMaterialDef -/List::Materials -List::Lights -TLightDef -/List::Lights -List::Cameras -TCameraDef -/List::Cameras // holds a list of TArmatureDef instances -List::Armatures -TArmatureDef -@Model::TModelDef // holds a list of TControllerDef references -@List::Controllers // represents a tree of TJointDef nodes -Root::TJointDef -TJointDef -TJointDef -TJointDef -TJointDef -/TJointDef -/TJointDef -/Root::TJointDef -/TArmatureDef -TArmatureDef [...] -/TArmatureDef -/List::Armatures // holds a list of TControllerDef instances -List::Controllers -TControllerDef -@Mesh::TMeshDef // is a sub component of TSkinDef -Skin::TSkinDef -TSkinDef -@Controller::TControllerDef // holds a list of TJointRefDef instances - these // are referenced objects to TJointDef instances -List::LinkedJoint -TJointRefDef -TJointRefDef -TJointRefDef -TJointRefDef -TJointRefDef [...] -/List::LinkedJoints // contains one or more joints as skeleton roots -List::Skeletons -TJointRefDef -TJointRefDef [...] -/List -/TSkinDef -/Skin::TSkinDef -/TControllerDef -TControllerDef [...] -/TControllerDef -/List::Controllers // holds a list of TAnimationDef instances -List::Animations -TAnimationDef -@Model::TModelDef // holds a list of TAnimationStageDef instances -List::Stages -TAnimationStageDef -List::Interpolators -TInterpolatorDef -TInterpolatorDef -TInterpolatorDef [...] -/List::Interpolators -/TAnimationStageDef -TAnimationStageDef [...] -/TAnimationStageDef -/List::Stages -/TAnimationDef -TAnimationDef [...] -/TAnimationDef -/List::Animations -/TModelDef

Classes

Records

Enumerations

  • enum  TGorillaFileOpenFormat  = ( fofLocal, fofDownload ) ;
  • enum  TAnimationCachingFlag  = ( AllAttributes, Compressed, VertexPosition ) ;
  • enum  TFaceIndexKind  = ( Triangle, Quad, Polygon ) ;
  • enum  TVertexDataFlag  = ( CalcNormals, CalcTangents, CalcTexCoords ) ;
  • enum  TVertexOrder  = ( CW, CCW ) ;
  • enum  TFaceOrientation  = ( FrontFace, BackFace, TwoFace ) ;
  • enum  TMeshDefCalculateNormalMethod  = ( cnmDefault, cnmFastest, cnmSlowest ) ;
  • enum  TJSONVertexDataType  = ( jvdtBinary, jvdtValues ) ;
  • enum  TColorChannelDef  = ( Diffuse, Ambient, Emissive, Specular, Normal, Opacity, Reflection, Refraction, Environment, Lightmap, Displacement, Metalness, Roughness, AO, HeightMap ) ;
  • enum  TTextureFlipping  = ( Vertical, Horizontal ) ;
  • enum  TMaterialDefKind  = ( mkDefault, mkColor, mkLambert, mkPhong, mkBlinnPhong, mkNormalMap, mkBumpMap, mkLayered, mkVertexColor, mkCustom, mkPBR ) ;
  • enum  TGorillaShadingModel  = ( smLambert, smPhong, smBlinnPhong, smPBR ) ;
  • enum  TAnimationKeyInterpolationType  = ( Linear, Quadratic, Cubic, Quartic, Quintic, Sinusoidal, Exponential, Circular, Elastic, Back, Bounce ) ;
  • enum  TKeyUnifyFlag  = ( AbsoluteKeyTransform, EqualBaseTransformCheck, InverseTransform, InverseBaseTransform, EvaluateGlobalTransform ) ;
  • enum  TAnimationBufferingState  = ( None, Started, Caching, Cached, Ready ) ;
  • enum  TUnifyInterpolatorOption  = ( EulerXYZ, EulerYXZ, EulerZXY, EulerZYX, EulerYZX, EulerXZY ) ;
  • enum  TCopyVertexOption  = ( ExchangeYZ, ExchangeYX, ExchangeXZ ) ;
  • enum  TCameraType  = ( PerspectiveCamera, OrthographicCamera ) ;

Constants

  • const GORILLA_POLYGON_MAXSIZE : Integer = $C;
  • const GORILLA_ARRAY_TEXTURE_MAX : Integer = $20;
  • const GORILLA_ARRAY_COLOR_MAX : Integer = $4;
  • const GORILLA_MAX_JOINTS_PER_VERTEX : Integer = $10;
  • const GORILLA_ANIMATION_CACHE_FRAMERATE_24 : Integer = $18;
  • const GORILLA_ANIMATION_CACHE_FRAMERATE_30 : Integer = $1E;
  • const GORILLA_ANIMATION_CACHE_FRAMERATE_60 : Integer = $3C;
  • const GORILLA_ANIMATION_CACHE_FRAMERATE : Integer = $18;
  • const GORILLA_INDEX_FORMAT : TIndexFormat = UInt16;
  • const GORILLA_SEGMENT_ID_FORMAT : string = "%%s_Seg";
  • const GORILLA_ANIMATION_CACHING_DEFAULT : TAnimationCachingFlags = ;
  • const GORILLA_ANIMATION_CACHING_COMPRESSEDEX : TAnimationCachingFlags = ;
  • const NullVertexID : TVertexID = ;
  • const GORILLA_TRANSFORM_CLASSES : :04 = ;

Mics. types

  • type TFloatType = Float;
  • type TIndexType = word;
  • type TTriangleID = array  [0..2]  of TVertexID;
  • type TPolygonID = array  of TVertexID;
  • type T3DPolygon = array  of TPoint3D;
  • type TTriangleIndex = array  [0..2]  of Word;
  • type PVertexData = pointer to TVertexData;
  • type TVertexTriangle = array  [0..2]  of TVertexData;
  • type PPolygon3D = pointer to TPolygon3D;
  • type TCustomDefClass = class of TCustomDef;
  • type TAnimationKeyInterpolationDynArray = array  of TInterpolationType;
  • type TTransformDefClass = class of TTransformDef;
  • type TJointRefDefClass = class of TJointRefDef;
  • type PVertexJoints = pointer to TVertexJoints;
  • type TMeshDefClass = class of TMeshDef;

Functions / Procedures

TGorillaFileOpenFormat

enum TGorillaFileOpenFormat = ( fofLocal, fofDownload ) ;

Defines the way Gorilla3D opens the file. fofLocal - this is the default value, if the file should be loaded from local harddrive. fofDownload - use this mode for download formats like sketchfab. the format itself will after the download open the file from cache or harddrive.

TAnimationCachingFlag

enum TAnimationCachingFlag = ( AllAttributes, Compressed, VertexPosition ) ;

Configuring caching mechanism. By these flags you can define the kind of caching used.

By default it's recommend to use TAnimationCachingFlag.VertexPosition only. This will only cache the vertex position in every frame directly inside of your GPU. This method is the fastest cache mechanism and will later only need a framebuffer switch while rendering. When having a lot of large animations this will stress GPU memory a lot. So its recommend for small animations which need fast switching and playback.

Compressed caching is recommend for large models and long animations, but will not create a framebuffer directly in GPU memory! Instead, on rendering time the cache will be decompressed and pushes afterwards data to the GPU memory. This is still much faster than animate a skin on runtime.

Remarks

AllAttributes - Caching all attributes of each vertex. This may be the fastest method, but memory usage is enormous! If possible use TAnimationCachingFlag.VertexPosition instead.

Compressed - Cached frames will be compressed inside the application memory. On MSWINDOWS x86 we use LZ4 compression for enourmous performance boost. On all other platforms we use ZLib compression algorithms by default.

VertexPosition - Cached frames will ONLY contain the vertex position. The other vertex data components will come from the static mesh buffer. This is the recommend setting for caching, because in 95%% of all cases you only need to transform vertex position on animation skin.

If "TAnimationCachingFlag.VertexPosition" option is set, the caching mechanism will create temporary mesh-vertexbuffers only with position data, instead of using the meshdata itself. So caching can push vertexbuffer directly to GPU memory, instead of extracting the VertexPosition from each vertex.

TVertexOrder

enum TVertexOrder = ( CW, CCW ) ;

Defines the order vertices are added to triangles or polygons.

Remarks

CW - Clockwise Vertex Order = [0, 2, 1]

CCW - Counter Clockwise Vertex Order = [1, 2, 0]

TFaceOrientation

enum TFaceOrientation = ( FrontFace, BackFace, TwoFace ) ;

Defines which face orientation should be rendered.

TColorChannelDef

enum TColorChannelDef = ( Diffuse, Ambient, Emissive, Specular, Normal, Opacity, Reflection, Refraction, Environment, Lightmap, Displacement, Metalness, Roughness, AO, HeightMap ) ;

Color Channel definition diffuse, ambient, emissive, specular, normal

TKeyUnifyFlag

enum TKeyUnifyFlag = ( AbsoluteKeyTransform, EqualBaseTransformCheck, InverseTransform, InverseBaseTransform, EvaluateGlobalTransform ) ;

Temporary interpolator unification flags. Due to some formats like FBX, where different versions need different unification treatment, we need some further information on how to unify.

TAnimationBufferingState

enum TAnimationBufferingState = ( None, Started, Caching, Cached, Ready ) ;

frame buffering states: "Started" - Framebuffer recording was started "Recording" - at least one frame was recorded "Buffered" - the framerate was reached and buffering is complete "Stopped" - recording process was stopped

TUnifyInterpolatorOption

enum TUnifyInterpolatorOption = ( EulerXYZ, EulerYXZ, EulerZXY, EulerZYX, EulerYZX, EulerXZY ) ;

Available options to auto-modify transformations in UnifyInterpolators() method.

TGorillaBitmapCache

Defines a storage for texture bitmaps. This can be applied when loading at designtime without any assets package.

Ancestors

Members

TCustomDef

default definition type as basis for all other types

Ancestors

Members

Fields

Methods

Properties

TMetaDef

Ancestors

Members

Fields

Methods

Properties

TImageDef

Not implemented yet! This should be used in future to define texture images abstractly.

Ancestors

Members

TSamplerDef

Not implemented yet! This should be used in future to set texture formats, wrapping and so on...

Ancestors

Members

Fields

Methods

Properties

TTextureDef

Ancestors

Members

Fields

Methods

Properties

TShaderDef

internal shader definition type by this type shader information can be stored

Ancestors

Members

TMaterialRefDef

internal material reference definition type by this type a reference to a specific material is handled

Ancestors

Members

TMaterialDef

internal material definition type by this type material information can be stored

Ancestors

Members

Fields

Methods

Properties

TInterpolatorDef`1

Ancestors

Members

Fields

Methods

Properties

TAnimationDef

internal animation definition type by this type animation information can be stored an animation represents a group of stages (TAnimationStageDef) and can be seen as a grouping object for easy access

Ancestors

Members

Fields

Methods

Properties

TTransformDef

Basic transformation definition with a transform matrix property

Ancestors

Members

Fields

Methods

Properties

TSegmentDef

We need a placeholder definition in mesh hierarchy to allow meshes to be attached to joints or armatures.

Ancestors

Members

TJointDef

Ancestors

Members

Fields

Methods

Properties

TJointRefDef

Ancestors

Members

Fields

Methods

Properties

TSkinDef

skin definition type

Ancestors

Members

Fields

Methods

Properties

TCustomMeshDef

custom mesh definition type defines the basic information for a mesh or model

Ancestors

Members

Fields

Methods

Properties

TMeshDef

internal mesh definition type by this type we can store vertex information, materials and shaders

Ancestors

Members

Fields

Methods

Properties

TVertexGroupDef

VertexGroups are helper structures referring to an owner mesh, which holds original vertex data and complete indices list, while this structure only holds a separated index source for partially rendering a mesh.

Remarks

VertexGroups are used f.e. in FBX format for rendering some triangles with a different material than others.

Ancestors

Members

TLightDef

Ancestors

Members

Fields

Methods

Properties

TModelDef

internal model definition type by this type we can group mesh definitions

Ancestors

Members

Fields

Methods

Properties

TVertexCache

Ancestors

Members

Fields

Methods

Properties