Namespace: graphics
Language: Lua
Type: Defold Lua
File: script_graphics.cpp
Source: engine/script/src/script_graphics.cpp
Graphics functions and constants.
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT May be nil if multitarget rendering isn’t supported
Type: CONSTANT May be nil if multitarget rendering isn’t supported
Type: CONSTANT May be nil if multitarget rendering isn’t supported
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT Context feature flag indicating support for 3D (volume) textures.
Type: CONSTANT Context feature flag indicating support for ASTC compressed 2D array textures. Some WebGL/GLES drivers fail array texture ASTC uploads while 2D ASTC works.
Type: CONSTANT Context feature flag indicating support for min/max blend equations. Requires GLES3+ or EXT_blend_minmax.
Type: CONSTANT Context feature flag indicating support for compute shaders.
Type: CONSTANT Context feature flag indicating support for hardware instancing.
Type: CONSTANT Context feature flag indicating support for rendering to multiple color targets simultaneously.
Type: CONSTANT Context feature flag indicating support for storage buffers.
Type: CONSTANT Context feature flag indicating support for texture arrays.
Type: CONSTANT Context feature flag indicating support for vertical sync (vsync).
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: FUNCTION Returns a table describing the active graphics context: the adapter family, its hardware limits, the list of driver-reported extensions, and the set of optional context features supported by the backend.
Returns
info (table) - table with the following fields:
family string adapter family name (e.g. “opengl”, “vulkan”)
version_major number adapter API major version (e.g. 1 for Vulkan 1.4)
version_minor number adapter API minor version (e.g. 4 for Vulkan 1.4)
limits table hardware/driver limits:`max_texture_size_2d` [type:number] max 2D texture dimension in texels
`max_texture_size_3d` [type:number] max 3D (volume) texture dimension in texels
`max_texture_size_cube` [type:number] max cube map face dimension in texels
`max_texture_array_layers` [type:number] max layers in an array texture
`max_framebuffer_width` [type:number] max framebuffer width in pixels
`max_framebuffer_height` [type:number] max framebuffer height in pixels
`max_color_attachments` [type:number] max simultaneous color attachments
`max_samplers_per_stage` [type:number] max texture samplers per shader stage
`max_textures_per_stage` [type:number] max sampled textures per shader stage
`max_vertex_attributes` [type:number] max vertex attributes
`max_vertex_buffers` [type:number] max vertex buffer bindings
`max_compute_workgroup_size_x` [type:number] max compute workgroup size (X)
`max_compute_workgroup_size_y` [type:number] max compute workgroup size (Y)
`max_compute_workgroup_size_z` [type:number] max compute workgroup size (Z)
`max_compute_workgroup_invocations` [type:number] max invocations per compute workgroup
`max_compute_shared_memory_size` [type:number] max shared memory per compute workgroup (bytes)
`max_uniform_buffer_range` [type:number] max bindable uniform buffer range (bytes)
`max_storage_buffer_range` [type:number] max bindable storage buffer range (bytes)
extensions table array of driver-reported extension name strings
features table array of supported context feature ids:
`graphics.CONTEXT_FEATURE_MULTI_TARGET_RENDERING` multi-target rendering
`graphics.CONTEXT_FEATURE_TEXTURE_ARRAY` texture arrays
`graphics.CONTEXT_FEATURE_COMPUTE_SHADER` compute shaders
`graphics.CONTEXT_FEATURE_STORAGE_BUFFER` storage buffers
`graphics.CONTEXT_FEATURE_VSYNC` vertical sync
`graphics.CONTEXT_FEATURE_INSTANCING` hardware instancing
`graphics.CONTEXT_FEATURE_3D_TEXTURES` 3D (volume) textures
`graphics.CONTEXT_FEATURE_ASTC_ARRAY_TEXTURES` ASTC compressed 2D array textures
`graphics.CONTEXT_FEATURE_BLEND_EQUATION_MIN_MAX` min/max blend equations
Type: FUNCTION get the list of graphics adapters that have been registered with the engine
Returns
adapters (table) - array of adapter family name strings (e.g. “opengl”, “vulkan”, “webgpu”)Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT May be nil if the graphics driver doesn’t support it
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT
Type: CONSTANT