2
0
GLScene 5 жил өмнө
parent
commit
058f42a99f
38 өөрчлөгдсөн 821 нэмэгдсэн , 702 устгасан
  1. 1 1
      Demos/CPP/materials/multimaterial/Unit1.cpp
  2. 1 1
      Demos/CPP/materials/multimaterial/Unit1.h
  3. 1 0
      Demos/Delphi/materials/TransparencyAdvanced/uDemo.dfm
  4. 19 5
      Demos/Delphi/materials/TransparencyAdvanced/uDemo.pas
  5. 1 1
      Demos/Delphi/materials/cubemap/cubemap.dproj
  6. 1 1
      Demos/Delphi/materials/dynamictexture/dynamictexture.dproj
  7. 1 1
      Demos/Delphi/materials/dyncubemap/dyncubemap.dproj
  8. 2 2
      Demos/Delphi/materials/multimaterial/Unit1.pas
  9. 1 1
      Demos/Delphi/materials/multimaterial/multimaterial.dproj
  10. 1 0
      Demos/Delphi/materials/multipass/Unit1.dfm
  11. 1 1
      Demos/Delphi/materials/multipass/multipass.dproj
  12. 1 0
      Demos/Delphi/materials/texcombine/Unit1.dfm
  13. 1 2
      Demos/Delphi/materials/texcombine/Unit1.pas
  14. 1 1
      Demos/Delphi/materials/texcombine/texcombine.dproj
  15. 1 1
      Demos/Delphi/meshes/CSG/CSG.dproj
  16. 2 2
      Demos/Delphi/meshes/actorms3d/ufrmMain.pas
  17. 1 1
      Demos/Delphi/meshes/mushroom/Mushroom.dproj
  18. 1 1
      Demos/Delphi/meshes/portal/portal.dproj
  19. 3 4
      Demos/Delphi/meshes/shadedterrain/Unit1.pas
  20. 232 111
      Demos/Delphi/meshes/shadedterrain/shadedterrain.dproj
  21. 1 1
      Demos/Delphi/meshes/tiles/tiles.dproj
  22. 1 1
      Demos/Delphi/meshes/tree/tree.dproj
  23. 1 1
      Packages/GLScene_RT.dpk
  24. 1 1
      Packages/GLScene_RT.dproj
  25. 0 1
      Source/FileDXTC.pas
  26. 4 20
      Source/GLBaseMeshSilhouette.pas
  27. 3 2
      Source/GLFileDDS.pas
  28. 1 1
      Source/GLGeomObjects.pas
  29. 1 1
      Source/GLMaterialMultiProxy.pas
  30. 1 1
      Source/GLMultiProxy.pas
  31. 1 1
      Source/GLObjects.pas
  32. 1 1
      Source/GLS.SceneRegister.pas
  33. 18 18
      Source/GLSL.TextureShaders.pas
  34. 1 1
      Source/GLScene.pas
  35. 1 1
      Source/GLShadowVolume.pas
  36. 1 0
      Source/GLTextureFormat.pas
  37. 5 5
      Source/GLVectorFileObjects.pas
  38. 506 508
      Source/Scene.Silhouette.pas

+ 1 - 1
Demos/CPP/materials/multimaterial/Unit1.cpp

@@ -14,7 +14,7 @@
 #pragma link "GLMultiMaterialShader"
 #pragma link "GLObjects"
 #pragma link "GLScene"
-#pragma link "GLTexCombineShader"
+#pragma link "GLTS.TextureCombineShader"
 #pragma link "GLSceneViewer"
 #pragma resource "*.dfm"
 TForm1 *Form1;

+ 1 - 1
Demos/CPP/materials/multimaterial/Unit1.h

@@ -16,7 +16,7 @@
 #include "Scene.VectorGeometry.hpp"
 #include "GLCadencer.hpp"
 #include "GLMultiMaterialShader.hpp"
-#include "GLTexCombineShader.hpp"
+#include "GLSL.TexureCombineShader.hpp"
 #include "GLMaterial.hpp"
 #include "GLCoordinates.hpp"
 #include "GLCrossPlatform.hpp"

+ 1 - 0
Demos/Delphi/materials/TransparencyAdvanced/uDemo.dfm

@@ -29,6 +29,7 @@ object Form1: TForm1
     Buffer.FaceCulling = False
     Buffer.ShadeModel = smFlat
     FieldOfView = 162.073303222656300000
+    PenAsTouch = False
     Align = alClient
     TabOrder = 0
   end

+ 19 - 5
Demos/Delphi/materials/TransparencyAdvanced/uDemo.pas

@@ -3,6 +3,7 @@ unit uDemo;
 interface
 
 uses
+  Winapi.OpenGL,
   System.SysUtils,
   System.Variants,
   System.Classes,
@@ -12,17 +13,30 @@ uses
   Vcl.Imaging.Jpeg,
 
   OpenGLTokens,
+  Scene.VectorGeometry,
+  Scene.VectorTypes,
+  GLContext,
+  GLState,
+  GLColor,
   GLScene,
   GLObjects,
   GLCoordinates,
   GLFileJPEG,
   GLSimpleNavigation,
   GLMaterial,
-  GLCadencer, GLCrossPlatform, GLBaseClasses, GLSceneViewer, GLS.ShaderCustom,
-  GLSL.Shader, GLTexture, GLFBORenderer, GLRenderContextInfo, GLGeomObjects,
-  GLMesh, GLHUDObjects, GLBitmapFont, GLWindowsFont, Scene.VectorGeometry,
-  Scene.VectorTypes, GLContext, GLState,
-  GLColor,
+  GLCadencer, GLCrossPlatform,
+  GLBaseClasses,
+  GLSceneViewer,
+  GLSL.Shader,
+  GLSL.CustomShader,
+  GLTexture,
+  GLFBORenderer,
+  GLRenderContextInfo,
+  GLGeomObjects,
+  GLMesh,
+  GLHUDObjects,
+  GLBitmapFont,
+  GLWindowsFont,
   GLKeyBoard,
   GLCompositeImage,
 

+ 1 - 1
Demos/Delphi/materials/cubemap/cubemap.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Demos/Delphi/materials/dynamictexture/dynamictexture.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Demos/Delphi/materials/dyncubemap/dyncubemap.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 2 - 2
Demos/Delphi/materials/multimaterial/Unit1.pas

@@ -20,8 +20,8 @@ uses
   GLTexture,
   Scene.VectorGeometry,
   GLCadencer,
-  GLMultiMaterialShader,
-  GLTexCombineShader,
+  GLSL.MultiMaterialShader,
+  GLSL.TextureShaders,
   GLMaterial,
   GLCoordinates,
   GLCrossPlatform,

+ 1 - 1
Demos/Delphi/materials/multimaterial/multimaterial.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 0
Demos/Delphi/materials/multipass/Unit1.dfm

@@ -20,6 +20,7 @@ object Form1: TForm1
     Height = 325
     Camera = GLCamera1
     FieldOfView = 145.794540405273400000
+    PenAsTouch = False
     Align = alClient
     OnMouseDown = GLSceneViewer1MouseDown
     OnMouseMove = GLSceneViewer1MouseMove

+ 1 - 1
Demos/Delphi/materials/multipass/multipass.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 0
Demos/Delphi/materials/texcombine/Unit1.dfm

@@ -87,6 +87,7 @@ object Form1: TForm1
     Buffer.BackgroundColor = clGray
     Buffer.Lighting = False
     FieldOfView = 121.890792846679700000
+    PenAsTouch = False
     TabOrder = 0
   end
   object BUApply: TButton

+ 1 - 2
Demos/Delphi/materials/texcombine/Unit1.pas

@@ -18,13 +18,12 @@ uses
   GLTexture,
   GLObjects,
   GLSceneViewer,
-  GLTexCombineShader,
+  GLSL.TextureShaders,
   GLHUDObjects,
   GLMaterial,
   GLCoordinates,
   GLCrossPlatform,
   GLBaseClasses,
-  GLTextureCombiners,
   GLS.Utils;
 
 type

+ 1 - 1
Demos/Delphi/materials/texcombine/texcombine.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Demos/Delphi/meshes/CSG/CSG.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 2 - 2
Demos/Delphi/meshes/actorms3d/ufrmMain.pas

@@ -32,8 +32,8 @@ uses
   GLGraphics,
   Scene.VectorTypes,
   GLRenderContextInfo,
-  GLS.ShaderCustom,
   GLSL.Shader,
+  GLSL.CustomShader,
   GLFBORenderer,
   GLShadowPlane,
   Scene.VectorGeometry,
@@ -42,7 +42,7 @@ uses
   GLGui,
   GLWindows,
   GLState,
-  GLSArchiveManager,
+  GLS.ArchiveManager,
   GLContext,
   GLCompositeImage,
   GLFileTGA,

+ 1 - 1
Demos/Delphi/meshes/mushroom/Mushroom.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Demos/Delphi/meshes/portal/portal.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 3 - 4
Demos/Delphi/meshes/shadedterrain/Unit1.pas

@@ -16,8 +16,8 @@ uses
   Vcl.ComCtrls,
   Vcl.StdCtrls,
 
-  GLS.OpenGLx,
   GLScene,
+  GLBaseClasses,
   GLObjects,
   GLKeyboard,
   GLTerrainRenderer,
@@ -26,17 +26,16 @@ uses
   GLTexture,
   GLSkydome,
   GLSceneViewer,
+  Scene.VectorTypes,
   Scene.VectorGeometry,
   GLLensFlare,
   GLBumpmapHDS,
-  GLTexCombineShader,
   GLMaterial,
   GLCoordinates,
   GLCrossPlatform,
   GLState,
   GLS.Utils,
-  GLBaseClasses,
-  Scene.VectorTypes;
+  GLSL.TextureShaders;
 
 type
   TForm1 = class(TForm)

+ 232 - 111
Demos/Delphi/meshes/shadedterrain/shadedterrain.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>
@@ -180,20 +180,12 @@
                         <RemoteDir>classes</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>classes</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidFileProvider">
                     <Platform Name="Android">
                         <RemoteDir>res\xml</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\xml</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidGDBServer">
                     <Platform Name="Android">
@@ -206,10 +198,6 @@
                         <RemoteDir>library\lib\armeabi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>library\lib\armeabi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidLibnativeArmeabiv7aFile">
                     <Platform Name="Android64">
@@ -222,10 +210,6 @@
                         <RemoteDir>library\lib\mips</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>library\lib\mips</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidLibnativeX86File"/>
                 <DeployClass Name="AndroidServiceOutput">
@@ -233,10 +217,6 @@
                         <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidServiceOutput_Android32">
                     <Platform Name="Android64">
@@ -249,200 +229,120 @@
                         <RemoteDir>res\drawable</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidSplashStyles">
                     <Platform Name="Android">
                         <RemoteDir>res\values</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\values</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="AndroidSplashStylesV21">
                     <Platform Name="Android">
                         <RemoteDir>res\values-v21</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\values-v21</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_Colors">
                     <Platform Name="Android">
                         <RemoteDir>res\values</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\values</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_DefaultAppIcon">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_LauncherIcon144">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xxhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_LauncherIcon36">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-ldpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-ldpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_LauncherIcon48">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-mdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-mdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_LauncherIcon72">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-hdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-hdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_LauncherIcon96">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_NotificationIcon24">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-mdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-mdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_NotificationIcon36">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-hdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-hdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_NotificationIcon48">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xhdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_NotificationIcon72">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xxhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xxhdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_NotificationIcon96">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xxxhdpi</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_SplashImage426">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-small</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-small</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_SplashImage470">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-normal</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-normal</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_SplashImage640">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-large</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-large</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_SplashImage960">
                     <Platform Name="Android">
                         <RemoteDir>res\drawable-xlarge</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\drawable-xlarge</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="Android_Strings">
                     <Platform Name="Android">
                         <RemoteDir>res\values</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>res\values</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="DebugSymbols">
                     <Platform Name="iOSSimulator">
@@ -531,9 +431,6 @@
                     <Platform Name="Android">
                         <Operation>0</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <Operation>0</Operation>
-                    </Platform>
                     <Platform Name="iOSDevice32">
                         <Operation>0</Operation>
                     </Platform>
@@ -566,6 +463,17 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPad_Launch1024x768">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPad_Launch1536">
                     <Platform Name="iOSDevice32">
                         <Operation>1</Operation>
@@ -577,6 +485,39 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPad_Launch1536x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch1668x2388">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPad_Launch2048">
                     <Platform Name="iOSDevice32">
                         <Operation>1</Operation>
@@ -588,6 +529,61 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPad_Launch2048x1536">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2048x2732">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2224">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2388x1668">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPad_Launch2732x2048">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPad_Launch2x">
                     <Platform Name="iOSDevice64">
                         <RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
@@ -609,6 +605,17 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPad_Launch768x1024">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPad_LaunchDark2x">
                     <Platform Name="iOSDevice64">
                         <RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
@@ -619,6 +626,105 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPhone_Launch1125">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1136x640">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1242x2688">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1334">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch1792">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2208">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2436">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch2688x1242">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPhone_Launch2x">
                     <Platform Name="iOSDevice64">
                         <RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
@@ -672,6 +778,28 @@
                         <Operation>1</Operation>
                     </Platform>
                 </DeployClass>
+                <DeployClass Name="iPhone_Launch750">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
+                <DeployClass Name="iPhone_Launch828">
+                    <Platform Name="iOSDevice32">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSDevice64">
+                        <Operation>1</Operation>
+                    </Platform>
+                    <Platform Name="iOSSimulator">
+                        <Operation>1</Operation>
+                    </Platform>
+                </DeployClass>
                 <DeployClass Name="iPhone_LaunchDark2x">
                     <Platform Name="iOSDevice64">
                         <RemoteDir>..\$(PROJECTNAME).launchscreen\Assets\LaunchScreenImage.imageset</RemoteDir>
@@ -696,9 +824,6 @@
                     <Platform Name="Android">
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <Operation>1</Operation>
-                    </Platform>
                 </DeployClass>
                 <DeployClass Name="ProjectiOSDeviceDebug">
                     <Platform Name="iOSDevice32">
@@ -801,10 +926,6 @@
                         <RemoteDir>library\lib\armeabi-v7a</RemoteDir>
                         <Operation>1</Operation>
                     </Platform>
-                    <Platform Name="Android64">
-                        <RemoteDir>library\lib\arm64-v8a</RemoteDir>
-                        <Operation>1</Operation>
-                    </Platform>
                     <Platform Name="iOSDevice32">
                         <Operation>1</Operation>
                     </Platform>

+ 1 - 1
Demos/Delphi/meshes/tiles/tiles.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Demos/Delphi/meshes/tree/tree.dproj

@@ -8,7 +8,7 @@
         <AppType>Application</AppType>
         <FrameworkType>VCL</FrameworkType>
         <ProjectVersion>19.0</ProjectVersion>
-        <Platform Condition="'$(Platform)'==''">Win64</Platform>
+        <Platform Condition="'$(Platform)'==''">Win32</Platform>
     </PropertyGroup>
     <PropertyGroup Condition="'$(Config)'=='Base' or '$(Base)'!=''">
         <Base>true</Base>

+ 1 - 1
Packages/GLScene_RT.dpk

@@ -227,7 +227,7 @@ contains
   GLShadowHDS in '..\Source\GLShadowHDS.pas',
   GLShadowPlane in '..\Source\GLShadowPlane.pas',
   GLShadowVolume in '..\Source\GLShadowVolume.pas',
-  GLSilhouette in '..\Source\GLSilhouette.pas',
+  Scene.Silhouette in '..\Source\Scene.Silhouette.pas',
   GLSimpleNavigation in '..\Source\GLSimpleNavigation.pas',
   GLSkyBox in '..\Source\GLSkyBox.pas',
   GLSkydome in '..\Source\GLSkydome.pas',

+ 1 - 1
Packages/GLScene_RT.dproj

@@ -330,7 +330,7 @@
         <DCCReference Include="..\Source\GLShadowHDS.pas"/>
         <DCCReference Include="..\Source\GLShadowPlane.pas"/>
         <DCCReference Include="..\Source\GLShadowVolume.pas"/>
-        <DCCReference Include="..\Source\GLSilhouette.pas"/>
+        <DCCReference Include="..\Source\Scene.Silhouette.pas"/>
         <DCCReference Include="..\Source\GLSimpleNavigation.pas"/>
         <DCCReference Include="..\Source\GLSkyBox.pas"/>
         <DCCReference Include="..\Source\GLSkydome.pas"/>

+ 0 - 1
Source/FileDXTC.pas

@@ -19,7 +19,6 @@ uses
    Winapi.OpenGLext,
    System.SysUtils,
    
-   OpenGLTokens,
    GLTextureFormat;
 
 const

+ 4 - 20
Source/GLBaseMeshSilhouette.pas

@@ -15,7 +15,7 @@ uses
   Scene.VectorGeometry, 
   Scene.VectorLists, 
   GLVectorFileObjects, 
-  GLSilhouette;
+  Scene.Silhouette;
 
 type
   TGLFaceGroupConnectivity = class(TConnectivity)
@@ -25,7 +25,7 @@ type
     procedure SetMeshObject(const Value: TMeshObject);
   public
     procedure Clear; override;
-    { Builds the connectivity information. }
+    // Builds the connectivity information.
     procedure RebuildEdgeList;
     property MeshObject: TMeshObject read FMeshObject write SetMeshObject;
     constructor Create(APrecomputeFaceNormal: boolean); override;
@@ -48,9 +48,9 @@ type
     property FaceGroupConnectivity[i: integer]: TGLFaceGroupConnectivity read GetFaceGroupConnectivity;
     property BaseMesh: TGLBaseMesh read FBaseMesh write SetBaseMesh;
     procedure Clear(SaveFaceGroupConnectivity: boolean);
-    { Builds the connectivity information. }
+    // Builds the connectivity information.
     procedure RebuildEdgeList;
-    procedure CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var aSilhouette: TGLSilhouette; 
+    procedure CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var aSilhouette: TGLSilhouette;
 	  AddToSilhouette: boolean);
     constructor Create(APrecomputeFaceNormal: boolean); override;
     constructor CreateFromMesh(aBaseMesh: TGLBaseMesh);
@@ -93,23 +93,17 @@ constructor TGLFaceGroupConnectivity.Create(APrecomputeFaceNormal: boolean);
 procedure TGLFaceGroupConnectivity.SetMeshObject(const Value: TMeshObject);
   begin
     Clear;
-
     FMeshObject := Value;
-
     if FOwnsVertices then
       FVertices.Free;
-
     FVertices := FMeshObject.Vertices;
-
     FOwnsVertices := false;
-
     RebuildEdgeList;
   end;
 
 constructor TGLFaceGroupConnectivity.CreateFromMesh(aMeshObject: TMeshObject; APrecomputeFaceNormal: boolean);
   begin
     Create(APrecomputeFaceNormal);
-
     MeshObject := aMeshObject;
   end;
 
@@ -117,7 +111,6 @@ destructor TGLFaceGroupConnectivity.Destroy;
   begin
     if FOwnsVertices then
       FVertices.Free;
-
     FVertices := nil;
     inherited;
   end;
@@ -130,13 +123,11 @@ procedure TGLFaceGroupConnectivity.RebuildEdgeList;
   begin
     // Make sure that the connectivity information is empty
     Clear;
-
     // Create a list of edges for the meshobject
     for iFaceGroup := 0 to FMeshObject.FaceGroups.Count - 1 do
     begin
       Assert(FMeshObject.FaceGroups[iFaceGroup] is TFGVertexIndexList, 'Method only works for descendants of TFGVertexIndexList.');
       FaceGroup := TFGVertexIndexList(FMeshObject.FaceGroups[iFaceGroup]);
-
       case FaceGroup.Mode of
         fgmmTriangles, fgmmFlatTriangles:
           begin
@@ -220,21 +211,16 @@ procedure TGLBaseMeshConnectivity.SetBaseMesh(const Value: TGLBaseMesh);
     Connectivity: TGLFaceGroupConnectivity;
   begin
     Clear(false);
-
     FBaseMesh := Value;
-
     // Only precompute normals if the basemesh isn't an actor (because they change)
     FPrecomputeFaceNormal := not(Value is TGLActor);
     FBaseMesh := Value;
-
     for i := 0 to Value.MeshObjects.Count - 1 do
     begin
       MO := Value.MeshObjects[i];
-
       if MO.Visible then
       begin
         Connectivity := TGLFaceGroupConnectivity.CreateFromMesh(MO, FPrecomputeFaceNormal);
-
         FFaceGroupConnectivityList.Add(Connectivity);
       end;
     end;
@@ -248,7 +234,6 @@ begin
     aSilhouette := TGLSilhouette.Create
   else
     aSilhouette.Flush;
-
   for i := 0 to ConnectivityCount - 1 do
     FaceGroupConnectivity[i].CreateSilhouette(silhouetteParameters, aSilhouette, true);
 end;
@@ -257,7 +242,6 @@ destructor TGLBaseMeshConnectivity.Destroy;
   begin
     Clear(false);
     FFaceGroupConnectivityList.Free;
-
     inherited;
   end;
 

+ 3 - 2
Source/GLFileDDS.pas

@@ -17,7 +17,6 @@ uses
   System.SysUtils,
   System.Math,
 
-  OpenGLTokens,
   GLContext,
   GLGraphics,
   GLTextureFormat,
@@ -602,8 +601,10 @@ begin
   Result := [dfcRead, dfcWrite];
 end;
 
+//----------------------------------------------
 initialization
-  { Register this Fileformat-Handler with GLScene }
+//----------------------------------------------
+
   RegisterRasterFormat('dds', 'Direct Draw Surface', TGLDDSImage);
 
 end.

+ 1 - 1
Source/GLGeomObjects.pas

@@ -23,7 +23,7 @@ uses
   Scene.VectorLists,
   GLContext,
   GLObjects,
-  GLSilhouette,
+  Scene.Silhouette,
   Scene.VectorTypes,
   GLGeometryBB,
   GLRenderContextInfo,

+ 1 - 1
Source/GLMaterialMultiProxy.pas

@@ -34,7 +34,7 @@ uses
   Scene.VectorGeometry,
   GLTexture,
   GLMaterial,
-  GLSilhouette,
+  Scene.Silhouette,
   Scene.Strings,
   GLCrossPlatform,
   Scene.PersistentClasses,

+ 1 - 1
Source/GLMultiProxy.pas

@@ -19,7 +19,7 @@ uses
   GLContext,
   GLScene,
   Scene.VectorGeometry,
-  GLSilhouette,
+  Scene.Silhouette,
   GLRenderContextInfo,
   GLBaseClasses,
   Scene.VectorTypes;

+ 1 - 1
Source/GLObjects.pas

@@ -35,7 +35,7 @@ uses
   Scene.VectorLists,
   GLPipelineTransformation,
   GLContext,
-  GLSilhouette,
+  Scene.Silhouette,
   GLColor,
   GLRenderContextInfo,
   Scene.PersistentClasses,

+ 1 - 1
Source/GLS.SceneRegister.pas

@@ -1543,7 +1543,7 @@ begin
     TGLHeightTileFileHDS, TGLBumpmapHDS, TGLPerlinHDS, TGLTexturedHDS,
     TGLAsyncHDS, TGLShadowHDS]);
 
-  RegisterComponents('GLScene Shaders', [TGLTextureCombineShader, TGLPhongShader,
+  RegisterComponents('GLScene Shaders', [TGLTexCombineShader, TGLPhongShader,
     TGLUserShader, TGLHiddenLineShader, TGLCelShader, TGLOutlineShader,
     TGLMultiMaterialShader, TGLBumpShader, TGLSLShader,
     TGLSLDiffuseSpecularShader, TGLSLBumpShader, TGLAsmShader,

+ 18 - 18
Source/GLSL.TextureShaders.pas

@@ -132,7 +132,7 @@ type
 (* A shader that allows texture combiner setup. *)
 
   // A shader that can setup the texture combiner.
-  TGLTextureCombineShader = class(TGLShader)
+  TGLTexCombineShader = class(TGLShader)
   private
     FCombiners: TStringList;
     FCommandCache: TCombinerCache;
@@ -649,10 +649,10 @@ begin
 end;
 
 // ------------------
-// ------------------ TGLTextureCombineShader ------------------
+// ------------------ TGLTexCombineShader ------------------
 // ------------------
 
-constructor TGLTextureCombineShader.Create(AOwner: TComponent);
+constructor TGLTexCombineShader.Create(AOwner: TComponent);
 begin
   inherited;
   ShaderStyle := ssLowLevel;
@@ -662,7 +662,7 @@ begin
   FCommandCache := nil;
 end;
 
-destructor TGLTextureCombineShader.Destroy;
+destructor TGLTexCombineShader.Destroy;
 begin
   if Assigned(currentLibMaterial3) then
     currentLibMaterial3.UnregisterUser(Self);
@@ -672,7 +672,7 @@ begin
   FCombiners.Free;
 end;
 
-procedure TGLTextureCombineShader.Notification(AComponent: TComponent; Operation: TOperation);
+procedure TGLTexCombineShader.Notification(AComponent: TComponent; Operation: TOperation);
 begin
   if (FMaterialLibrary = AComponent) and (Operation = opRemove) then
   begin
@@ -683,7 +683,7 @@ begin
   inherited;
 end;
 
-procedure TGLTextureCombineShader.NotifyChange(Sender: TObject);
+procedure TGLTexCombineShader.NotifyChange(Sender: TObject);
 begin
   FCombinerIsValid := True;
   FCommandCache := nil;
@@ -691,21 +691,21 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.NotifyLibMaterial3Destruction;
+procedure TGLTexCombineShader.NotifyLibMaterial3Destruction;
 begin
   FLibMaterial3Name := '';
   currentLibMaterial3 := nil;
 end;
 
 
-procedure TGLTextureCombineShader.NotifyLibMaterial4Destruction;
+procedure TGLTexCombineShader.NotifyLibMaterial4Destruction;
 begin
   FLibMaterial4Name := '';
   currentLibMaterial4 := nil;
 end;
 
 
-procedure TGLTextureCombineShader.SetMaterialLibrary(const val: TGLMaterialLibrary);
+procedure TGLTexCombineShader.SetMaterialLibrary(const val: TGLMaterialLibrary);
 begin
   FMaterialLibrary := val;
   SetLibMaterial3Name(LibMaterial3Name);
@@ -713,7 +713,7 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.SetLibMaterial3Name(const val: TGLLibMaterialName);
+procedure TGLTexCombineShader.SetLibMaterial3Name(const val: TGLLibMaterialName);
 var
   newLibMaterial: TGLLibMaterial;
 begin
@@ -738,7 +738,7 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.SetLibMaterial4Name(const val: TGLLibMaterialName);
+procedure TGLTexCombineShader.SetLibMaterial4Name(const val: TGLLibMaterialName);
 var
   newLibMaterial: TGLLibMaterial;
 begin
@@ -763,12 +763,12 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.DoInitialize(var rci: TGLRenderContextInfo; Sender: TObject);
+procedure TGLTexCombineShader.DoInitialize(var rci: TGLRenderContextInfo; Sender: TObject);
 begin
 end;
 
 
-procedure TGLTextureCombineShader.DoApply(var rci: TGLRenderContextInfo; Sender: TObject);
+procedure TGLTexCombineShader.DoApply(var rci: TGLRenderContextInfo; Sender: TObject);
 var
   n, units: Integer;
 begin
@@ -838,7 +838,7 @@ begin
   end;
 end;
 
-function TGLTextureCombineShader.DoUnApply(var rci: TGLRenderContextInfo): Boolean;
+function TGLTexCombineShader.DoUnApply(var rci: TGLRenderContextInfo): Boolean;
 begin
   if FApplied3 then
     with currentLibMaterial3.Material.Texture do
@@ -850,12 +850,12 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.DoFinalize;
+procedure TGLTexCombineShader.DoFinalize;
 begin
 end;
 
 
-procedure TGLTextureCombineShader.SetCombiners(const val: TStringList);
+procedure TGLTexCombineShader.SetCombiners(const val: TStringList);
 begin
   if val <> FCombiners then
   begin
@@ -865,7 +865,7 @@ begin
 end;
 
 
-procedure TGLTextureCombineShader.SetDesignTimeEnabled(const val: Boolean);
+procedure TGLTexCombineShader.SetDesignTimeEnabled(const val: Boolean);
 begin
   if val <> FDesignTimeEnabled then
   begin
@@ -880,6 +880,6 @@ initialization
 //================================================
 
   RegisterClasses([TGLTextureSharingShader, TGLTextureSharingShaderMaterials,
-                   TGLTextureSharingShaderMaterial, TGLTextureCombineShader]);
+                   TGLTextureSharingShaderMaterial, TGLTexCombineShader]);
 
 end.

+ 1 - 1
Source/GLScene.pas

@@ -27,7 +27,7 @@ uses
   Scene.Strings,
   GLContext,
   Scene.VectorGeometry,
-  GLSilhouette,
+  Scene.Silhouette,
   Scene.PersistentClasses,
   GLPipeLineTransformation,
   GLState,

+ 1 - 1
Source/GLShadowVolume.pas

@@ -25,7 +25,7 @@ uses
   GLScene,
   Scene.VectorGeometry,
   GLContext,
-  GLSilhouette,
+  Scene.Silhouette,
   Scene.PersistentClasses,
   GLCoordinates,
   GLPipelineTransformation,

+ 1 - 0
Source/GLTextureFormat.pas

@@ -262,6 +262,7 @@ implementation
 uses
   GLContext;
 
+
 type
 
   TFormatDesc = record

+ 5 - 5
Source/GLVectorFileObjects.pas

@@ -22,25 +22,25 @@ uses
   OpenGLTokens,
   GLScene,
   Scene.VectorGeometry,
+  Scene.VectorRecTypes,
+  Scene.VectorLists,
+  Scene.PersistentClasses,
+  Scene.Silhouette,
+  Scene.Strings,
   GLTexture,
   GLMaterial,
   GLMesh,
   Scene.Logger,
-  Scene.VectorLists,
-  Scene.PersistentClasses,
   GLOctree,
   GLGeometryBB,
   GLApplicationFileIO,
-  GLSilhouette,
   GLContext,
-  Scene.Strings,
   GLColor,
   GLPipelineTransformation,
   GLSelection,
   GLRenderContextInfo,
   GLCoordinates,
   GLBaseClasses,
-  Scene.VectorRecTypes,
   GLTextureFormat;
 
 type

+ 506 - 508
Source/GLSilhouette.pas → Source/Scene.Silhouette.pas

@@ -1,508 +1,506 @@
-//
-// This unit is part of the GLScene Engine, http://glscene.org
-//
-
-unit GLSilhouette;
-
-(*
-  Enhanced silhouette classes.
-  Introduces more evolved/specific silhouette generation and management
-  classes.
-  CAUTION : both connectivity classes leak memory.
-*)
-
-interface
-
-{$I GLScene.inc}
-
-uses
-  System.Classes,
-  System.SysUtils,
-
-  Scene.VectorTypes,
-  Scene.VectorGeometry,
-  Scene.VectorLists;
-
-type
-  TGLSilhouetteStyle = (ssOmni, ssParallel);
-
-  (* Silouhette generation parameters.
-    SeenFrom and LightDirection are expected in local coordinates. *)
-  TGLSilhouetteParameters = packed record
-    SeenFrom, LightDirection: TAffineVector;
-    Style: TGLSilhouetteStyle;
-    CappingRequired: Boolean;
-  end;
-
-  (* Base class storing a volume silhouette.
-    Made of a set of indexed vertices defining an outline, and another set
-    of indexed vertices defining a capping volume. Coordinates system
-    is the object's unscaled local coordinates system.
-    This is the base class, you can use the TGLSilhouette subclass if you
-    need some helper methods for generating the indexed sets. *)
-  TGLSilhouette = class
-  private
-    FVertices: TVectorList;
-    FIndices: TIntegerList;
-    FCapIndices: TIntegerList;
-    FParameters: TGLSilhouetteParameters;
-  protected
-    procedure SetIndices(const value: TIntegerList);
-    procedure SetCapIndices(const value: TIntegerList);
-    procedure SetVertices(const value: TVectorList);
-  public
-    constructor Create; virtual;
-    destructor Destroy; override;
-    property Parameters: TGLSilhouetteParameters read FParameters write FParameters;
-    property Vertices: TVectorList read FVertices write SetVertices;
-    property Indices: TIntegerList read FIndices write SetIndices;
-    property CapIndices: TIntegerList read FCapIndices write SetCapIndices;
-    procedure Flush; virtual;
-    procedure Clear; inline;
-    procedure ExtrudeVerticesToInfinity(const origin: TAffineVector);
-    (* Adds an edge (two vertices) to the silhouette.
-      If TightButSlow is true, no vertices will be doubled in the
-      silhouette list. This should only be used when creating re-usable
-      silhouettes, because it's much slower. *)
-    procedure AddEdgeToSilhouette(const v0, v1: TAffineVector; tightButSlow: Boolean); inline;
-    procedure AddIndexedEdgeToSilhouette(const Vi0, Vi1: integer); inline;
-
-    (* Adds a capping triangle to the silhouette.
-      If TightButSlow is true, no vertices will be doubled in the
-      silhouette list. This should only be used when creating re-usable
-      silhouettes, because it's much slower. *)
-    procedure AddCapToSilhouette(const v0, v1, v2: TAffineVector; tightButSlow: Boolean); inline;
-    procedure AddIndexedCapToSilhouette(const Vi0, Vi1, vi2: integer); inline;
-  end;
-
-  TBaseConnectivity = class
-  protected
-    FPrecomputeFaceNormal: Boolean;
-    function GetEdgeCount: integer; virtual;
-    function GetFaceCount: integer; virtual;
-  public
-    property EdgeCount: integer read GetEdgeCount;
-    property FaceCount: integer read GetFaceCount;
-    property PrecomputeFaceNormal: Boolean read FPrecomputeFaceNormal;
-    procedure CreateSilhouette(const ASilhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
-      AddToSilhouette: Boolean); virtual;
-    constructor Create(APrecomputeFaceNormal: Boolean); virtual;
-  end;
-
-  TConnectivity = class(TBaseConnectivity)
-  protected
-    (* All storage of faces and adges are cut up into tiny pieces for a reason,
-      it'd be nicer with Structs or classes, but it's actually faster this way.
-      The reason it's faster is because of less cache overwrites when we only
-      access a tiny bit of a triangle (for instance), not all data. *)
-    FEdgeVertices: TIntegerList;
-    FEdgeFaces: TIntegerList;
-    FFaceVisible: TByteList;
-    FFaceVertexIndex: TIntegerList;
-    FFaceNormal: TAffineVectorList;
-    FVertexMemory: TIntegerList;
-    FVertices: TAffineVectorList;
-    function GetEdgeCount: integer;
-    function GetFaceCount: integer;
-    function ReuseOrFindVertexID(const SeenFrom: TAffineVector; ASilhouette: TGLSilhouette; index: integer): integer;
-  public
-    // Clears out all connectivity information. 
-    procedure Clear; virtual;
-    procedure CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
-      AddToSilhouette: Boolean);
-    function AddIndexedEdge(vertexIndex0, vertexIndex1: integer; FaceID: integer): integer;
-    function AddIndexedFace(Vi0, Vi1, vi2: integer): integer;
-    function AddFace(const vertex0, vertex1, vertex2: TAffineVector): integer; inline;
-    function AddQuad(const vertex0, vertex1, vertex2, vertex3: TAffineVector): integer; inline;
-    property EdgeCount: integer read GetEdgeCount;
-    property FaceCount: integer read GetFaceCount;
-    constructor Create(APrecomputeFaceNormal: Boolean); override;
-    destructor Destroy; override;
-  end;
-
-// -------------------------------------------------------------
-implementation
-// -------------------------------------------------------------
-
-// ------------------
-// ------------------ TGLSilhouette ------------------
-// ------------------
-
-constructor TGLSilhouette.Create;
-begin
-  inherited;
-  FVertices := TVectorList.Create;
-  FIndices := TIntegerList.Create;
-  FCapIndices := TIntegerList.Create;
-end;
-
-destructor TGLSilhouette.Destroy;
-begin
-  FCapIndices.Free;
-  FIndices.Free;
-  FVertices.Free;
-  inherited;
-end;
-
-procedure TGLSilhouette.SetIndices(const value: TIntegerList);
-begin
-  FIndices.Assign(value);
-end;
-
-procedure TGLSilhouette.SetCapIndices(const value: TIntegerList);
-begin
-  FCapIndices.Assign(value);
-end;
-
-procedure TGLSilhouette.SetVertices(const value: TVectorList);
-begin
-  FVertices.Assign(value);
-end;
-
-procedure TGLSilhouette.Flush;
-begin
-  FVertices.Flush;
-  FIndices.Flush;
-  FCapIndices.Flush;
-end;
-
-procedure TGLSilhouette.Clear;
-begin
-  FVertices.Clear;
-  FIndices.Clear;
-  FCapIndices.Clear;
-end;
-
-procedure TGLSilhouette.ExtrudeVerticesToInfinity(const origin: TAffineVector);
-var
-  i, nv, ni, nc, k: integer;
-  vList, vListN: PVectorArray;
-  iList, iList2: PIntegerArray;
-begin
-  // extrude vertices
-  nv := Vertices.Count;
-  Vertices.Count := 2 * nv;
-  vList := Vertices.List;
-  vListN := @vList[nv];
-  for i := 0 to nv - 1 do
-  begin
-    vListN^[i].W := 0;
-    VectorSubtract(PAffineVector(@vList[i])^, origin, PAffineVector(@vListN[i])^);
-  end;
-  // change silhouette indices to quad indices
-  ni := Indices.Count;
-  Indices.Count := 2 * ni;
-  iList := Indices.List;
-  i := ni - 2;
-  while i >= 0 do
-  begin
-    iList2 := @iList^[2 * i];
-    iList2^[0] := iList^[i];
-    iList2^[1] := iList^[i + 1];
-    iList2^[2] := iList^[i + 1] + nv;
-    iList2^[3] := iList^[i] + nv;
-    Dec(i, 2);
-  end;
-  // add extruded triangles to capIndices
-  nc := CapIndices.Count;
-  CapIndices.Capacity := 2 * nc;
-  iList := CapIndices.List;
-  for i := nc - 1 downto 0 do
-  begin
-    k := iList^[i];
-    CapIndices.Add(k);
-    iList^[i] := k + nv;
-  end;
-end;
-
-// ------------------
-// ------------------ TGLSilhouette ------------------
-// ------------------
-
-procedure TGLSilhouette.AddEdgeToSilhouette(const v0, v1: TAffineVector; tightButSlow: Boolean);
-begin
-  if tightButSlow then
-    Indices.Add(Vertices.FindOrAddPoint(v0), Vertices.FindOrAddPoint(v1))
-  else
-    Indices.Add(Vertices.Add(v0, 1), Vertices.Add(v1, 1));
-end;
-
-procedure TGLSilhouette.AddIndexedEdgeToSilhouette(const Vi0, Vi1: integer);
-
-begin
-  Indices.Add(Vi0, Vi1);
-end;
-
-procedure TGLSilhouette.AddCapToSilhouette(const v0, v1, v2: TAffineVector; tightButSlow: Boolean);
-begin
-  if tightButSlow then
-    CapIndices.Add(Vertices.FindOrAddPoint(v0), Vertices.FindOrAddPoint(v1), Vertices.FindOrAddPoint(v2))
-  else
-    CapIndices.Add(Vertices.Add(v0, 1), Vertices.Add(v1, 1), Vertices.Add(v2, 1));
-end;
-
-procedure TGLSilhouette.AddIndexedCapToSilhouette(const Vi0, Vi1, vi2: integer);
-begin
-  CapIndices.Add(Vi0, Vi1, vi2);
-end;
-
-// ------------------
-// ------------------ TBaseConnectivity ------------------
-// ------------------
-
-constructor TBaseConnectivity.Create(APrecomputeFaceNormal: Boolean);
-begin
-  FPrecomputeFaceNormal := APrecomputeFaceNormal;
-end;
-
-procedure TBaseConnectivity.CreateSilhouette(const ASilhouetteParameters: TGLSilhouetteParameters;
-  var ASilhouette: TGLSilhouette; AddToSilhouette: Boolean);
-begin
-  // Purely virtual!
-end;
-
-// ------------------
-// ------------------ TConnectivity ------------------
-// ------------------
-
-function TBaseConnectivity.GetEdgeCount: integer;
-begin
-  result := 0;
-end;
-
-function TBaseConnectivity.GetFaceCount: integer;
-begin
-  result := 0;
-end;
-
-constructor TConnectivity.Create(APrecomputeFaceNormal: Boolean);
-begin
-  FFaceVisible := TByteList.Create;
-
-  FFaceVertexIndex := TIntegerList.Create;
-  FFaceNormal := TAffineVectorList.Create;
-
-  FEdgeVertices := TIntegerList.Create;
-  FEdgeFaces := TIntegerList.Create;
-
-  FPrecomputeFaceNormal := APrecomputeFaceNormal;
-
-  FVertexMemory := TIntegerList.Create;
-
-  FVertices := TAffineVectorList.Create;
-end;
-
-destructor TConnectivity.Destroy;
-begin
-  Clear;
-
-  FFaceVisible.Free;
-  FFaceVertexIndex.Free;
-  FFaceNormal.Free;
-
-  FEdgeVertices.Free;
-  FEdgeFaces.Free;
-
-  FVertexMemory.Free;
-
-  if Assigned(FVertices) then
-    FVertices.Free;
-
-  inherited;
-end;
-
-procedure TConnectivity.Clear;
-begin
-  FEdgeVertices.Clear;
-  FEdgeFaces.Clear;
-  FFaceVisible.Clear;
-  FFaceVertexIndex.Clear;
-  FFaceNormal.Clear;
-  FVertexMemory.Clear;
-
-  if FVertices <> nil then
-    FVertices.Clear;
-end;
-
-procedure TConnectivity.CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
-  AddToSilhouette: Boolean);
-var
-  i: integer;
-  vis: PIntegerArray;
-  tVi0, tVi1: integer;
-  faceNormal: TAffineVector;
-  face0ID, face1ID: integer;
-  faceIsVisible: Boolean;
-  verticesList: PAffineVectorArray;
-begin
-  if not Assigned(ASilhouette) then
-    ASilhouette := TGLSilhouette.Create
-  else if not AddToSilhouette then
-    ASilhouette.Flush;
-
-  // Clear the vertex memory
-  FVertexMemory.Flush;
-
-  // Update visibility information for all Faces
-  vis := FFaceVertexIndex.List;
-  for i := 0 to FaceCount - 1 do
-  begin
-    if FPrecomputeFaceNormal then
-      faceIsVisible := (PointProject(silhouetteParameters.SeenFrom, FVertices.List^[vis^[0]], FFaceNormal.List^[i]) >= 0)
-    else
-    begin
-      verticesList := FVertices.List;
-      faceNormal := CalcPlaneNormal(verticesList^[vis^[0]], verticesList^[vis^[1]], verticesList^[vis^[2]]);
-      faceIsVisible := (PointProject(silhouetteParameters.SeenFrom, FVertices.List^[vis^[0]], faceNormal) >= 0);
-    end;
-
-    FFaceVisible[i] := Byte(faceIsVisible);
-
-    if (not faceIsVisible) and silhouetteParameters.CappingRequired then
-      ASilhouette.CapIndices.Add(ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]),
-        ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]),
-        ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[2]));
-    vis := @vis[3];
-  end;
-
-  for i := 0 to EdgeCount - 1 do
-  begin
-    face0ID := FEdgeFaces[i * 2 + 0];
-    face1ID := FEdgeFaces[i * 2 + 1];
-
-    if (face1ID = -1) or (FFaceVisible.List^[face0ID] <> FFaceVisible.List^[face1ID]) then
-    begin
-      // Retrieve the two vertice values add add them to the Silhouette list
-      vis := @FEdgeVertices.List[i * 2];
-
-      // In this moment, we _know_ what vertex id the vertex had in the old
-      // mesh. We can remember this information and re-use it for a speedup
-      if FFaceVisible.List^[face0ID] = 0 then
-      begin
-        tVi0 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]);
-        tVi1 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]);
-        ASilhouette.Indices.Add(tVi0, tVi1);
-      end
-      else if face1ID > -1 then
-      begin
-        tVi0 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]);
-        tVi1 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]);
-        ASilhouette.Indices.Add(tVi1, tVi0);
-      end;
-    end;
-  end;
-end;
-
-function TConnectivity.GetEdgeCount: integer;
-begin
-  result := FEdgeVertices.Count div 2;
-end;
-
-function TConnectivity.GetFaceCount: integer;
-begin
-  result := FFaceVisible.Count;
-end;
-
-function TConnectivity.ReuseOrFindVertexID(const SeenFrom: TAffineVector; ASilhouette: TGLSilhouette; index: integer): integer;
-var
-  pMemIndex: PInteger;
-  memIndex, i: integer;
-  oldCount: integer;
-  List: PIntegerArray;
-begin
-  if index >= FVertexMemory.Count then
-  begin
-    oldCount := FVertexMemory.Count;
-    FVertexMemory.Count := index + 1;
-
-    List := FVertexMemory.List;
-    for i := oldCount to FVertexMemory.Count - 1 do
-      List^[i] := -1;
-  end;
-
-  pMemIndex := @FVertexMemory.List[index];
-
-  if pMemIndex^ = -1 then
-  begin
-    // Add the "near" vertex
-    memIndex := ASilhouette.Vertices.Add(FVertices.List^[index], 1);
-    pMemIndex^ := memIndex;
-    result := memIndex;
-  end
-  else
-    result := pMemIndex^;
-end;
-
-function TConnectivity.AddIndexedEdge(vertexIndex0, vertexIndex1: integer; FaceID: integer): integer;
-var
-  i: integer;
-  edgesVertices: PIntegerArray;
-begin
-  // Make sure that the edge doesn't already exists
-  edgesVertices := FEdgeVertices.List;
-  for i := 0 to EdgeCount - 1 do
-  begin
-    // Retrieve the two vertices in the edge
-    if ((edgesVertices^[0] = vertexIndex0) and (edgesVertices^[1] = vertexIndex1)) or
-      ((edgesVertices^[0] = vertexIndex1) and (edgesVertices^[1] = vertexIndex0)) then
-    begin
-      // Update the second Face of the edge and we're done (this _MAY_
-      // overwrite a previous Face in a broken mesh)
-      FEdgeFaces[i * 2 + 1] := FaceID;
-      result := i * 2 + 1;
-      Exit;
-    end;
-    edgesVertices := @edgesVertices[2];
-  end;
-
-  // No edge was found, create a new one
-  FEdgeVertices.Add(vertexIndex0, vertexIndex1);
-  FEdgeFaces.Add(FaceID, -1);
-
-  result := EdgeCount - 1;
-end;
-
-function TConnectivity.AddIndexedFace(Vi0, Vi1, vi2: integer): integer;
-var
-  FaceID: integer;
-begin
-  FFaceVertexIndex.Add(Vi0, Vi1, vi2);
-
-  if FPrecomputeFaceNormal then
-    FFaceNormal.Add(CalcPlaneNormal(FVertices.List^[Vi0], FVertices.List^[Vi1], FVertices.List^[vi2]));
-
-  FaceID := FFaceVisible.Add(0);
-  AddIndexedEdge(Vi0, Vi1, FaceID);
-  AddIndexedEdge(Vi1, vi2, FaceID);
-  AddIndexedEdge(vi2, Vi0, FaceID);
-  result := FaceID;
-end;
-
-function TConnectivity.AddFace(const vertex0, vertex1, vertex2: TAffineVector): integer;
-var
-  Vi0, Vi1, vi2: integer;
-begin
-  Vi0 := FVertices.FindOrAdd(vertex0);
-  Vi1 := FVertices.FindOrAdd(vertex1);
-  vi2 := FVertices.FindOrAdd(vertex2);
-
-  result := AddIndexedFace(Vi0, Vi1, vi2);
-end;
-
-function TConnectivity.AddQuad(const vertex0, vertex1, vertex2, vertex3: TAffineVector): integer;
-var
-  Vi0, Vi1, vi2, Vi3: integer;
-begin
-  Vi0 := FVertices.FindOrAdd(vertex0);
-  Vi1 := FVertices.FindOrAdd(vertex1);
-  vi2 := FVertices.FindOrAdd(vertex2);
-  Vi3 := FVertices.FindOrAdd(vertex3);
-
-  // First face
-  result := AddIndexedFace(Vi0, Vi1, vi2);
-
-  // Second face
-  AddIndexedFace(vi2, Vi3, Vi0);
-end;
-
-end.
+//
+// This unit is part of the GLScene Engine, http://glscene.org
+//
+
+unit Scene.Silhouette;
+
+(*
+  Enhanced silhouette classes.
+  Introduces more evolved/specific silhouette generation and management
+  classes.
+  CAUTION : both connectivity classes leak memory.
+*)
+
+interface
+
+{$I GLScene.inc}
+
+uses
+  System.Classes,
+  System.SysUtils,
+
+  Scene.VectorTypes,
+  Scene.VectorGeometry,
+  Scene.VectorLists;
+
+type
+  TGLSilhouetteStyle = (ssOmni, ssParallel);
+
+  (* Silouhette generation parameters.
+    SeenFrom and LightDirection are expected in local coordinates. *)
+  TGLSilhouetteParameters = packed record
+    SeenFrom, LightDirection: TAffineVector;
+    Style: TGLSilhouetteStyle;
+    CappingRequired: Boolean;
+  end;
+
+  (* Base class storing a volume silhouette.
+    Made of a set of indexed vertices defining an outline, and another set
+    of indexed vertices defining a capping volume. Coordinates system
+    is the object's unscaled local coordinates system.
+    This is the base class, you can use the TGLSilhouette subclass if you
+    need some helper methods for generating the indexed sets. *)
+  TGLSilhouette = class
+  private
+    FVertices: TVectorList;
+    FIndices: TIntegerList;
+    FCapIndices: TIntegerList;
+    FParameters: TGLSilhouetteParameters;
+  protected
+    procedure SetIndices(const value: TIntegerList);
+    procedure SetCapIndices(const value: TIntegerList);
+    procedure SetVertices(const value: TVectorList);
+  public
+    constructor Create; virtual;
+    destructor Destroy; override;
+    property Parameters: TGLSilhouetteParameters read FParameters write FParameters;
+    property Vertices: TVectorList read FVertices write SetVertices;
+    property Indices: TIntegerList read FIndices write SetIndices;
+    property CapIndices: TIntegerList read FCapIndices write SetCapIndices;
+    procedure Flush; virtual;
+    procedure Clear; inline;
+    procedure ExtrudeVerticesToInfinity(const origin: TAffineVector);
+    (* Adds an edge (two vertices) to the silhouette.
+      If TightButSlow is true, no vertices will be doubled in the
+      silhouette list. This should only be used when creating re-usable
+      silhouettes, because it's much slower. *)
+    procedure AddEdgeToSilhouette(const v0, v1: TAffineVector; tightButSlow: Boolean); inline;
+    procedure AddIndexedEdgeToSilhouette(const Vi0, Vi1: integer); inline;
+
+    (* Adds a capping triangle to the silhouette.
+      If TightButSlow is true, no vertices will be doubled in the
+      silhouette list. This should only be used when creating re-usable
+      silhouettes, because it's much slower. *)
+    procedure AddCapToSilhouette(const v0, v1, v2: TAffineVector; tightButSlow: Boolean); inline;
+    procedure AddIndexedCapToSilhouette(const Vi0, Vi1, vi2: integer); inline;
+  end;
+
+  TBaseConnectivity = class
+  protected
+    FPrecomputeFaceNormal: Boolean;
+    function GetEdgeCount: integer; virtual;
+    function GetFaceCount: integer; virtual;
+  public
+    property EdgeCount: integer read GetEdgeCount;
+    property FaceCount: integer read GetFaceCount;
+    property PrecomputeFaceNormal: Boolean read FPrecomputeFaceNormal;
+    procedure CreateSilhouette(const ASilhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
+      AddToSilhouette: Boolean); virtual;
+    constructor Create(APrecomputeFaceNormal: Boolean); virtual;
+  end;
+
+  TConnectivity = class(TBaseConnectivity)
+  protected
+    (* All storage of faces and adges are cut up into tiny pieces for a reason,
+      it'd be nicer with Structs or classes, but it's actually faster this way.
+      The reason it's faster is because of less cache overwrites when we only
+      access a tiny bit of a triangle (for instance), not all data. *)
+    FEdgeVertices: TIntegerList;
+    FEdgeFaces: TIntegerList;
+    FFaceVisible: TByteList;
+    FFaceVertexIndex: TIntegerList;
+    FFaceNormal: TAffineVectorList;
+    FVertexMemory: TIntegerList;
+    FVertices: TAffineVectorList;
+    function GetEdgeCount: integer;
+    function GetFaceCount: integer;
+    function ReuseOrFindVertexID(const SeenFrom: TAffineVector; ASilhouette: TGLSilhouette; index: integer): integer;
+  public
+    // Clears out all connectivity information. 
+    procedure Clear; virtual;
+    procedure CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
+      AddToSilhouette: Boolean);
+    function AddIndexedEdge(vertexIndex0, vertexIndex1: integer; FaceID: integer): integer;
+    function AddIndexedFace(Vi0, Vi1, vi2: integer): integer;
+    function AddFace(const vertex0, vertex1, vertex2: TAffineVector): integer; inline;
+    function AddQuad(const vertex0, vertex1, vertex2, vertex3: TAffineVector): integer; inline;
+    property EdgeCount: integer read GetEdgeCount;
+    property FaceCount: integer read GetFaceCount;
+    constructor Create(APrecomputeFaceNormal: Boolean); override;
+    destructor Destroy; override;
+  end;
+
+// -------------------------------------------------------------
+implementation
+// -------------------------------------------------------------
+
+// ------------------
+// ------------------ TGLSilhouette ------------------
+// ------------------
+
+constructor TGLSilhouette.Create;
+begin
+  inherited;
+  FVertices := TVectorList.Create;
+  FIndices := TIntegerList.Create;
+  FCapIndices := TIntegerList.Create;
+end;
+
+destructor TGLSilhouette.Destroy;
+begin
+  FCapIndices.Free;
+  FIndices.Free;
+  FVertices.Free;
+  inherited;
+end;
+
+procedure TGLSilhouette.SetIndices(const value: TIntegerList);
+begin
+  FIndices.Assign(value);
+end;
+
+procedure TGLSilhouette.SetCapIndices(const value: TIntegerList);
+begin
+  FCapIndices.Assign(value);
+end;
+
+procedure TGLSilhouette.SetVertices(const value: TVectorList);
+begin
+  FVertices.Assign(value);
+end;
+
+procedure TGLSilhouette.Flush;
+begin
+  FVertices.Flush;
+  FIndices.Flush;
+  FCapIndices.Flush;
+end;
+
+procedure TGLSilhouette.Clear;
+begin
+  FVertices.Clear;
+  FIndices.Clear;
+  FCapIndices.Clear;
+end;
+
+procedure TGLSilhouette.ExtrudeVerticesToInfinity(const origin: TAffineVector);
+var
+  i, nv, ni, nc, k: integer;
+  vList, vListN: PVectorArray;
+  iList, iList2: PIntegerArray;
+begin
+  // extrude vertices
+  nv := Vertices.Count;
+  Vertices.Count := 2 * nv;
+  vList := Vertices.List;
+  vListN := @vList[nv];
+  for i := 0 to nv - 1 do
+  begin
+    vListN^[i].W := 0;
+    VectorSubtract(PAffineVector(@vList[i])^, origin, PAffineVector(@vListN[i])^);
+  end;
+  // change silhouette indices to quad indices
+  ni := Indices.Count;
+  Indices.Count := 2 * ni;
+  iList := Indices.List;
+  i := ni - 2;
+  while i >= 0 do
+  begin
+    iList2 := @iList^[2 * i];
+    iList2^[0] := iList^[i];
+    iList2^[1] := iList^[i + 1];
+    iList2^[2] := iList^[i + 1] + nv;
+    iList2^[3] := iList^[i] + nv;
+    Dec(i, 2);
+  end;
+  // add extruded triangles to capIndices
+  nc := CapIndices.Count;
+  CapIndices.Capacity := 2 * nc;
+  iList := CapIndices.List;
+  for i := nc - 1 downto 0 do
+  begin
+    k := iList^[i];
+    CapIndices.Add(k);
+    iList^[i] := k + nv;
+  end;
+end;
+
+// ------------------
+// ------------------ TGLSilhouette ------------------
+// ------------------
+
+procedure TGLSilhouette.AddEdgeToSilhouette(const v0, v1: TAffineVector; tightButSlow: Boolean);
+begin
+  if tightButSlow then
+    Indices.Add(Vertices.FindOrAddPoint(v0), Vertices.FindOrAddPoint(v1))
+  else
+    Indices.Add(Vertices.Add(v0, 1), Vertices.Add(v1, 1));
+end;
+
+procedure TGLSilhouette.AddIndexedEdgeToSilhouette(const Vi0, Vi1: integer);
+
+begin
+  Indices.Add(Vi0, Vi1);
+end;
+
+procedure TGLSilhouette.AddCapToSilhouette(const v0, v1, v2: TAffineVector; tightButSlow: Boolean);
+begin
+  if tightButSlow then
+    CapIndices.Add(Vertices.FindOrAddPoint(v0), Vertices.FindOrAddPoint(v1), Vertices.FindOrAddPoint(v2))
+  else
+    CapIndices.Add(Vertices.Add(v0, 1), Vertices.Add(v1, 1), Vertices.Add(v2, 1));
+end;
+
+procedure TGLSilhouette.AddIndexedCapToSilhouette(const Vi0, Vi1, vi2: integer);
+begin
+  CapIndices.Add(Vi0, Vi1, vi2);
+end;
+
+// ------------------
+// ------------------ TBaseConnectivity ------------------
+// ------------------
+
+constructor TBaseConnectivity.Create(APrecomputeFaceNormal: Boolean);
+begin
+  FPrecomputeFaceNormal := APrecomputeFaceNormal;
+end;
+
+procedure TBaseConnectivity.CreateSilhouette(const ASilhouetteParameters: TGLSilhouetteParameters;
+  var ASilhouette: TGLSilhouette; AddToSilhouette: Boolean);
+begin
+  // Purely virtual!
+end;
+
+// ------------------
+// ------------------ TConnectivity ------------------
+// ------------------
+
+function TBaseConnectivity.GetEdgeCount: integer;
+begin
+  result := 0;
+end;
+
+function TBaseConnectivity.GetFaceCount: integer;
+begin
+  result := 0;
+end;
+
+constructor TConnectivity.Create(APrecomputeFaceNormal: Boolean);
+begin
+  FFaceVisible := TByteList.Create;
+
+  FFaceVertexIndex := TIntegerList.Create;
+  FFaceNormal := TAffineVectorList.Create;
+
+  FEdgeVertices := TIntegerList.Create;
+  FEdgeFaces := TIntegerList.Create;
+
+  FPrecomputeFaceNormal := APrecomputeFaceNormal;
+  FVertexMemory := TIntegerList.Create;
+  FVertices := TAffineVectorList.Create;
+end;
+
+destructor TConnectivity.Destroy;
+begin
+  Clear;
+
+  FFaceVisible.Free;
+  FFaceVertexIndex.Free;
+  FFaceNormal.Free;
+
+  FEdgeVertices.Free;
+  FEdgeFaces.Free;
+
+  FVertexMemory.Free;
+
+  if Assigned(FVertices) then
+    FVertices.Free;
+
+  inherited;
+end;
+
+procedure TConnectivity.Clear;
+begin
+  FEdgeVertices.Clear;
+  FEdgeFaces.Clear;
+  FFaceVisible.Clear;
+  FFaceVertexIndex.Clear;
+  FFaceNormal.Clear;
+  FVertexMemory.Clear;
+
+  if FVertices <> nil then
+    FVertices.Clear;
+end;
+
+procedure TConnectivity.CreateSilhouette(const silhouetteParameters: TGLSilhouetteParameters; var ASilhouette: TGLSilhouette;
+  AddToSilhouette: Boolean);
+var
+  i: integer;
+  vis: PIntegerArray;
+  tVi0, tVi1: integer;
+  faceNormal: TAffineVector;
+  face0ID, face1ID: integer;
+  faceIsVisible: Boolean;
+  verticesList: PAffineVectorArray;
+begin
+  if not Assigned(ASilhouette) then
+    ASilhouette := TGLSilhouette.Create
+  else if not AddToSilhouette then
+    ASilhouette.Flush;
+
+  // Clear the vertex memory
+  FVertexMemory.Flush;
+
+  // Update visibility information for all Faces
+  vis := FFaceVertexIndex.List;
+  for i := 0 to FaceCount - 1 do
+  begin
+    if FPrecomputeFaceNormal then
+      faceIsVisible := (PointProject(silhouetteParameters.SeenFrom, FVertices.List^[vis^[0]], FFaceNormal.List^[i]) >= 0)
+    else
+    begin
+      verticesList := FVertices.List;
+      faceNormal := CalcPlaneNormal(verticesList^[vis^[0]], verticesList^[vis^[1]], verticesList^[vis^[2]]);
+      faceIsVisible := (PointProject(silhouetteParameters.SeenFrom, FVertices.List^[vis^[0]], faceNormal) >= 0);
+    end;
+
+    FFaceVisible[i] := Byte(faceIsVisible);
+
+    if (not faceIsVisible) and silhouetteParameters.CappingRequired then
+      ASilhouette.CapIndices.Add(ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]),
+        ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]),
+        ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[2]));
+    vis := @vis[3];
+  end;
+
+  for i := 0 to EdgeCount - 1 do
+  begin
+    face0ID := FEdgeFaces[i * 2 + 0];
+    face1ID := FEdgeFaces[i * 2 + 1];
+
+    if (face1ID = -1) or (FFaceVisible.List^[face0ID] <> FFaceVisible.List^[face1ID]) then
+    begin
+      // Retrieve the two vertice values add add them to the Silhouette list
+      vis := @FEdgeVertices.List[i * 2];
+
+      // In this moment, we _know_ what vertex id the vertex had in the old
+      // mesh. We can remember this information and re-use it for a speedup
+      if FFaceVisible.List^[face0ID] = 0 then
+      begin
+        tVi0 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]);
+        tVi1 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]);
+        ASilhouette.Indices.Add(tVi0, tVi1);
+      end
+      else if face1ID > -1 then
+      begin
+        tVi0 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[0]);
+        tVi1 := ReuseOrFindVertexID(silhouetteParameters.SeenFrom, ASilhouette, vis^[1]);
+        ASilhouette.Indices.Add(tVi1, tVi0);
+      end;
+    end;
+  end;
+end;
+
+function TConnectivity.GetEdgeCount: integer;
+begin
+  result := FEdgeVertices.Count div 2;
+end;
+
+function TConnectivity.GetFaceCount: integer;
+begin
+  result := FFaceVisible.Count;
+end;
+
+function TConnectivity.ReuseOrFindVertexID(const SeenFrom: TAffineVector; ASilhouette: TGLSilhouette; index: integer): integer;
+var
+  pMemIndex: PInteger;
+  memIndex, i: integer;
+  oldCount: integer;
+  List: PIntegerArray;
+begin
+  if index >= FVertexMemory.Count then
+  begin
+    oldCount := FVertexMemory.Count;
+    FVertexMemory.Count := index + 1;
+
+    List := FVertexMemory.List;
+    for i := oldCount to FVertexMemory.Count - 1 do
+      List^[i] := -1;
+  end;
+
+  pMemIndex := @FVertexMemory.List[index];
+
+  if pMemIndex^ = -1 then
+  begin
+    // Add the "near" vertex
+    memIndex := ASilhouette.Vertices.Add(FVertices.List^[index], 1);
+    pMemIndex^ := memIndex;
+    result := memIndex;
+  end
+  else
+    result := pMemIndex^;
+end;
+
+function TConnectivity.AddIndexedEdge(vertexIndex0, vertexIndex1: integer; FaceID: integer): integer;
+var
+  i: integer;
+  edgesVertices: PIntegerArray;
+begin
+  // Make sure that the edge doesn't already exists
+  edgesVertices := FEdgeVertices.List;
+  for i := 0 to EdgeCount - 1 do
+  begin
+    // Retrieve the two vertices in the edge
+    if ((edgesVertices^[0] = vertexIndex0) and (edgesVertices^[1] = vertexIndex1)) or
+      ((edgesVertices^[0] = vertexIndex1) and (edgesVertices^[1] = vertexIndex0)) then
+    begin
+      // Update the second Face of the edge and we're done (this _MAY_
+      // overwrite a previous Face in a broken mesh)
+      FEdgeFaces[i * 2 + 1] := FaceID;
+      result := i * 2 + 1;
+      Exit;
+    end;
+    edgesVertices := @edgesVertices[2];
+  end;
+
+  // No edge was found, create a new one
+  FEdgeVertices.Add(vertexIndex0, vertexIndex1);
+  FEdgeFaces.Add(FaceID, -1);
+
+  result := EdgeCount - 1;
+end;
+
+function TConnectivity.AddIndexedFace(Vi0, Vi1, vi2: integer): integer;
+var
+  FaceID: integer;
+begin
+  FFaceVertexIndex.Add(Vi0, Vi1, vi2);
+
+  if FPrecomputeFaceNormal then
+    FFaceNormal.Add(CalcPlaneNormal(FVertices.List^[Vi0], FVertices.List^[Vi1], FVertices.List^[vi2]));
+
+  FaceID := FFaceVisible.Add(0);
+  AddIndexedEdge(Vi0, Vi1, FaceID);
+  AddIndexedEdge(Vi1, vi2, FaceID);
+  AddIndexedEdge(vi2, Vi0, FaceID);
+  result := FaceID;
+end;
+
+function TConnectivity.AddFace(const vertex0, vertex1, vertex2: TAffineVector): integer;
+var
+  Vi0, Vi1, vi2: integer;
+begin
+  Vi0 := FVertices.FindOrAdd(vertex0);
+  Vi1 := FVertices.FindOrAdd(vertex1);
+  vi2 := FVertices.FindOrAdd(vertex2);
+
+  result := AddIndexedFace(Vi0, Vi1, vi2);
+end;
+
+function TConnectivity.AddQuad(const vertex0, vertex1, vertex2, vertex3: TAffineVector): integer;
+var
+  Vi0, Vi1, vi2, Vi3: integer;
+begin
+  Vi0 := FVertices.FindOrAdd(vertex0);
+  Vi1 := FVertices.FindOrAdd(vertex1);
+  vi2 := FVertices.FindOrAdd(vertex2);
+  Vi3 := FVertices.FindOrAdd(vertex3);
+
+  // First face
+  result := AddIndexedFace(Vi0, Vi1, vi2);
+
+  // Second face
+  AddIndexedFace(vi2, Vi3, Vi0);
+end;
+
+end.