Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.3:deftypes [2022/04/08 08:35] – [Structure] admin | 0.8.3:deftypes [2022/04/08 08:59] (current) – [Changelog] admin | ||
---|---|---|---|
Line 40: | Line 40: | ||
| | ||
| | ||
- | [...] | + | [...] |
| | ||
| | ||
Line 102: | Line 102: | ||
// contains one or more joints as skeleton roots | // contains one or more joints as skeleton roots | ||
-List:: | -List:: | ||
- | | + | |
- | -TJointRefDef | + | -TJointRefDef |
- | | + | [...] |
- | | + | -/List::Skeletons |
| | ||
| | ||
Line 200: | Line 200: | ||
===== TModelDef ===== | ===== TModelDef ===== | ||
- | The TModelDef structure is representing a scene consisting of meshes, materials, lights and animations. | + | The TModelDef structure is representing a scene consisting of meshes, materials, lights, cameras |
It does not contain mesh information itself. Instead sub meshes are attached which hold those kind of information. | It does not contain mesh information itself. Instead sub meshes are attached which hold those kind of information. | ||
Line 388: | Line 388: | ||
// Self = TModelDef | // Self = TModelDef | ||
LLightDef := TLightDef.Create(Self); | LLightDef := TLightDef.Create(Self); | ||
+ | LLightDef.LightType := TLightType.Spot; | ||
+ | LLightDef.Direction := Point3D(0, 1, 0); | ||
LLightDef.Diffuse := TAlphaColorF.Create(1, | LLightDef.Diffuse := TAlphaColorF.Create(1, | ||
LLightDef.Ambient := TAlphaColorF.Create(0.5, | LLightDef.Ambient := TAlphaColorF.Create(0.5, | ||
+ | LLightDef.Specular := TAlphaColorF.Create(0.15, | ||
+ | LLightDef.Intensity := 1; | ||
+ | // attenuation values are configurable but have no effect on rendering yet, due to FMX limitations | ||
+ | LLightDef.ConstantAttenuation := 1.0; | ||
+ | LLightDef.LinearAttenuation := 0; | ||
+ | LLightDef.QuadraticAttenuation := 0; | ||
+ | LLightDef.SpotCutOff := 180; | ||
+ | LLightDef.SpotExponent := 0; | ||
LLightDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, | LLightDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, | ||
</ | </ | ||
+ | ==== Cameras ==== | ||
+ | |||
+ | Gorilla3D is also able to manage logical instances for cameras. It is very common for 3D file formats to export camera information. | ||
+ | |||
+ | <file pascal> | ||
+ | // Self = TModelDef | ||
+ | LCamDef := TCameraDef.Create(Self); | ||
+ | LCamDef._Type := TCameraType.PerspectiveCamera; | ||
+ | LCamDef.Target := ' | ||
+ | LCamDef.FOV := 45; | ||
+ | LCamDef.AspectRatio := 16 / 9; | ||
+ | // near and far plane are configurable, | ||
+ | // due to hardcoded constant values in FMX framework | ||
+ | LCamDef.NearPlane := 1; | ||
+ | LCamDef.FarPlane := 1000; | ||
+ | LCamDef.Transform := TMatrix3D.CreateTranslation(TPoint3D.Create(0, | ||
+ | </ | ||
==== Shaders ==== | ==== Shaders ==== | ||
Line 523: | Line 550: | ||
=== AnimationStage === | === AnimationStage === | ||
- | An animation stage is directly referred to a specific | + | An animation stage is directly referred to a specific |
<file pascal> | <file pascal> | ||
Line 677: | Line 704: | ||
===== TODO ===== | ===== TODO ===== | ||
- | * Import/ | ||
* TSamplerDef integration | * TSamplerDef integration | ||
* TImageDef integration | * TImageDef integration | ||
Line 695: | Line 721: | ||
* late resolving of humanoid controllers, | * late resolving of humanoid controllers, | ||
* on loading g3d files, the loader now adds the path of the g3d to texture paths, if they are relative | * on loading g3d files, the loader now adds the path of the g3d to texture paths, if they are relative | ||
+ | * multiple skeletons per skindef allowed | ||
Next step: [[transparency|Transparency]] | Next step: [[transparency|Transparency]] |