Class TGLFeatures
Unit
Declaration
type TGLFeatures = class(TObject)
Description
OpenGL(ES) features, analyzed based on extensions and version. A single instance of this class is assigned to GLFeatures after the first rendering context was created. If you have multiple rendering contexts, our engine assumes they share resources and have equal features.
Hierarchy
- TObject
- TGLFeatures
Overview
Fields
nested const ModernVersionMajor = 3; |
|
nested const ModernVersionMinor = 3; |
Methods
constructor Create; |
|
destructor Destroy; override; |
|
function MaxTextureUnits: Cardinal; |
Properties
property Version_1_2: Boolean read FVersion_1_2; |
|
property Version_1_3: Boolean read FVersion_1_3; |
|
property Version_1_4: Boolean read FVersion_1_4; |
|
property Version_1_5: Boolean read FVersion_1_5; |
|
property Version_2_0: Boolean read FVersion_2_0; |
|
property Version_2_1: Boolean read FVersion_2_1; |
|
property Version_3_0: Boolean read FVersion_3_0; |
|
property Version_3_1: Boolean read FVersion_3_1; |
|
property Version_3_2: Boolean read FVersion_3_2; |
|
property Version_3_3: Boolean read FVersion_3_3; |
|
property Version_4_0: Boolean read FVersion_4_0; |
|
property TextureFilterAnisotropic: Boolean read FTextureFilterAnisotropic; |
|
property NV_multisample_filter_hint: Boolean read FNV_multisample_filter_hint; |
|
property OcclusionQuery: Boolean read FOcclusionQuery; |
|
property CLAMP_TO_EDGE: TGLenum read FCLAMP_TO_EDGE; |
|
property MaxTextureSize: Cardinal read FMaxTextureSize; |
|
property MaxLights: Cardinal read FMaxLights; |
|
property MaxCubeMapTextureSize: Cardinal read FMaxCubeMapTextureSize; |
|
property MaxTexture3DSize: Cardinal read FMaxTexture3DSize; |
|
property MaxTextureMaxAnisotropy: Single read FMaxTextureMaxAnisotropy; |
|
property OcclusionQueryCounterBits: TGLint read FOcclusionQueryCounterBits; |
|
property MaxRenderbufferSize: TGLuint read FMaxRenderbufferSize; |
|
property MaxClipPlanes: Cardinal read FMaxClipPlanes; |
|
property Multisample: Boolean read FMultisample; |
|
property MaxTextureUnitsFixedFunction: Cardinal read FMaxTextureUnitsFixedFunction; |
|
property MaxTextureUnitsShaders: Cardinal read FMaxTextureUnitsShaders; |
|
property UseMultiTexturing: Boolean read FUseMultiTexturing; |
|
property Texture3D: Boolean read FTexture3D; |
|
property Framebuffer: Boolean read FFramebuffer; |
|
property FramebufferBlit: Boolean read FFramebufferBlit; |
|
property FBOMultiSampling: Boolean read FFBOMultiSampling; |
|
property CurrentMultiSampling: Cardinal read FCurrentMultiSampling; |
|
property PackedDepthStencil: Boolean read FPackedDepthStencil; |
|
property ShadowVolumesPossible: Boolean read FShadowVolumesPossible; |
|
property TextureNonPowerOfTwo: Boolean read FTextureNonPowerOfTwo; |
|
property TextureCubeMap: Boolean read FTextureCubeMap; |
|
property TextureCompression: TTextureCompressions read FTextureCompression; |
|
property VertexBufferObject: Boolean read FVertexBufferObject; |
|
property VertexArrayObject: Boolean read FVertexArrayObject; |
|
property BlendConstant: Boolean read FBlendConstant; |
|
property TextureFloat: Boolean read FTextureFloat; |
|
property TextureDepth: Boolean read FTextureDepth; |
|
property TextureDepthCompare: Boolean read FTextureDepthCompare; |
|
property Shaders: Boolean read FShaders; |
|
property EnableFixedFunction: Boolean read FEnableFixedFunction; |
|
class property RequestCapabilities: TGLRequestCapabilities
read FRequestCapabilities write SetRequestCapabilities; |
|
class property Debug: Boolean read FDebug write SetDebug; |
|
property Memory: TGLMemoryInfo read FMemory; |
|
property MaxViewportDimensions: TVector2Integer read FMaxViewportDimensions; |
|
property TextureModernFormatsAndSwizzle: Boolean read FTextureModernFormatsAndSwizzle; |
|
property RedBits: TGLint read FRedBits; |
|
property GreenBits: TGLint read FGreenBits; |
|
property BlueBits: TGLint read FBlueBits; |
|
property AlphaBits: TGLint read FAlphaBits; |
|
property DepthBits: TGLint read FDepthBits; |
|
property StencilBits: TGLint read FStencilBits; |
|
property DoubleBuffer: Boolean read FDoubleBuffer; |
|
property LineWidth: TVector2 read FLineWidth; |
|
property TextureMaxLevel: Boolean read FTextureMaxLevel; |
Description
Fields
nested const ModernVersionMajor = 3; |
|
OpenGL version considered "modern" for us, that we can use with its "core" profile. We need >= 3.2 as before it, there were no profiles (only "forward compatibility"). We need >= 3.3 as it has texture swizzle. When we don't have texture swizzle, then we cannot use modern OpenGL texture format constants, and so we need compatibility. See TextureModernFormatsAndSwizzle . |
nested const ModernVersionMinor = 3; |
|
This item has no description. |
Methods
constructor Create; |
|
This item has no description. |
destructor Destroy; override; |
|
This item has no description. |
function MaxTextureUnits: Cardinal; |
|
Maximum number of texture units you can safely always use. If EnableFixedFunction, this is MaxTextureUnitsFixedFunction, otherwise MaxTextureUnitsShaders. |
Properties
property Version_1_3: Boolean read FVersion_1_3; |
|
This item has no description. |
property Version_1_4: Boolean read FVersion_1_4; |
|
This item has no description. |
property Version_1_5: Boolean read FVersion_1_5; |
|
This item has no description. |
property Version_2_0: Boolean read FVersion_2_0; |
|
This item has no description. |
property Version_2_1: Boolean read FVersion_2_1; |
|
This item has no description. |
property Version_3_0: Boolean read FVersion_3_0; |
|
This item has no description. |
property Version_3_1: Boolean read FVersion_3_1; |
|
This item has no description. |
property Version_3_2: Boolean read FVersion_3_2; |
|
This item has no description. |
property Version_3_3: Boolean read FVersion_3_3; |
|
This item has no description. |
property Version_4_0: Boolean read FVersion_4_0; |
|
This item has no description. |
property TextureFilterAnisotropic: Boolean read FTextureFilterAnisotropic; |
|
Supports anisotropic texture filtering, as EXT_texture_filter_anisotropic extension (possible for both OpenGL and OpenGLES). This was introduced into OpenGL core late, but is widely available as extension. https://www.khronos.org/opengl/wiki/Sampler_Object#Anisotropic_filtering https://www.khronos.org/opengl/wiki/Ubiquitous_Extension |
property NV_multisample_filter_hint: Boolean read FNV_multisample_filter_hint; |
|
This item has no description. |
property OcclusionQuery: Boolean read FOcclusionQuery; |
|
Occlusion query (glGenQueries, glGetQueryObject, glBeginQuery, glEndQuery) in core OpenGL or OpenGLES. |
property CLAMP_TO_EDGE: TGLenum read FCLAMP_TO_EDGE; |
|
GL_CLAMP_TO_EDGE, if available in current OpenGL version. Otherwise GL_CLAMP. Use this (instead of just GL_CLAMP_TO_EDGE) to work with really ancient OpenGL versions before 1.2. |
property MaxTextureSize: Cardinal read FMaxTextureSize; |
|
Constant (for given context) OpenGL limits. Initialized to 0 if appropriate OpenGL functionality is not available. Note that MaxLights is only relevant if we use OpenGL fixed-function pipeline. Otherwise the actual limit is defined purely by Scene.RenderOptions.MaxLightsPerShape, specific to each TCastleScene, and is completely configurable (can be higher or lower than MaxLights). |
property MaxLights: Cardinal read FMaxLights; |
|
This item has no description. |
property MaxCubeMapTextureSize: Cardinal read FMaxCubeMapTextureSize; |
|
This item has no description. |
property MaxTexture3DSize: Cardinal read FMaxTexture3DSize; |
|
This item has no description. |
property MaxTextureMaxAnisotropy: Single read FMaxTextureMaxAnisotropy; |
|
This item has no description. |
property OcclusionQueryCounterBits: TGLint read FOcclusionQueryCounterBits; |
|
This item has no description. |
property MaxRenderbufferSize: TGLuint read FMaxRenderbufferSize; |
|
This item has no description. |
property MaxClipPlanes: Cardinal read FMaxClipPlanes; |
|
This item has no description. |
property MaxTextureUnitsFixedFunction: Cardinal read FMaxTextureUnitsFixedFunction; |
|
Number of texture units available for fixed-function pipeline. Since querying glGetInteger(GL_MAX_TEXTURE_UNITS) is deprecated (or not even possible in case of OpenGLES or "core" profile) and we want to keep fixed-function support as simple as possible, we just assume 2 (the only number guaranteed) if only multi-texturing is available (UseMultiTexturing). |
property MaxTextureUnitsShaders: Cardinal read FMaxTextureUnitsShaders; |
|
Number of texture units available for shader pipeline. |
property Texture3D: Boolean read FTexture3D; |
|
Are 3D textures (GL_TEXTURE_3D, glTexImage3D) supported by core OpenGL or OpenGLES. |
property Framebuffer: Boolean read FFramebuffer; |
|
Framebuffer supported, by core OpenGL or OpenGLES. |
property FramebufferBlit: Boolean read FFramebufferBlit; |
|
glFramebufferBlit supported, by core OpenGL or OpenGLES. |
property FBOMultiSampling: Boolean read FFBOMultiSampling; |
|
Is multisampling possible for FBO buffers and textures. Although these are two orthogonal features of OpenGL, in practice you want to use multisample for both FBO buffers and textures, or for none — otherwise, FBO can not be initialized correctly when you mix various multisample settings. |
property CurrentMultiSampling: Cardinal read FCurrentMultiSampling; |
|
How multi-sampling was initialized for this OpenGL context. Value = 1 means that no multi-sampling is initialized. Values > 1 mean that you have multi-sampling, with given number of samples per pixel. Contrast this with TCastleWindow.MultiSampling or TOpenGLControl.MultiSampling, that say how many samples you wanted to get. |
property PackedDepthStencil: Boolean read FPackedDepthStencil; |
|
Does OpenGL context have depth buffer packed with stencil buffer. See OpenGL extensions EXT_packed_depth_stencil and OES_packed_depth_stencil (http://www.opengl.org/registry/specs/EXT/packed_depth_stencil.txt, https://www.khronos.org/registry/OpenGL/extensions/OES/OES_packed_depth_stencil.txt) for explanation what does it mean. This is important for FBOs, as the depth/stencil have to be set up differently depending on For now, this is simply equal to GL_EXT_packed_depth_stencil. (TODO: for core OpenGL 3, how to detect should we use packed version? http://www.opengl.org/registry/specs/ARB/framebuffer_object.txt incorporates EXT_packed_depth_stencil, so forward-compatible contexts do not need to declare it. Should we assume that forward-compatible gl 3 contexts always have depth/stencil packed?) |
property TextureNonPowerOfTwo: Boolean read FTextureNonPowerOfTwo; |
|
Are non-power-of-2 textures supported. |
property TextureCubeMap: Boolean read FTextureCubeMap; |
|
Are cubemaps supported (so you can load to texture targets like GL_TEXTURE_CUBE_MAP_POSITIVE/NEGATIVE_X/Y/Z) by core OpenGL or OpenGLES. |
property TextureCompression: TTextureCompressions read FTextureCompression; |
|
Which texture compression formats are supported. If this is not [], then we guarantee glCompressedTexImage2D is also supported. |
property VertexBufferObject: Boolean read FVertexBufferObject; |
|
VBO support (in OpenGL (ES) core). |
property VertexArrayObject: Boolean read FVertexArrayObject; |
|
VAO support (in OpenGL (ES) core). |
property BlendConstant: Boolean read FBlendConstant; |
|
glBlendColor and GL_CONSTANT_ALPHA support. |
property TextureFloat: Boolean read FTextureFloat; |
|
Support for float texture formats for glTexImage2d. |
property TextureDepth: Boolean read FTextureDepth; |
|
Support for depth texture formats for glTexImage2d. |
property TextureDepthCompare: Boolean read FTextureDepthCompare; |
|
Ability to create depth textures (TextureDepth), to define comparison on them: GL_TEXTURE_COMPARE_MODE, GL_TEXTURE_COMPARE_FUNC, GL_COMPARE_REF_TO_TEXTURE, finally to use then in shaders (sampler2DShadow). On OpenGLES the GLSL constructs require that we can use "#version 300 es", to access sampler2DShadow using texture / textureProj calls. |
property Shaders: Boolean read FShaders; |
|
Are GLSL shaders supported. |
property EnableFixedFunction: Boolean read FEnableFixedFunction; |
|
Use OpenGL fixed-function rendering for ancient OpenGL versions on desktops. This rules whole rendering approach. When this is
When this is Note that UseMultiTexturing may be When this is
Note that on OpenGLES, it must be always |
class property RequestCapabilities: TGLRequestCapabilities
read FRequestCapabilities write SetRequestCapabilities; |
|
Request specific OpenGL(ES) capabilities at context creation.
This is a class property and it can only change before OpenGL(ES) context is initialized, which means before TCastleWindow.Open occurs, which means before GLFeatures instance is initialized. The routines that initialize OpenGL(ES) context, like using wgl (on Windows) or glX (on Unix) should look at this setting and honour it. Normal code using OpenGL(ES) should not look at this property: instead, detect the current OpenGL(ES) capabilities looking at properties of current TGLFeatures instance, like TGLFeatures.Framebuffer, TGLFeatures.Version_4_0 etc. This way, we should use modern features both when rcForceFixedFunction and rcAutomatic is set. |
property Memory: TGLMemoryInfo read FMemory; |
|
Total and current memory available. Call Memory.Refresh whenever needed. |
property MaxViewportDimensions: TVector2Integer read FMaxViewportDimensions; |
|
This item has no description. |
property TextureModernFormatsAndSwizzle: Boolean read FTextureModernFormatsAndSwizzle; |
|
We should use modern OpenGL enums for format, internal format and we have texture swizzle available. This means we should use e.g. GL_RG8 and not GL_LUMINANCE_ALPHA. See https://www.khronos.org/opengl/wiki/Image_Format . To make it always work (e.g. to use grayscale or grayscale+alpha images), we really need https://www.khronos.org/opengl/wiki/Texture#Swizzle_mask https://registry.khronos.org/OpenGL/extensions/ARB/ARB_texture_swizzle.txt https://registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_swizzle.txt (core extension since 3.3). |
property RedBits: TGLint read FRedBits; |
|
Size, in bits, of the red channel of the color buffer. |
property GreenBits: TGLint read FGreenBits; |
|
Size, in bits, of the green channel of the color buffer. |
property BlueBits: TGLint read FBlueBits; |
|
Size, in bits, of the blue channel of the color buffer. |
property AlphaBits: TGLint read FAlphaBits; |
|
Size, in bits, of the alpha channel of the color buffer. |
property DepthBits: TGLint read FDepthBits; |
|
Size, in bits, of the depth buffer. |
property StencilBits: TGLint read FStencilBits; |
|
Size, in bits, of the stencil buffer. |
property DoubleBuffer: Boolean read FDoubleBuffer; |
|
Do we have double-buffer. |
property LineWidth: TVector2 read FLineWidth; |
|
Line width granularity and maximum width. |
property TextureMaxLevel: Boolean read FTextureMaxLevel; |
|
Supports glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAX_LEVEL, ...); |
Generated by PasDoc 0.16.0-snapshot.