Selaa lähdekoodia

Fixed a bug in GLS.Texture unit thx to Lars

GLScene 5 vuotta sitten
vanhempi
commit
f596505f0b
2 muutettua tiedostoa jossa 5 lisäystä ja 12 poistoa
  1. 2 2
      Demos/Delphi/meshes/shadedterrain/Unit1.pas
  2. 3 10
      Source/GLS.Texture.pas

+ 2 - 2
Demos/Delphi/meshes/shadedterrain/Unit1.pas

@@ -149,7 +149,7 @@ var
   Vec: TVector;
 begin
   heightData.MaterialName := normalMapMaterial.Name;
-  normalMapMaterial.Texture2Name := 'details';//'texture'; not 'ground' or 'contrast';
+  normalMapMaterial.Texture2Name := 'contrast';//'details', 'texture' or 'contrast';
   normalMapMaterial.Shader := GLTexCombineShader1;
   normalMapMaterial.Material.MaterialOptions := [moNoLighting];
   Vec := VectorNormalize(SPSun.AbsolutePosition);
@@ -308,7 +308,7 @@ var
   i: Integer;
   bmp: TBitmap;
 begin
-  with GLMaterialLibrary1.LibMaterialByName('ground').Material do
+  with GLMaterialLibrary1.LibMaterialByName('contrast').Material do
   begin
     bmp := TBitmap.Create;
     try

+ 3 - 10
Source/GLS.Texture.pas

@@ -2815,17 +2815,10 @@ begin
   end;
 
   if gl.GetError <> GL_NO_ERROR then
-  begin
-    gl.ClearError;
-    SetTextureErrorImage;
-  end
-  else
-  begin
     FRequiredMemorySize := -1;
-    TextureImageRequiredMemory;
-    if not IsDesignTime and not FKeepImageAfterTransfer then
-      Image.ReleaseBitmap32;
-  end;
+  TextureImageRequiredMemory;
+  if not IsDesignTime and not FKeepImageAfterTransfer then
+    Image.ReleaseBitmap32;
 end;
 
 procedure TGLTexture.PrepareParams(target: Cardinal);