Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
0.8.3:deftypes [2021/07/21 15:19] – [Changelog] admin | 0.8.3:deftypes [2022/04/08 08:59] (current) – [Changelog] admin | ||
---|---|---|---|
Line 11: | Line 11: | ||
< | < | ||
-TModelDef | -TModelDef | ||
- | | + | // holds a list of TMeshDef instances |
| | ||
- | | + | |
- | // a reference to the owner model | + | // a reference to the owner model |
| | ||
- | | + | |
| | ||
Line 22: | Line 22: | ||
-List:: | -List:: | ||
| | ||
- | | + | // a reference to the owner model |
| | ||
- | | + | // holds a list of textures |
| | ||
| | ||
Line 31: | Line 31: | ||
| | ||
- | | + | // holds a list of shader codes |
| | ||
| | ||
Line 37: | Line 37: | ||
| | ||
- | | + | // holds a list of sub materials for layered material sources |
| | ||
| | ||
- | [...] | + | [...] |
| | ||
| | ||
| | ||
-/ | -/ | ||
+ | |||
+ | -List:: | ||
+ | -TLightDef | ||
+ | -/ | ||
+ | |||
+ | -List:: | ||
+ | -TCameraDef | ||
+ | -/ | ||
// holds a list of THumanoidDef instances | // holds a list of THumanoidDef instances | ||
| | ||
| | ||
- | | + | // a reference to the owner model |
| | ||
// holds a list of TControllerDef references | // holds a list of TControllerDef references | ||
Line 72: | Line 80: | ||
| | ||
| | ||
- | | + | // a reference to the mesh, the controller handles |
| | ||
Line 78: | Line 86: | ||
| | ||
| | ||
- | | + | // the owner controller of the skin definition |
| | ||
Line 92: | Line 100: | ||
| | ||
- | // contains | + | // contains |
- | -@Skeleton:: | + | -List::Skeletons |
+ | | ||
+ | | ||
+ | | ||
+ | -/ | ||
| | ||
| | ||
Line 105: | Line 117: | ||
| | ||
| | ||
- | | + | // reference to the owner model |
| | ||
Line 188: | 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 376: | 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 511: | 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 665: | Line 704: | ||
===== TODO ===== | ===== TODO ===== | ||
- | * Import/ | ||
* TSamplerDef integration | * TSamplerDef integration | ||
* TImageDef integration | * TImageDef integration | ||
Line 681: | Line 719: | ||
* TMaterialDefKind.mkVertexColor introduced for separation between Color and VertexColor rendering | * TMaterialDefKind.mkVertexColor introduced for separation between Color and VertexColor rendering | ||
* TMaterialDefKind.mkCustom introduced with new properties: ShadingModel, | * TMaterialDefKind.mkCustom introduced with new properties: ShadingModel, | ||
- | * 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]] |