Unit CastleGLImages
Description
Using images in OpenGL (as textures and as normal images).
For non-OpenGL image management, see CastleImages and CastleTextureImages units. They contain functions and classes to load, save and process images.
This unit has functions and classes to:
Load images as OpenGL textures. You usually do not use these directly, instead TCastleScene automatically uses these to load and render textures as part of 3D models.
A lot of utilities included: for 2D textures (see LoadGLTexture), cube maps (see glTextureCubeMap), 3D textures (see glTextureImage3D). These functions wrap OpenGL calls like glTexImage2D to handle our images (TEncodedImage (and descendant TCastleImage), TCompositeImage), and to automatically set texture parameters, mipmaps and such.
Load and draw images in 2D. This is useful to implement various 2D controls. See TDrawableImage class and friends.
Save the current OpenGL screen contents to our TCastleImage. You usually use this through TCastleWindow.SaveScreen or TCastleControl.SaveScreen, based on SaveScreen_NoFlush in this unit.
Render to texture, see TGLRenderToTexture class. This is our abstraction over OpenGL framebuffer (or glCopyTexSubImage for ancient GPUs).
This unit hides from your some details about OpenGL images handling. For example, you don't have to worry about "pixel store alignment", we handle it here internally when transferring images between memory and GPU. You also don't have to worry about texture sizes being power of 2, or about maximum texture sizes — we will resize textures if necessary.
Routines in this unit that take TCastleImage or TEncodedImage parameter are limited to TextureImageClassesAll (for routines dealing with textures) or PixelsImageClasses (for routines dealing with images drawn on 2D screen).
Source: src/base_rendering/castleglimages.pas (line 59).
Uses
- SysUtils
- Generics.Collections
- Classes
- CastleGL
- CastleImages
- CastleVectors
- CastleGLUtils
- CastleTimeUtils
- CastleTextureImages
- CastleVideos
- CastleInternalCompositeImage
- CastleRectangles
- CastleGLShaders
- CastleColors
- CastleUtils
- CastleRenderOptions
- CastleInternalGLUtils
- CastleInternalFileMonitor
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Class ETextureLoadError |
|
Class EImageClassNotSupportedForOpenGL |
|
Class ECannotLoadCompressedTexture |
|
Class EInvalidImageForOpenGLTexture |
|
Record TTextureFilter |
|
Packed Record TTextureWrap2D |
|
Packed Record TTextureWrap3D |
|
Record TDrawableImageRenderStatistics |
Statistics to measure TDrawableImage rendering impact. |
Class TDrawableImage |
Image that can be drawn. |
Class TCastleImagePersistent |
Image that can be easily loaded from URL (possibly reusing a cache), drawn, and serialized to/from file. |
Class ECannotSaveTextureContents |
Raised by SaveTextureContents when we cannot get texture contents. |
Class EFramebufferError |
type - don't add this Delphi can't parse it correctly |
Class EFramebufferSizeTooLow |
|
Class EFramebufferInvalid |
|
Class TGLRenderToTexture |
Rendering to texture with OpenGL. |
Class TTextureMemoryProfiler |
OpenGL texture memory profiler. |
Class TGLVideo |
Video as a sequence of OpenGL textures that can be easily played. |
Class TGLVideo3D |
Video expressed as a series of textures, to play as texture on any 3D object. |
Class TGLVideo2D |
Video expressed as a series of TDrawableImage, to play as 2D GUI control. |
Record TSpriteAnimationFrame |
A frame of a custom animation. |
Class TSpriteAnimation |
Custom animation of a sprite. |
Class TSprite |
Sprite is an animation composed from frames arranged in rows and columns inside a single image. |
Functions and Procedures
function ImageGLFormat(const Img: TCastleImage): TGLenum; |
function ImageGLInternalFormat(const Img: TEncodedImage): TGLenum; |
function ImageGLType(const Img: TCastleImage): TGLenum; |
procedure FreeTexture(var Tex: TGLTextureId); |
procedure TexParameterMaxAnisotropy(const target: TGLenum; const Anisotropy: TGLfloat); |
function TextureFilter(const Minification: TMinificationFilter; const Magnification: TMagnificationFilter): TTextureFilter; |
procedure SetTextureFilter(const Target: TGLenum; const Filter: TTextureFilter); |
function Texture2DClampToEdge: TTextureWrap2D; |
procedure ResizeForTextureSize(var r: TCastleImage; const Sizing: TTextureSizing); |
function ResizeToTextureSize(const r: TCastleImage; const Sizing: TTextureSizing): TCastleImage; overload; |
function ResizeToTextureSize(const Size: Cardinal; const Sizing: TTextureSizing): Cardinal; overload; |
function IsTextureSized(const r: TEncodedImage; const Sizing: TTextureSizing): boolean; overload; |
function IsTextureSized(const Width, Height: Cardinal; const Sizing: TTextureSizing): boolean; overload; |
function LoadGLTexture(const image: TEncodedImage; const Filter: TTextureFilter; const Wrap: TTextureWrap2D; const CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false): TGLTextureId; overload; |
function LoadGLTexture(const Url: String; const Filter: TTextureFilter; const Wrap: TTextureWrap2D; const CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false): TGLTextureId; overload; |
procedure LoadGLGeneratedTexture(const TextureId: TGLTextureId; Image: TEncodedImage; Filter: TTextureFilter; const Wrap: TTextureWrap2D; CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false); overload; |
function GLDecompressTexture(const Image: TGPUCompressedImage): TCastleImage; |
procedure SaveTextureContents(const Image: TCastleImage; const Texture: TGLTextureId); |
procedure glTextureImage3D(const TextureIdForProfiler: TGLTextureId; const Image: TEncodedImage; Filter: TTextureFilter; CompositeForMipmaps: TCompositeImage); |
function IsCubeMapTextureSized(const Size: Cardinal): boolean; overload; |
function ResizeToCubeMapTextureSize(const Size: Cardinal): Cardinal; overload; |
procedure glTextureCubeMap(const TextureIdForProfiler: TGLTextureId; const PositiveX, NegativeX, PositiveY, NegativeY, PositiveZ, NegativeZ: TEncodedImage; const CompositeForMipmaps: TCompositeImage; const Mipmaps: boolean; out DisableMipmaps: Boolean); |
function SaveScreen_NoFlush( const Rect: TRectangle; const ReadBuffer: TColorBuffer): TRGBImage; overload; |
function SaveScreen_NoFlush(const ImageClass: TCastleImageClass; const Rect: TRectangle; const ReadBuffer: TColorBuffer): TCastleImage; overload; |
procedure SaveScreen_NoFlush(const Image: TCastleImage; const Left, Bottom: Integer; const ReadBuffer: TColorBuffer); overload; |
function SaveScreenToGL_NoFlush(const Rect: TRectangle; const ReadBuffer: TColorBuffer; const SmoothScaling: boolean = false): TDrawableImage; |
function SaveScreenDepth_NoFlush(const Rect: TRectangle): TGrayscaleImage; |
function OffscreenRendering: Boolean; |
function TextureMemoryProfiler: TTextureMemoryProfiler; |
procedure BeforeUnpackImage(const Image: TCastleImage); |
procedure AfterUnpackImage(const Image: TCastleImage); |
procedure BeforePackImage(const Image: TCastleImage); |
procedure AfterPackImage(const Image: TCastleImage); |
Types
TGLTextureId = TGLTexture; |
TMinificationFilter = CastleRenderOptions.TMinificationFilter; |
TMagnificationFilter = CastleRenderOptions.TMagnificationFilter; |
TGLImageManaged = TDrawableImage deprecated 'use TDrawableImage'; |
TGLImageOnDemand = TDrawableImage deprecated 'use TDrawableImage'; |
TGLImageCore = TDrawableImage deprecated 'use TDrawableImage'; |
TGLImage = TDrawableImage deprecated 'use TDrawableImage'; |
TProtectedSidesScaling = (...); |
TTextureSizing = (...); |
TColorBuffer = (...); |
TGLRenderToTextureBuffer = (...); |
Constants
Variables
GLTextureScale: Cardinal = 1; |
GLTextureMinSize: Cardinal = 16; |
LogTextureLoading: boolean = false; |
Description
Functions and Procedures
function ImageGLFormat(const Img: TCastleImage): TGLenum; |
|
Return appropriate OpenGL format and type constants for given TCastleImage descendant. If you will pass here Img that is not a descendant of one of TextureImageClassesAll or PixelsImageClasses, they will raise EImageClassNotSupportedForOpenGL. ImageGLInternalFormat works with TGPUCompressedImage classes also, returning appropriate enum, suitable for glCompressedTexImage2D.
Exceptions raised
Source: src/base_rendering/castleglimages_miscellaneous.inc (line 53). |
function ImageGLInternalFormat(const Img: TEncodedImage): TGLenum; |
|
This item has no description. Source: src/base_rendering/castleglimages_miscellaneous.inc (line 54). |
function ImageGLType(const Img: TCastleImage): TGLenum; |
|
This item has no description. Source: src/base_rendering/castleglimages_miscellaneous.inc (line 55). |
procedure FreeTexture(var Tex: TGLTextureId); |
|
Delete texture object and set it to GLObjectNone. - Before doing anything, checks is it GLObjectNone. - After freeing, sets it to GLObjectNone. - Also takes care to call TextureMemoryProfiler.Deallocate . Source: src/base_rendering/castleglimages_miscellaneous.inc (line 76). |
procedure TexParameterMaxAnisotropy(const target: TGLenum; const Anisotropy: TGLfloat); |
|
Call glTexParameterf to set GL_TEXTURE_MAX_ANISOTROPY_EXT on given texture target. Takes care to check for appropriate OpenGL extension (if not present, does nothing), and to query OpenGL limit for Anisotropy (eventually clamping provided Anisotropy down). Source: src/base_rendering/castleglimages_miscellaneous.inc (line 84). |
function TextureFilter(const Minification: TMinificationFilter; const Magnification: TMagnificationFilter): TTextureFilter; |
|
Part of CastleGLImages unit: texture filtering (TTextureFilter and friends). Source: src/base_rendering/castleglimages_filter.inc (line 39). |
procedure SetTextureFilter(const Target: TGLenum; const Filter: TTextureFilter); |
|
Set current texture minification and magnification filter. This is just a thin wrapper for calling glTexParameteri(Target, GL_TEXTURE_MIN_FILTER, ...); glTexParameteri(Target, GL_TEXTURE_MAG_FILTER, ...); Source: src/base_rendering/castleglimages_filter.inc (line 49). |
function Texture2DClampToEdge: TTextureWrap2D; |
|
Return wrap GL_CLAMP_TO_EDGE in both directions. Source: src/base_rendering/castleglimages_wrap.inc (line 42). |
procedure ResizeForTextureSize(var r: TCastleImage; const Sizing: TTextureSizing); |
|
Resize the image to a size accepted as GL_TEXTURE_2D texture size for OpenGL. It tries to resize to a larger size, not smaller, to avoid losing image information. It also makes texture have power-of-two size, if Sizing <> tsAny (or if GLFeatures.TextureNonPowerOfTwo = Use Sizing = tsAny only for textures that you plan to use for drawing GUI images by TDrawableImage. Source: src/base_rendering/castleglimages_load_2d.inc (line 64). |
function ResizeToTextureSize(const r: TCastleImage; const Sizing: TTextureSizing): TCastleImage; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_load_2d.inc (line 65). |
function ResizeToTextureSize(const Size: Cardinal; const Sizing: TTextureSizing): Cardinal; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_load_2d.inc (line 66). |
function IsTextureSized(const r: TEncodedImage; const Sizing: TTextureSizing): boolean; overload; |
|
Does image have proper size for 2D OpenGL texture. See ResizeForTextureSize. Note that this checks glGet(GL_MAX_TEXTURE_SIZE), so requires initialized OpenGL context. Source: src/base_rendering/castleglimages_load_2d.inc (line 72). |
function IsTextureSized(const Width, Height: Cardinal; const Sizing: TTextureSizing): boolean; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_load_2d.inc (line 74). |
function LoadGLTexture(const image: TEncodedImage; const Filter: TTextureFilter; const Wrap: TTextureWrap2D; const CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false): TGLTextureId; overload; |
|
Load new texture to OpenGL. Generates new texture number by glGenTextures, then binds this texture, and loads it's data. Takes care of UNPACK_ALIGNMENT inside (if needed, we'll change it and later revert back, so that the texture is correctly loaded). Sets texture minification, magnification filters and wrap parameters. Changes currently bound texture to this one (returned). If mipmaps will be needed (this is decided looking at Filter.Minification) we will load them too.
Parameters
Exceptions raised
Source: src/base_rendering/castleglimages_load_2d.inc (line 146). |
function LoadGLTexture(const Url: String; const Filter: TTextureFilter; const Wrap: TTextureWrap2D; const CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false): TGLTextureId; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_load_2d.inc (line 152). |
procedure LoadGLGeneratedTexture(const TextureId: TGLTextureId; Image: TEncodedImage; Filter: TTextureFilter; const Wrap: TTextureWrap2D; CompositeForMipmaps: TCompositeImage = nil; const GUITexture: boolean = false); overload; |
|
Load OpenGL texture into an (already allocated) TextureId. You can also use this to set "default unnamed OpenGL texture" parameters by passing TextureId = GLObjectNone.
Exceptions raised
Source: src/base_rendering/castleglimages_load_2d.inc (line 169). |
function GLDecompressTexture(const Image: TGPUCompressedImage): TCastleImage; |
|
Decompress texture image by loading it to a temporary OpenGL(ES) texture and reading back. IOW, this does decompression by using current OpenGL(ES) context. TODO: Note that the current implementation will always raise ECannotLoadCompressedTexture on OpenGLES, e.g. on mobile. Same as SaveTextureContents. This is fixable (we need to use FBO instead of glGetTexImage on OpenGLES), please submit a bugreport if you need it. Exceptions raised
Source: src/base_rendering/castleglimages_load_2d.inc (line 187). |
procedure SaveTextureContents(const Image: TCastleImage; const Texture: TGLTextureId); |
|
Save OpenGL texture contents to TCastleImage. Size of the texture must match the Image size, otherwise terrible things (writing over unallocated memory) will happen. Exceptions raised
Source: src/base_rendering/castleglimages_load_2d.inc (line 204). |
procedure glTextureImage3D(const TextureIdForProfiler: TGLTextureId; const Image: TEncodedImage; Filter: TTextureFilter; CompositeForMipmaps: TCompositeImage); |
|
Comfortably load a 3D texture. Think about this as doing glTexImage3D(...) for you. It also sets texture minification, magnification filters and creates mipmaps if necessary. It checks OpenGL 3D texture size requirements, and throws exceptions if not satisfied. It takes care about OpenGL unpack parameters. Just don't worry about it. If Filter uses mipmaps, then all mipmap levels will be loaded.
Pass TextureIdForProfiler only for profiling purposes (for TextureMemoryProfiler). This procedure assumes that the texture is already bound.
Exceptions raised
Source: src/base_rendering/castleglimages_load_3d.inc (line 60). |
function IsCubeMapTextureSized(const Size: Cardinal): boolean; overload; |
|
Part of CastleGLImages unit: cubemaps sizing and loading. Source: src/base_rendering/castleglimages_load_cubemap.inc (line 22). |
function ResizeToCubeMapTextureSize(const Size: Cardinal): Cardinal; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_load_cubemap.inc (line 23). |
procedure glTextureCubeMap(const TextureIdForProfiler: TGLTextureId; const PositiveX, NegativeX, PositiveY, NegativeY, PositiveZ, NegativeZ: TEncodedImage; const CompositeForMipmaps: TCompositeImage; const Mipmaps: boolean; out DisableMipmaps: Boolean); |
|
Comfortably load all six cube map texture images. Think about this as doing glTexImage2D(Side, ...) for each cube side. It takes care of (almost?) everything you need to prepare OpenGL cube map texture. It automatically takes care to adjust the texture size to appropriate size, honoring the "power of two" requirement and the GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB limit of OpenGL. So texture image may be resized (preferably up) internally before loading. Although, if texture is compressed, we cannot resize it — so ECannotLoadCompressedTexture will be raised if texture is not appropriate size. It takes care about OpenGL unpack parameters. Just don't worry about it. Pass TextureIdForProfiler only for profiling purposes (for TextureMemoryProfiler). This procedure assumes that the texture is already bound. If mipmaps are requested:
Exceptions raised
Source: src/base_rendering/castleglimages_load_cubemap.inc (line 68). |
function SaveScreen_NoFlush( const Rect: TRectangle; const ReadBuffer: TColorBuffer): TRGBImage; overload; |
|
Save the current color buffer contents to image. The suffix "NoFlush" is there to remind you that this function grabs the current buffer contents. Usually you want to redraw the screen to the back buffer, and call this function to capture back buffer before swapping, since this is the only reliable way to capture OpenGL screen. Just use TCastleWindow.SaveScreen to do it automatically. Version with ImageClass can save to any image format from PixelsImageClasses. Version with TCastleImage instance just uses this instance to save the image. You must pass here already created TCastleImage instance, it's class, Width and Height will be used when saving.
Exceptions raised
Source: src/base_rendering/castleglimages_savescreen.inc (line 65). |
function SaveScreen_NoFlush(const ImageClass: TCastleImageClass; const Rect: TRectangle; const ReadBuffer: TColorBuffer): TCastleImage; overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_savescreen.inc (line 68). |
procedure SaveScreen_NoFlush(const Image: TCastleImage; const Left, Bottom: Integer; const ReadBuffer: TColorBuffer); overload; |
|
This item has no description. Source: src/base_rendering/castleglimages_savescreen.inc (line 71). |
function SaveScreenToGL_NoFlush(const Rect: TRectangle; const ReadBuffer: TColorBuffer; const SmoothScaling: boolean = false): TDrawableImage; |
|
Captures current screen as a TDrawableImage instance, ready to be drawn on 2D screen. Source: src/base_rendering/castleglimages_savescreen.inc (line 76). |
function SaveScreenDepth_NoFlush(const Rect: TRectangle): TGrayscaleImage; |
|
Save depth buffer contents. Source: src/base_rendering/castleglimages_savescreen.inc (line 81). |
function OffscreenRendering: Boolean; |
|
Are we currently doing off-screen rendering. This is Source: src/base_rendering/castleglimages_rendertotexture.inc (line 271). |
function TextureMemoryProfiler: TTextureMemoryProfiler; |
|
OpenGL texture memory profiler, to detect which textures use up the GPU texture memory. Especially useful on mobile devices, where texture memory is limited and your application must really optimize texture usage. Also useful to detect texture memory leaks. Enable it at the very beginning of the application (for example in the main unit initialization clause), like this: TextureMemoryProfiler.Enabled := true
Then at any point during the game you can query texture usage by TTextureMemoryProfiler.Summary method. For example dump it to the log like this:
WritelnLog('Textures', TextureMemoryProfiler.Summary);
The resulting output lists the currently allocated textures, in descending order of their size. This tells you which textures are worth optimizing. Maybe scale these textures down, maybe compress them, maybe remove alpha channel or convert them to grayscale... The profiler counts the real texture size on GPU, knowing that some textures are resized to power of 2, that textures may be compressed on GPU, that some textures have mipmaps and so on. All kinds of textures (2D, 3D, cubemaps, float, depth etc.) are covered. Every type is reported — loaded from files, generated (like by GeneratedCubeMapTexture), embedded in code (by embedding images or fonts in code)... The textures loaded from disk are described by URL, for other textures we invent special URLs like:
You can also use the profiler from castle-model-viewer, run it with "–debug-texture-memory" command-line option, load your 3D model and then use menu option "Console -> Print Texture Memory Usage". Source: src/base_rendering/castleglimages_texturememoryprofiler.inc (line 114). |
procedure BeforeUnpackImage(const Image: TCastleImage); |
|
Save / restore OpenGL pixel store for unpacking / packing given TCastleImage. Before you pass this image to some OpenGL procedures (like glDrawPixels for unpacking, glReadPixels for packing), call BeforeXxx, and later call AfterXxx to restore original state. These will take care of setting / restoring pixel alignment. Source: src/base_rendering/castleglimages_packing.inc (line 28). |
procedure AfterUnpackImage(const Image: TCastleImage); |
|
This item has no description. Source: src/base_rendering/castleglimages_packing.inc (line 29). |
procedure BeforePackImage(const Image: TCastleImage); |
|
This item has no description. Source: src/base_rendering/castleglimages_packing.inc (line 30). |
procedure AfterPackImage(const Image: TCastleImage); |
|
This item has no description. Source: src/base_rendering/castleglimages_packing.inc (line 31). |
Types
TGLTextureId = TGLTexture; |
|
type - don't add type Delphi can't parse that correctly Source: src/base_rendering/castleglimages_miscellaneous.inc (line 61). |
TMinificationFilter = CastleRenderOptions.TMinificationFilter; |
|
We recommend using CastleRenderOptions unit to get these types. But for backward compatibility, they are also available here. Source: src/base_rendering/castleglimages_filter.inc (line 25). |
TMagnificationFilter = CastleRenderOptions.TMagnificationFilter; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 26). |
TGLImageManaged = TDrawableImage deprecated 'use TDrawableImage'; |
|
Warning: this symbol is deprecated: use TDrawableImage This item has no description. Source: src/base_rendering/castleglimages_drawableimage.inc (line 801). |
TGLImageOnDemand = TDrawableImage deprecated 'use TDrawableImage'; |
|
Warning: this symbol is deprecated: use TDrawableImage This item has no description. Source: src/base_rendering/castleglimages_drawableimage.inc (line 802). |
TGLImageCore = TDrawableImage deprecated 'use TDrawableImage'; |
|
Warning: this symbol is deprecated: use TDrawableImage This item has no description. Source: src/base_rendering/castleglimages_drawableimage.inc (line 803). |
TGLImage = TDrawableImage deprecated 'use TDrawableImage'; |
|
Warning: this symbol is deprecated: use TDrawableImage This item has no description. Source: src/base_rendering/castleglimages_drawableimage.inc (line 804). |
TProtectedSidesScaling = (...); |
|
How is TCastleImagePersistent.ProtectedSides applies. Determines how does the 9-slices algorithm work. Values
Source: src/base_rendering/castleglimages_persistentimage.inc (line 26). |
TTextureSizing = (...); |
|
Constraints on texture size, used by ResizeToTextureSize and IsTextureSized. Values
Source: src/base_rendering/castleglimages_load_2d.inc (line 29). |
TColorBuffer = (...); |
|
Color buffer to grab, used by SaveScreen_NoFlush. Values
Source: src/base_rendering/castleglimages_savescreen.inc (line 24). |
TGLRenderToTextureBuffer = (...); |
|
This item has no description. Values
Source: src/base_rendering/castleglimages_rendertotexture.inc (line 27). |
Constants
PixelsImageClasses: array [0..8] of TEncodedImageClass = (
TRGBImage,
TRGBAlphaImage,
TGrayscaleImage,
TGrayscaleAlphaImage,
TGPUCompressedImage,
TGrayscaleFloatImage,
TGrayscaleAlphaFloatImage,
TRGBFloatImage,
TRGBAlphaFloatImage
); |
|
Part of CastleGLImages unit: miscellaneous stuff. Source: src/base_rendering/castleglimages_miscellaneous.inc (line 22). |
minNearest = CastleRenderOptions.minNearest; |
|
We recommend using CastleRenderOptions unit to get these constants. But for backward compatibility, they are also available here. Source: src/base_rendering/castleglimages_filter.inc (line 56). |
minLinear = CastleRenderOptions.minLinear; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 57). |
minNearestMipmapNearest = CastleRenderOptions.minNearestMipmapNearest; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 58). |
minNearestMipmapLinear = CastleRenderOptions.minNearestMipmapLinear; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 59). |
minLinearMipmapNearest = CastleRenderOptions.minLinearMipmapNearest; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 60). |
minLinearMipmapLinear = CastleRenderOptions.minLinearMipmapLinear; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 61). |
magNearest = CastleRenderOptions.magNearest; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 62). |
magLinear = CastleRenderOptions.magLinear; |
|
This item has no description. Source: src/base_rendering/castleglimages_filter.inc (line 63). |
Texture2DRepeat: TTextureWrap2D = (Data: (GL_REPEAT, GL_REPEAT)); |
|
Part of CastleGLImages unit: texture wrapping modes. Source: src/base_rendering/castleglimages_wrap.inc (line 37). |
Variables
GLTextureScale: Cardinal = 1; |
|
Scaling for all textures loaded to OpenGL. This allows you to conserve GPU memory. Each size (width, height, and (for 3D textures) depth) is scaled by 1 / 2ˆ Note that textures used for GUI, by TDrawableImage (more precisely: all non-power-of-2 textures) avoid this scaling entirely. This allows to scale the textures at runtime. For an independent mechanism that allows to load already downscaled textures (and scale them as a preprocessing step when packaging your game), see TextureLoadingScale. The documentation of TextureLoadingScale lists all the differences between these two approaches to scaling. Source: src/base_rendering/castleglimages_load_2d.inc (line 93). |
GLTextureMinSize: Cardinal = 16; |
|
Constraints the scaling done by GLTextureScale. Scaling caused by GLTextureScale cannot scale texture to something less than Source: src/base_rendering/castleglimages_load_2d.inc (line 100). |
LogTextureLoading: boolean = false; |
|
Log (through CastleLog) all texture and image loading to GPU. If additionally TextureMemoryProfiler is enabled, then we will dump texture memory usage. Source: src/base_rendering/castleglimages_texturememoryprofiler.inc (line 120). |
Generated by PasDoc 0.17.0.snapshot.