VisualServer¶
Inherits: Object
Servidor para cualquier cosa visible.
Descripción¶
Servidor para cualquier cosa visible. El servidor de renderizado es el backend de la API para todo lo visible. Todo el sistema de la escena se monta en él para mostrar.
El servidor de renderizado es completamente opaco, los internos son completamente específicos de la implementación y no se puede acceder a ellos.
El servidor de renderizado puede ser usado para evitar el sistema de escenas por completo.
Los recursos se crean usando las funciones *_create
.
Todos los objetos se dibujan en una vista. Se puede utilizar la Viewport adjunta al SceneTree o se puede crear una por uno mismo con el viewport_create. Cuando se utiliza un escenario o lienzo personalizado, el escenario o lienzo debe adjuntarse a la ventana de visualización utilizando viewport_set_scenario o viewport_attach_canvas.
En 3D, todos los objetos visuales deben estar asociados a un escenario. El escenario es una representación visual del mundo. Si se accede al servidor de renderizado desde un juego en ejecución, se puede acceder al escenario desde el árbol de la escena desde cualquier nodo Spatial con Spatial.get_world. De lo contrario, se puede crear un escenario con scenario_create.
De manera similar, en 2D, se necesita un lienzo para dibujar todos los elementos del lienzo.
En 3D, todos los objetos visibles están compuestos por un recurso y una instancia. Un recurso puede ser una malla, un sistema de partículas, una luz o cualquier otro objeto en 3D. Para ser visibles, los recursos deben ser adjuntados a una instancia usando el instance_set_base. La instancia también debe ser adjuntada al escenario usando instance_set_scenario para ser visible.
En 2D, todos los objetos visibles son una especie de lienzo. Para ser visible, un elemento de lienzo debe ser el hijo de un lienzo unido a una ventana de visualización, o debe ser el hijo de otro elemento de lienzo que eventualmente se une al lienzo.
Tutoriales¶
Propiedades¶
Métodos¶
Señales¶
frame_post_draw ( )
Emitted at the end of the frame, after the VisualServer has finished updating all the Viewports.
frame_pre_draw ( )
Emitted at the beginning of the frame, before the VisualServer updates all the Viewports.
Enumeraciones¶
enum CubeMapSide:
CUBEMAP_LEFT = 0 --- Marks the left side of a cubemap.
CUBEMAP_RIGHT = 1 --- Marks the right side of a cubemap.
CUBEMAP_BOTTOM = 2 --- Marks the bottom side of a cubemap.
CUBEMAP_TOP = 3 --- Marks the top side of a cubemap.
CUBEMAP_FRONT = 4 --- Marks the front side of a cubemap.
CUBEMAP_BACK = 5 --- Marks the back side of a cubemap.
enum TextureType:
TEXTURE_TYPE_2D = 0 --- Normal texture with 2 dimensions, width and height.
TEXTURE_TYPE_CUBEMAP = 2 --- Texture made up of six faces, can be looked up with a
vec3
in shader.TEXTURE_TYPE_2D_ARRAY = 3 --- An array of 2-dimensional textures.
TEXTURE_TYPE_3D = 4 --- A 3-dimensional texture with width, height, and depth.
enum TextureFlags:
TEXTURE_FLAG_MIPMAPS = 1 --- Generates mipmaps, which are smaller versions of the same texture to use when zoomed out, keeping the aspect ratio.
TEXTURE_FLAG_REPEAT = 2 --- Repeats the texture (instead of clamp to edge).
TEXTURE_FLAG_FILTER = 4 --- Uses a magnifying filter, to enable smooth zooming in of the texture.
TEXTURE_FLAG_ANISOTROPIC_FILTER = 8 --- Uses anisotropic mipmap filtering. Generates smaller versions of the same texture with different aspect ratios.
This results in better-looking textures when viewed from oblique angles.
TEXTURE_FLAG_CONVERT_TO_LINEAR = 16 --- Converts the texture to the sRGB color space.
TEXTURE_FLAG_MIRRORED_REPEAT = 32 --- Repeats the texture with alternate sections mirrored.
TEXTURE_FLAG_USED_FOR_STREAMING = 2048 --- Texture is a video surface.
TEXTURE_FLAGS_DEFAULT = 7 --- Default flags. TEXTURE_FLAG_MIPMAPS, TEXTURE_FLAG_REPEAT and TEXTURE_FLAG_FILTER are enabled.
enum ShaderMode:
SHADER_SPATIAL = 0 --- Shader es un shader 3D.
SHADER_CANVAS_ITEM = 1 --- Shader es un shader 2D.
SHADER_PARTICLES = 2 --- Shader es un shader de partículas.
SHADER_MAX = 3 --- Representa el tamaño del enum ShaderMode.
enum ArrayType:
ARRAY_VERTEX = 0 --- El array es un array de vértices.
ARRAY_NORMAL = 1 --- El array es un array normales.
ARRAY_TANGENT = 2 --- El Array es una array de tangentes.
ARRAY_COLOR = 3 --- El Array es un array de colores.
ARRAY_TEX_UV = 4 --- El Array es un array de coordenadas UV.
ARRAY_TEX_UV2 = 5 --- El Array es un array de coordenadas UV para las segundas coordenadas UV.
ARRAY_BONES = 6 --- El Array contiene información sobre los huesos.
ARRAY_WEIGHTS = 7 --- El Array contiene la información de pesos.
ARRAY_INDEX = 8 --- El Array es un array de índices.
ARRAY_MAX = 9 --- Representa el tamaño del enum ArrayType.
enum ArrayFormat:
ARRAY_FORMAT_VERTEX = 1 --- Bandera usada para marcar un array de vértices.
ARRAY_FORMAT_NORMAL = 2 --- Bandera usada para marcar una array de normales.
ARRAY_FORMAT_TANGENT = 4 --- Bandera usada para marcar un array de tangentes.
ARRAY_FORMAT_COLOR = 8 --- Bandera usada para marcar un array de colores.
ARRAY_FORMAT_TEX_UV = 16 --- Bandera usada para marcar un conjunto de coordenadas UV.
ARRAY_FORMAT_TEX_UV2 = 32 --- Bandera usada para marcar un array de coordenadas UV para las segundas coordenadas UV.
ARRAY_FORMAT_BONES = 64 --- Bandera usada para marcar un array con información de huesos.
ARRAY_FORMAT_WEIGHTS = 128 --- Bandera usada para marcar un array de pesos.
ARRAY_FORMAT_INDEX = 256 --- Bandera usada para marcar un array de índices.
ARRAY_COMPRESS_VERTEX = 512 --- Flag used to mark a compressed (half float) vertex array.
ARRAY_COMPRESS_NORMAL = 1024 --- Flag utilizada para marcar un array normal comprimido (real).
ARRAY_COMPRESS_TANGENT = 2048 --- Flag utilizada para marcar un array tangencial comprimido (real).
ARRAY_COMPRESS_COLOR = 4096 --- Flag usada para marcar una array de colores comprimida (real).
ARRAY_COMPRESS_TEX_UV = 8192 --- Flag usada para marcar un array de coordenadas UV comprimidas (real).
ARRAY_COMPRESS_TEX_UV2 = 16384 --- Flag usada para marcar un array de coordenadas UV comprimidas (real) para las segundas coordenadas UV.
ARRAY_COMPRESS_BONES = 32768 --- Flag used to mark a compressed bone array.
ARRAY_COMPRESS_WEIGHTS = 65536 --- Flag used to mark a compressed (half float) weight array.
ARRAY_COMPRESS_INDEX = 131072 --- Flag usada para marcar un array de índices comprimida.
ARRAY_FLAG_USE_2D_VERTICES = 262144 --- Flag usada para marcar que el array contiene vértices 2D.
ARRAY_FLAG_USE_16_BIT_BONES = 524288 --- Flag used to mark that the array uses 16-bit bones instead of 8-bit.
ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION = 2097152 --- Flag used to mark that the array uses an octahedral representation of normal and tangent vectors rather than cartesian.
ARRAY_COMPRESS_DEFAULT = 2194432 --- Used to set flags ARRAY_COMPRESS_NORMAL, ARRAY_COMPRESS_TANGENT, ARRAY_COMPRESS_COLOR, ARRAY_COMPRESS_TEX_UV, ARRAY_COMPRESS_TEX_UV2, ARRAY_COMPRESS_WEIGHTS, and ARRAY_FLAG_USE_OCTAHEDRAL_COMPRESSION quickly.
enum PrimitiveType:
PRIMITIVE_POINTS = 0 --- Primitiva para dibujar vagones de puntos.
PRIMITIVE_LINES = 1 --- Primitiva para dibujar vagones de líneas.
PRIMITIVE_LINE_STRIP = 2 --- Primitiva para dibujar consiste en una franja de líneas de principio a fin.
PRIMITIVE_LINE_LOOP = 3 --- Primitive to draw consists of a line loop (a line strip with a line between the last and the first vertex).
PRIMITIVE_TRIANGLES = 4 --- Primitiva para dibujar vagones de triángulos.
PRIMITIVE_TRIANGLE_STRIP = 5 --- Primitiva para dibujar consiste en una tira de triángulo (los últimos 3 vértices siempre se combinan para formar un triángulo).
PRIMITIVE_TRIANGLE_FAN = 6 --- Primitive to draw consists of a triangle strip (the last 2 vertices are always combined with the first to make a triangle).
PRIMITIVE_MAX = 7 --- Representa el tamaño del enum PrimitiveType.
enum BlendShapeMode:
BLEND_SHAPE_MODE_NORMALIZED = 0 --- Las formas de la mezcla se normalizan.
BLEND_SHAPE_MODE_RELATIVE = 1 --- Las formas de la mezcla son relativas al peso base.
enum LightType:
LIGHT_DIRECTIONAL = 0 --- Es una luz direccional (sol).
LIGHT_OMNI = 1 --- Es una luz omnipresente.
LIGHT_SPOT = 2 --- Es un foco de luz.
enum LightParam:
LIGHT_PARAM_ENERGY = 0 --- La energía de la luz.
LIGHT_PARAM_INDIRECT_ENERGY = 1 --- Secondary multiplier used with indirect light (light bounces).
LIGHT_PARAM_SIZE = 2 --- The light's size, currently only used for soft shadows in baked lightmaps.
LIGHT_PARAM_SPECULAR = 3 --- La influencia de la luz en la especularidad.
LIGHT_PARAM_RANGE = 4 --- El rango de la luz.
LIGHT_PARAM_ATTENUATION = 5 --- La atenuación de la luz.
LIGHT_PARAM_SPOT_ANGLE = 6 --- El ángulo del foco.
LIGHT_PARAM_SPOT_ATTENUATION = 7 --- La atenuación del foco.
LIGHT_PARAM_CONTACT_SHADOW_SIZE = 8 --- Scales the shadow color.
LIGHT_PARAM_SHADOW_MAX_DISTANCE = 9 --- La distancia máxima a la que las sombras se renderizarán.
LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET = 10 --- Proporción de atlas de sombras ocupados por la primera división.
LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET = 11 --- Proporción del atlas de las sombras ocupado por la segunda división.
LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET = 12 --- Proporción del atlas de las sombras ocupado por la tercera división. La cuarta división ocupa el resto.
LIGHT_PARAM_SHADOW_NORMAL_BIAS = 13 --- Sesgo normal usado para compensar la búsqueda de sombras por el objeto normal. Puede ser usado para arreglar artefactos de auto-sombra.
LIGHT_PARAM_SHADOW_BIAS = 14 --- Predisponer la búsqueda de sombras para arreglar los artefactos que se ensombrecen a sí mismos.
LIGHT_PARAM_SHADOW_BIAS_SPLIT_SCALE = 15 --- Increases bias on further splits to fix self-shadowing that only occurs far away from the camera.
LIGHT_PARAM_MAX = 16 --- Representa el tamaño del enum LightParam.
enum LightBakeMode:
LIGHT_BAKE_DISABLED = 0
LIGHT_BAKE_INDIRECT = 1
LIGHT_BAKE_ALL = 2
enum LightOmniShadowMode:
LIGHT_OMNI_SHADOW_DUAL_PARABOLOID = 0 --- Usar un mapa de sombras paraboloide doble para las luces omnidireccionales.
LIGHT_OMNI_SHADOW_CUBE = 1 --- Usa un mapa de cubo de sombras para las luces omnidireccionales. Más lento pero de mejor calidad que el paraboloide dual.
enum LightOmniShadowDetail:
LIGHT_OMNI_SHADOW_DETAIL_VERTICAL = 0 --- Use more detail vertically when computing shadow map.
LIGHT_OMNI_SHADOW_DETAIL_HORIZONTAL = 1 --- Use more detail horizontally when computing shadow map.
enum LightDirectionalShadowMode:
LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL = 0 --- Usar proyección de sombra ortogonal para la luz direccional.
LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS = 1 --- Use 2 divisiones para la proyección de sombras cuando use luz direccional.
LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS = 2 --- Use 4 divisiones para la proyección de sombras cuando use luz direccional.
enum LightDirectionalShadowDepthRangeMode:
LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE = 0 --- Mantiene las sombras estables a medida que la cámara se mueve, pero tiene una resolución efectiva más baja.
LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_OPTIMIZED = 1 --- Optimizar el uso de los mapas de sombra, aumentando la resolución efectiva. Pero puede dar lugar a que las sombras se muevan o parpadeen ligeramente.
enum ViewportUpdateMode:
VIEWPORT_UPDATE_DISABLED = 0 --- No actualice el viewport.
VIEWPORT_UPDATE_ONCE = 1 --- Actualiza el viewport una vez y luego ponlo en desactivado.
VIEWPORT_UPDATE_WHEN_VISIBLE = 2 --- Actualice el viewport siempre que sea visible.
VIEWPORT_UPDATE_ALWAYS = 3 --- Siempre actualiza el viewport.
enum ViewportClearMode:
VIEWPORT_CLEAR_ALWAYS = 0 --- El viewport siempre se limpia antes de dibujar.
VIEWPORT_CLEAR_NEVER = 1 --- El viewport nunca se limpia antes de dibujar.
VIEWPORT_CLEAR_ONLY_NEXT_FRAME = 2 --- El viewport se borra una vez, luego el modo de borrado se establece en VIEWPORT_CLEAR_NEVER.
enum ViewportMSAA:
VIEWPORT_MSAA_DISABLED = 0 --- El antialiasing multimuestra está desactivado.
VIEWPORT_MSAA_2X = 1 --- Multisample antialiasing is set to 2×.
VIEWPORT_MSAA_4X = 2 --- Multisample antialiasing is set to 4×.
VIEWPORT_MSAA_8X = 3 --- Multisample antialiasing is set to 8×.
VIEWPORT_MSAA_16X = 4 --- Multisample antialiasing is set to 16×.
VIEWPORT_MSAA_EXT_2X = 5 --- Multisample antialiasing is set to 2× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go).
VIEWPORT_MSAA_EXT_4X = 6 --- Multisample antialiasing is set to 4× on external texture. Special mode for GLES2 Android VR (Oculus Quest and Go).
enum ViewportUsage:
VIEWPORT_USAGE_2D = 0 --- The Viewport does not render 3D but samples.
VIEWPORT_USAGE_2D_NO_SAMPLING = 1 --- The Viewport does not render 3D and does not sample.
VIEWPORT_USAGE_3D = 2 --- The Viewport renders 3D with effects.
VIEWPORT_USAGE_3D_NO_EFFECTS = 3 --- The Viewport renders 3D but without effects.
enum ViewportRenderInfo:
VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME = 0 --- Número de objetos dibujados en un solo fotograma.
VIEWPORT_RENDER_INFO_VERTICES_IN_FRAME = 1 --- Número de vértices dibujados en un solo fotograma.
VIEWPORT_RENDER_INFO_MATERIAL_CHANGES_IN_FRAME = 2 --- Número de cambios materiales durante este fotograma.
VIEWPORT_RENDER_INFO_SHADER_CHANGES_IN_FRAME = 3 --- El número de cambios de shader durante este fotograma.
VIEWPORT_RENDER_INFO_SURFACE_CHANGES_IN_FRAME = 4 --- El número de cambios en la superficie durante este fotograma.
VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME = 5 --- Número de llamadas de dibujo durante este fotograma.
VIEWPORT_RENDER_INFO_2D_ITEMS_IN_FRAME = 6 --- Number of 2d items drawn this frame.
VIEWPORT_RENDER_INFO_2D_DRAW_CALLS_IN_FRAME = 7 --- Number of 2d draw calls during this frame.
VIEWPORT_RENDER_INFO_MAX = 8 --- Representa el tamaño del enum ViewportRenderInfo.
enum ViewportDebugDraw:
VIEWPORT_DEBUG_DRAW_DISABLED = 0 --- El dibujado de depuración está desactivado. Configuración predeterminada.
VIEWPORT_DEBUG_DRAW_UNSHADED = 1 --- Debug draw sets objects to unshaded.
VIEWPORT_DEBUG_DRAW_OVERDRAW = 2 --- Overwrites clear color to
(0,0,0,0)
.VIEWPORT_DEBUG_DRAW_WIREFRAME = 3 --- El dibujado de depuración dibuja objetos en un marco de alambre.
enum ScenarioDebugMode:
SCENARIO_DEBUG_DISABLED = 0 --- No utilice el modo de depuración.
SCENARIO_DEBUG_WIREFRAME = 1 --- Dibujar todos los objetos como modelos de malla de alambre.
SCENARIO_DEBUG_OVERDRAW = 2 --- Dibuja todos los objetos de manera que se vea cuánto se está sobregirando. El sobregirado se produce cuando se dibuja y sombrea una sección de píxeles y luego otro objeto la cubre. Para optimizar una escena, debes reducir el sobregirado.
SCENARIO_DEBUG_SHADELESS = 3 --- Dibuja todos los objetos sin sombrear. Equivale a poner todos los objetos shaders en
unshaded
.
enum InstanceType:
INSTANCE_NONE = 0 --- La instancia no tiene un tipo.
INSTANCE_MESH = 1 --- La instancia es una malla.
INSTANCE_MULTIMESH = 2 --- La instancia es una multimalla.
INSTANCE_IMMEDIATE = 3 --- La instancia es una geometría inmediata.
INSTANCE_PARTICLES = 4 --- El caso es un emisor de partículas.
INSTANCE_LIGHT = 5 --- La instancia es una luz.
INSTANCE_REFLECTION_PROBE = 6 --- La instancia es una sonda de reflexión.
INSTANCE_GI_PROBE = 7 --- El caso es una sonda GI.
INSTANCE_LIGHTMAP_CAPTURE = 8 --- The instance is a lightmap capture.
INSTANCE_MAX = 9 --- Representa el tamaño del enumInstanceType.
INSTANCE_GEOMETRY_MASK = 30 --- Una combinación de las banderas de las instancias de la geometría (malla, multimesh, inmediata y partículas).
enum InstanceFlags:
INSTANCE_FLAG_USE_BAKED_LIGHT = 0 --- Permite que la instancia se utilice en la iluminación del cocinado.
INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = 1 --- Cuando se establece, pide manualmente dibujar la geometría en el siguiente fotograma.
INSTANCE_FLAG_MAX = 2 --- Representa el tamaño del enum InstanceFlags.
enum ShadowCastingSetting:
SHADOW_CASTING_SETTING_OFF = 0 --- Deshabilita sombras de esta instancia.
SHADOW_CASTING_SETTING_ON = 1 --- Proyecta sombras de esta instancia.
SHADOW_CASTING_SETTING_DOUBLE_SIDED = 2 --- Deshabilitar la selección de la cara posterior cuando se renderice la sombra del objeto. Esto es un poco más lento pero puede resultar en sombras más correctas.
SHADOW_CASTING_SETTING_SHADOWS_ONLY = 3 --- Sólo se muestran las sombras del objeto. El objeto en sí no será dibujado.
enum NinePatchAxisMode:
NINE_PATCH_STRETCH = 0 --- El nine patch se estira donde es necesario.
NINE_PATCH_TILE = 1 --- El nine patch se llena de tiles donde sea necesario.
NINE_PATCH_TILE_FIT = 2 --- El nine patch se llena de tiles donde sea necesario y se estira un poco si es necesario.
enum CanvasLightMode:
CANVAS_LIGHT_MODE_ADD = 0 --- Añade un aditivo de color claro al canvas.
CANVAS_LIGHT_MODE_SUB = 1 --- Añade el color de la luz que se sustrae al canvas.
CANVAS_LIGHT_MODE_MIX = 2 --- La luz añade color dependiendo de la transparencia.
CANVAS_LIGHT_MODE_MASK = 3 --- La luz añade color dependiendo de la máscara.
enum CanvasLightShadowFilter:
CANVAS_LIGHT_FILTER_NONE = 0 --- No aplique un filtro a las sombras de luz del canvas.
CANVAS_LIGHT_FILTER_PCF3 = 1 --- Use PCF3 filtering to filter canvas light shadows.
CANVAS_LIGHT_FILTER_PCF5 = 2 --- Utiliza el filtro PCF5 para filtrar las sombras de luz del canvas.
CANVAS_LIGHT_FILTER_PCF7 = 3 --- Use PCF7 filtering to filter canvas light shadows.
CANVAS_LIGHT_FILTER_PCF9 = 4 --- Use PCF9 filtering to filter canvas light shadows.
CANVAS_LIGHT_FILTER_PCF13 = 5 --- Utiliza el filtro PCF13 para filtrar las sombras de luz del canvas.
enum CanvasOccluderPolygonCullMode:
CANVAS_OCCLUDER_POLYGON_CULL_DISABLED = 0 --- Selección del oclusor del canvas está desactivado.
CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE = 1 --- La selección del oclusor del canvas se hace en el sentido de las agujas del reloj.
CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE = 2 --- La selección del oclusor del canvas es en sentido contrario a las agujas del reloj.
enum RenderInfo:
INFO_OBJECTS_IN_FRAME = 0 --- La cantidad de objetos en el fotograma.
INFO_VERTICES_IN_FRAME = 1 --- La cantidad de vértices en el fotograma.
INFO_MATERIAL_CHANGES_IN_FRAME = 2 --- La cantidad de materiales modificados en el fotograma.
INFO_SHADER_CHANGES_IN_FRAME = 3 --- La cantidad del shader se repite en el fotograma.
INFO_SURFACE_CHANGES_IN_FRAME = 4 --- La cantidad de superficie cambia en el fotograma.
INFO_DRAW_CALLS_IN_FRAME = 5 --- La cantidad de llamadas de dibujo en el fotograma.
INFO_2D_ITEMS_IN_FRAME = 6 --- The amount of 2d items in the frame.
INFO_2D_DRAW_CALLS_IN_FRAME = 7 --- The amount of 2d draw calls in frame.
INFO_USAGE_VIDEO_MEM_TOTAL = 8 --- Unimplemented in the GLES2 and GLES3 rendering backends, always returns 0.
INFO_VIDEO_MEM_USED = 9 --- La cantidad de memoria de vídeo utilizada, es decir, la memoria de texturas y vértices combinados.
INFO_TEXTURE_MEM_USED = 10 --- La cantidad de memoria de textura utilizada.
INFO_VERTEX_MEM_USED = 11 --- La cantidad de memoria de vértices utilizada.
enum Features:
FEATURE_SHADERS = 0 --- El hardware soporta los shaders. Esta enum no se usa actualmente en Godot 3.x.
FEATURE_MULTITHREADED = 1 --- El hardware soporta el multihilo. Este enum no se usa actualmente en Godot 3.x.
enum MultimeshTransformFormat:
MULTIMESH_TRANSFORM_2D = 0 --- Use Transform2D para almacenar la transformada de MultiMalla.
MULTIMESH_TRANSFORM_3D = 1 --- Use Transform para almacenar la transformada de MultiMesh.
enum MultimeshColorFormat:
MULTIMESH_COLOR_NONE = 0 --- MultiMesh does not use per-instance color.
MULTIMESH_COLOR_8BIT = 1 --- MultiMesh color uses 8 bits per component. This packs the color into a single float.
MULTIMESH_COLOR_FLOAT = 2 --- MultiMesh color uses a float per channel.
enum MultimeshCustomDataFormat:
MULTIMESH_CUSTOM_DATA_NONE = 0 --- MultiMesh does not use custom data.
MULTIMESH_CUSTOM_DATA_8BIT = 1 --- MultiMesh custom data uses 8 bits per component. This packs the 4-component custom data into a single float.
MULTIMESH_CUSTOM_DATA_FLOAT = 2 --- MultiMesh custom data uses a float per component.
enum ReflectionProbeUpdateMode:
REFLECTION_PROBE_UPDATE_ONCE = 0 --- La sonda de reflexión actualizará las reflexiones una vez y luego se detendrá.
REFLECTION_PROBE_UPDATE_ALWAYS = 1 --- La sonda de reflexión actualizará cada cuadro. Este modo es necesario para capturar objetos en movimiento.
enum ParticlesDrawOrder:
PARTICLES_DRAW_ORDER_INDEX = 0 --- Dibuja las partículas en el orden en que aparecen en el array de partículas.
PARTICLES_DRAW_ORDER_LIFETIME = 1 --- Clasificar las partículas en función de su vida útil.
PARTICLES_DRAW_ORDER_VIEW_DEPTH = 2 --- Clasifica las partículas según su distancia a la cámara.
enum EnvironmentBG:
ENV_BG_CLEAR_COLOR = 0 --- Usa el color limpio como fondo.
ENV_BG_COLOR = 1 --- Utilice un color específico como fondo.
ENV_BG_SKY = 2 --- Usar un recurso del cielo para el fondo.
ENV_BG_COLOR_SKY = 3 --- Use a custom color for background, but use a sky for shading and reflections.
ENV_BG_CANVAS = 4 --- Usar una capa de canvas especifica como fondo. Esto puede ser útil para instanciar una escena 2D en un mundo 3D.
ENV_BG_KEEP = 5 --- No despeje el fondo, use el último fotograma como fondo.
ENV_BG_MAX = 7 --- Representa el tamaño del enum EnvironmentBG.
enum EnvironmentDOFBlurQuality:
ENV_DOF_BLUR_QUALITY_LOW = 0 --- Use lowest blur quality. Fastest, but may look bad.
ENV_DOF_BLUR_QUALITY_MEDIUM = 1 --- Use medium blur quality.
ENV_DOF_BLUR_QUALITY_HIGH = 2 --- Used highest blur quality. Looks the best, but is the slowest.
enum EnvironmentGlowBlendMode:
GLOW_BLEND_MODE_ADDITIVE = 0 --- Add the effect of the glow on top of the scene.
GLOW_BLEND_MODE_SCREEN = 1 --- Blends the glow effect with the screen. Does not get as bright as additive.
GLOW_BLEND_MODE_SOFTLIGHT = 2 --- Produces a subtle color disturbance around objects.
GLOW_BLEND_MODE_REPLACE = 3 --- Shows the glow effect by itself without the underlying scene.
enum EnvironmentToneMapper:
ENV_TONE_MAPPER_LINEAR = 0 --- Color de salida como entraron.
ENV_TONE_MAPPER_REINHARD = 1 --- Usa el mapa de tonos Reinhard.
ENV_TONE_MAPPER_FILMIC = 2 --- Usa el mapa de tonos fílmicos.
ENV_TONE_MAPPER_ACES = 3 --- Usa el mapa de tonos de ACES.
ENV_TONE_MAPPER_ACES_FITTED = 4 --- Use the ACES Fitted tonemapper.
enum EnvironmentSSAOQuality:
ENV_SSAO_QUALITY_LOW = 0 --- La calidad más baja de la oclusión ambiental del espacio de la pantalla.
ENV_SSAO_QUALITY_MEDIUM = 1 --- Oclusión ambiental del espacio de pantalla de calidad media.
ENV_SSAO_QUALITY_HIGH = 2 --- Oclusión ambiental del espacio de pantalla de la mayor calidad.
enum EnvironmentSSAOBlur:
ENV_SSAO_BLUR_DISABLED = 0 --- Deshabilita el set de desenfoque para SSAO. Hará que SSAO parezca más ruidoso.
ENV_SSAO_BLUR_1x1 = 1 --- Realiza un desenfoque de 1x1 en la salida de SSAO.
ENV_SSAO_BLUR_2x2 = 2 --- Realiza un desenfoque de 2x2 en la salida de SSAO.
ENV_SSAO_BLUR_3x3 = 3 --- Realiza un desenfoque de 3x3 en la salida de SSAO. Usa esto para un SSAO más suave.
Constantes¶
NO_INDEX_ARRAY = -1 --- Marca un error que muestra que el array de índices está vacío.
ARRAY_WEIGHTS_SIZE = 4 --- Número de pesos/huesos por vértice.
CANVAS_ITEM_Z_MIN = -4096 --- La capa Z mínima para los objetos del canvas.
CANVAS_ITEM_Z_MAX = 4096 --- La máxima capa Z para los objetos del canvas.
MAX_GLOW_LEVELS = 7 --- Número máximo de niveles de brillo que se pueden utilizar con el efecto de post-procesado de brillo.
MAX_CURSORS = 8 --- La lista no utilizada en Godot 3.x.
MATERIAL_RENDER_PRIORITY_MIN = -128 --- La prioridad mínima de renderizado de todos los materiales.
MATERIAL_RENDER_PRIORITY_MAX = 127 --- La máxima prioridad de renderización de todos los materiales.
Descripciones de Propiedades¶
bool render_loop_enabled
Setter |
set_render_loop_enabled(value) |
Getter |
is_render_loop_enabled() |
Si false
, desactiva la renderización completamente, pero la lógica del motor sigue siendo procesada. Puedes llamar a force_draw para dibujar un fotograma incluso con la renderización desactivada.
Descripciones de Métodos¶
Establece las imágenes que deben ser renderizadas en el margen de la ventana.
Establece el tamaño del margen, en el que se renderizan las barras negras (o las imágenes, si se ha utilizado el black_bars_set_images).
RID camera_create ( )
Crea una cámara y la añade al VisualServer. Se puede acceder a ella con el RID que se devuelve. Este RID será usado en todas las funciones del camera_*
VisualServer.
Una vez terminado el RID, querrás liberarlo usando el método estático free_rid del VisualServer.
Sets the cull mask associated with this camera. The cull mask describes which 3D layers are rendered by this camera. Equivalent to Camera.cull_mask.
Sets the environment used by this camera. Equivalent to Camera.environment.
Establece la cámara para usar la proyección de frustum. Este modo permite ajustar el argumento offset
para crear efectos de "frustum inclinada".
Establece la cámara para usar la proyección ortogonal, también conocida como proyección ortográfica. Los objetos permanecen del mismo tamaño en la pantalla sin importar lo lejos que estén.
Establece la cámara para usar la proyección en perspectiva. Los objetos en la pantalla se hacen más pequeños cuando están lejos.
Establece la Transform de la cámara.
If true
, preserves the horizontal aspect ratio which is equivalent to Camera.KEEP_WIDTH. If false
, preserves the vertical aspect ratio which is equivalent to Camera.KEEP_HEIGHT.
RID canvas_create ( )
Crea un lienzo y devuelve el RID asignado. Se puede acceder a él con el RID que se devuelve. Este RID se utilizará en todas las funciones del canvas_*
VisualServer.
Una vez terminado el RID, querrás liberar el RID usando el método estático free_rid de VisualServer.
Adds a circle command to the CanvasItem's draw commands.
If ignore is true
, the VisualServer does not perform clipping.
void canvas_item_add_line ( RID item, Vector2 from, Vector2 to, Color color, float width=1.0, bool antialiased=false )
Adds a line command to the CanvasItem's draw commands.
void canvas_item_add_mesh ( RID item, RID mesh, Transform2D transform=Transform2D( 1, 0, 0, 1, 0, 0 ), Color modulate=Color( 1, 1, 1, 1 ), RID texture, RID normal_map )
Adds a mesh command to the CanvasItem's draw commands.
Adds a MultiMesh to the CanvasItem's draw commands. Only affects its aabb at the moment.
void canvas_item_add_nine_patch ( RID item, Rect2 rect, Rect2 source, RID texture, Vector2 topleft, Vector2 bottomright, NinePatchAxisMode x_axis_mode=0, NinePatchAxisMode y_axis_mode=0, bool draw_center=true, Color modulate=Color( 1, 1, 1, 1 ), RID normal_map )
Adds a nine patch image to the CanvasItem's draw commands.
See NinePatchRect for more explanation.
Adds a particle system to the CanvasItem's draw commands.
void canvas_item_add_polygon ( RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs=PoolVector2Array( ), RID texture, RID normal_map, bool antialiased=false )
Adds a polygon to the CanvasItem's draw commands.
void canvas_item_add_polyline ( RID item, PoolVector2Array points, PoolColorArray colors, float width=1.0, bool antialiased=false )
Adds a polyline, which is a line from multiple points with a width, to the CanvasItem's draw commands.
void canvas_item_add_primitive ( RID item, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs, RID texture, float width=1.0, RID normal_map )
Adds a primitive to the CanvasItem's draw commands.
Adds a rectangle to the CanvasItem's draw commands.
void canvas_item_add_set_transform ( RID item, Transform2D transform )
Adds a Transform2D command to the CanvasItem's draw commands.
This sets the extra_matrix uniform when executed. This affects the later commands of the canvas item.
void canvas_item_add_texture_rect ( RID item, Rect2 rect, RID texture, bool tile=false, Color modulate=Color( 1, 1, 1, 1 ), bool transpose=false, RID normal_map )
Adds a textured rect to the CanvasItem's draw commands.
void canvas_item_add_texture_rect_region ( RID item, Rect2 rect, RID texture, Rect2 src_rect, Color modulate=Color( 1, 1, 1, 1 ), bool transpose=false, RID normal_map, bool clip_uv=true )
Adds a texture rect with region setting to the CanvasItem's draw commands.
void canvas_item_add_triangle_array ( RID item, PoolIntArray indices, PoolVector2Array points, PoolColorArray colors, PoolVector2Array uvs=PoolVector2Array( ), PoolIntArray bones=PoolIntArray( ), PoolRealArray weights=PoolRealArray( ), RID texture, int count=-1, RID normal_map, bool antialiased=false, bool antialiasing_use_indices=false )
Adds a triangle array to the CanvasItem's draw commands.
void canvas_item_clear ( RID item )
Despeja el CanvasItem y elimina todos los comandos en él.
RID canvas_item_create ( )
Crea un lienzo y devuelve el RID asignado. Se puede acceder a él con el RID que se devuelve. Este RID se utilizará en todas las funciones del canvas_*
VisualServer.
Una vez terminado el RID, querrás liberar el RID usando el método estático free_rid de VisualServer.
Sets clipping for the CanvasItem.
Establece el CanvasItem para copiar un rectángulo al backbuffer.
Defines a custom drawing rectangle for the CanvasItem.
Enables the use of distance fields for GUI elements that are rendering distance field based fonts.
Sets CanvasItem to be drawn behind its parent.
Establece el índice para el CanvasItem.
La máscara de luz. Vea LightOccluder2D para más información sobre las máscaras de luz.
Establece un nuevo material para el CanvasItem.
Sets the color that modulates the CanvasItem and its children.
Sets the parent for the CanvasItem. The parent can be another canvas item, or it can be the root canvas that is attached to the viewport.
Sets the color that modulates the CanvasItem without children.
Sets if CanvasItem's children should be sorted by y-position.
void canvas_item_set_transform ( RID item, Transform2D transform )
Sets the CanvasItem's Transform2D.
Establece si el CanvasItem utiliza el material de su padre.
Sets if the canvas item (including its children) is visible.
Si esto está activado, el índice Z del padre se añadirá al índice Z de los hijos.
Establece el índice Z del CanvasItem, es decir, su orden de dibujo (los índices inferiores se dibujan primero).
Une la luz del canvas al canvas. Lo quita de su canvas anterior.
RID canvas_light_create ( )
Crea una luz de canvas y la añade al VisualServer. Se puede acceder a ella con el RID que se devuelve. Este RID se usará en todas las funciones del canvas_light_*
VisualServer.
Una vez que hayas terminado con el RID, querrás liberarlo usando el método estático free_rid de VisualServer.
Adjunta un oclusor de luz al canvas. Lo quita de su canvas anterior.
RID canvas_light_occluder_create ( )
Crea un oclusor de luz y lo añade al VisualServer. Se puede acceder a él con el RID que se devuelve. Este RID se usará en todas las funciones del canvas_light_ocluder_*
VisualServer.
Una vez terminado el RID, querrás liberarlo usando el método estático free_rid de VisualServer.
Activa o desactiva el oclusor de luz.
La máscara de luz. Vea LightOccluder2D para más información sobre las máscaras de luz.
Establece un polígono de oclusión de luz.
void canvas_light_occluder_set_transform ( RID occluder, Transform2D transform )
Establece un oclusor de luz Transform2D.
Establece el color de la luz.
Habilita o deshabilita una luz de canvas.
Establece la energía de la luz de un lienzo.
Establece la altura de la luz de un canvas.
La máscara de luz. Vea LightOccluder2D para más información sobre las máscaras de luz.
La máscara binaria utilizada para determinar a qué capas afecta la sombra de la luz del canvas. Ver LightOccluder2D para más información sobre las máscaras de luz.
El rango de capas que se renderizan con esta luz.
void canvas_light_set_mode ( RID light, CanvasLightMode mode )
El modo de la luz, ver las constantes CanvasLightMode.
Establece el factor de escala de la textura de la luz. Equivalente a Light2D.texture_scale.
Establece el ancho del buffer de sombra, el tamaño se escala a la siguiente potencia de dos para esto.
Establece el color de la sombra de la luz del canvas.
Habilita o deshabilita la sombra de la luz del canvas.
void canvas_light_set_shadow_filter ( RID light, CanvasLightShadowFilter filter )
Establece el filtro de la luz de la sombra del lienzo, ver las constantes de CanvasLightShadowFilter.
Sets the length of the shadow's gradient.
Suaviza la sombra. Cuanto más baja, más suave.
Establece la textura para ser usada por la luz. Equivalente a Light2D.texture.
Establece el desplazamiento de la textura de la luz. Equivalente a Light2D.offset.
void canvas_light_set_transform ( RID light, Transform2D transform )
Establece la luz del lienzo Transform2D.
Establece el rango Z de los objetos que serán afectados por esta luz. Equivalente a Light2D.range_z_min y Light2D.range_z_max.
RID canvas_occluder_polygon_create ( )
Crea un nuevo polígono oclusor de luz y lo añade al VisualServer. Se puede acceder a él con el RID que se devuelve. Este RID se usará en todas las funciones del canvas_occluder_polygon_*
VisualServer.
Una vez terminado el RID, querrás liberarlo usando el método estático free_rid de VisualServer.
void canvas_occluder_polygon_set_cull_mode ( RID occluder_polygon, CanvasOccluderPolygonCullMode mode )
Establece un modo de selección de polígonos oclusores. Ver las constantes CanvasOccluderPolygonCullMode.
void canvas_occluder_polygon_set_shape ( RID occluder_polygon, PoolVector2Array shape, bool closed )
Establece la forma del polígono oclusor.
void canvas_occluder_polygon_set_shape_as_lines ( RID occluder_polygon, PoolVector2Array shape )
Establece la forma del polígono oclusor como líneas.
Se dibujará una copia del objeto de canvas con un desplazamiento local del espejo Vector2.
Modula todos los colores en el canvas dado.
RID directional_light_create ( )
Crea una luz direccional y la añade al VisualServer. Se puede acceder a ella con el RID que se devuelve. Este RID puede ser usado en la mayoría de las funciones de light_*
VisualServer.
Una vez que hayas terminado con el RID, querrás liberarlo usando el método estático free_rid de VisualServer.
Para colocar en una escena, adjunta esta luz direccional a una instancia usando instance_set_base usando el RID devuelto.
Draws a frame. This method is deprecated, please use force_draw instead.
RID environment_create ( )
Crea un entorno y lo añade al VisualServer. Se puede acceder a él con el RID que se devuelve. Este RID se usará en todas las funciones de VisualServer de environment_*
.
Una vez terminado el RID, querrás liberarlo usando el método estático free_rid de VisualServer.
void environment_set_adjustment ( RID env, bool enable, float brightness, float contrast, float saturation, RID ramp )
Establece los valores que se utilizarán con el efecto de post-proceso de "Ajuste". Ver Environment para más detalles.
void environment_set_ambient_light ( RID env, Color color, float energy=1.0, float sky_contibution=0.0 )
Sets the ambient light parameters. See Environment for more details.
void environment_set_background ( RID env, EnvironmentBG bg )
Establece el BGMode del medio ambiente. Equivalente a Environment.background_mode.
Color mostrado para áreas claras de la escena (si se utilizan los modos de fondo Color personalizado o Color+Sky).
Establece la intensidad del color de fondo.
Establece la capa máxima a usar si se utiliza el modo de fondo de canvas.
void environment_set_dof_blur_far ( RID env, bool enable, float distance, float transition, float far_amount, EnvironmentDOFBlurQuality quality )
Sets the values to be used with the "DoF Far Blur" post-process effect. See Environment for more details.
void environment_set_dof_blur_near ( RID env, bool enable, float distance, float transition, float far_amount, EnvironmentDOFBlurQuality quality )
Sets the values to be used with the "DoF Near Blur" post-process effect. See Environment for more details.
Establece las variables a utilizar con la niebla de la escena. Ver Environment para más detalles.
void environment_set_fog_depth ( RID env, bool enable, float depth_begin, float depth_end, float depth_curve, bool transmit, float transmit_curve )
Establece las variables a utilizar con el efecto de profundidad de la niebla. Ver Environment para más detalles.
void environment_set_fog_height ( RID env, bool enable, float min_height, float max_height, float height_curve )
Establece las variables a utilizar con el efecto de la altura de la niebla. Ver Environment para más detalles.
void environment_set_glow ( RID env, bool enable, int level_flags, float intensity, float strength, float bloom_threshold, EnvironmentGlowBlendMode blend_mode, float hdr_bleed_threshold, float hdr_bleed_scale, float hdr_luminance_cap, bool bicubic_upscale, bool high_quality )
Sets the variables to be used with the "glow" post-process effect. See Environment for more details.
Sets the Sky to be used as the environment's background when using BGMode sky. Equivalent to Environment.background_sky.
Sets a custom field of view for the background Sky. Equivalent to Environment.background_sky_custom_fov.
Sets the rotation of the background Sky expressed as a Basis. Equivalent to Environment.background_sky_orientation.
void environment_set_ssao ( RID env, bool enable, float radius, float intensity, float radius2, float intensity2, float bias, float light_affect, float ao_channel_affect, Color color, EnvironmentSSAOQuality quality, EnvironmentSSAOBlur blur, float bilateral_sharpness )
Sets the variables to be used with the "Screen Space Ambient Occlusion (SSAO)" post-process effect. See Environment for more details.
void environment_set_ssr ( RID env, bool enable, int max_steps, float fade_in, float fade_out, float depth_tolerance, bool roughness )
Establece las variables que se utilizarán con el efecto de post-proceso "reflejos del espacio de la pantalla". Ver Environment para más detalles.
void environment_set_tonemap ( RID env, EnvironmentToneMapper tone_mapper, float exposure, float white, bool auto_exposure, float min_luminance, float max_luminance, float auto_exp_speed, float auto_exp_grey )
Establece las variables que se utilizarán con el efecto de post-proceso "tonemap". Ver Environment para más detalles.
void finish ( )
Elimina los buffers y limpia los cubos de test.
Fuerza a dibujar un fotograma cuando se llama a la función. Dibujar un marco actualiza todos los Viewports que están configurados para actualizarse. Utilícelo con extrema precaución.
void force_sync ( )
Sincroniza los hilos.
void free_rid ( RID rid )
Intenta liberar un objeto en el VisualServer.
int get_render_info ( RenderInfo info )
Devuelve cierta información, véase RenderInfo para las opciones.
RID get_test_cube ( )
Devuelve la identificación del cubo de test. Crea uno si no existe ninguno.
RID get_test_texture ( )
Devuelve la identificación de la textura de prueba. Crea una si no existe ninguna.
String get_video_adapter_name ( ) const
Devuelve el nombre del adaptador de vídeo (por ejemplo, "GeForce GTX 1080/PCIe/SSE2").
Nota: Cuando se ejecuta un binario headless o de servidor, esta función devuelve una string vacía.
String get_video_adapter_vendor ( ) const
Devuelve el proveedor del adaptador de vídeo (por ejemplo, "NVIDIA Corporation").
Nota: Cuando se ejecuta un binario headless o de servidor, esta función devuelve una string vacía.
RID get_white_texture ( )
Devuelve la identificación de una textura blanca. Crea una si no existe ninguna.
RID gi_probe_create ( )
Creates a GI probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all gi_probe_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this GI probe to an instance using instance_set_base using the returned RID.
Returns the bias value for the GI probe. Bias is used to avoid self occlusion. Equivalent to GIProbeData.bias.
Returns the axis-aligned bounding box that covers the full extent of the GI probe.
Returns the cell size set by gi_probe_set_cell_size.
PoolIntArray gi_probe_get_dynamic_data ( RID probe ) const
Returns the data used by the GI probe.
Returns the dynamic range set for this GI probe. Equivalent to GIProbe.dynamic_range.
Returns the energy multiplier for this GI probe. Equivalent to GIProbe.energy.
Returns the normal bias for this GI probe. Equivalent to GIProbe.normal_bias.
Returns the propagation value for this GI probe. Equivalent to GIProbe.propagation.
Returns the Transform set by gi_probe_set_to_cell_xform.
Returns true
if the GI probe data associated with this GI probe is compressed. Equivalent to GIProbe.compress.
Returns true
if the GI probe is set to interior, meaning it does not account for sky light. Equivalent to GIProbe.interior.
Sets the bias value to avoid self-occlusion. Equivalent to GIProbe.bias.
Sets the axis-aligned bounding box that covers the extent of the GI probe.
Sets the size of individual cells within the GI probe.
Sets the compression setting for the GI probe data. Compressed data will take up less space but may look worse. Equivalent to GIProbe.compress.
void gi_probe_set_dynamic_data ( RID probe, PoolIntArray data )
Sets the data to be used in the GI probe for lighting calculations. Normally this is created and called internally within the GIProbe node. You should not try to set this yourself.
Sets the dynamic range of the GI probe. Dynamic range sets the limit for how bright lights can be. A smaller range captures greater detail but limits how bright lights can be. Equivalent to GIProbe.dynamic_range.
Sets the energy multiplier for this GI probe. A higher energy makes the indirect light from the GI probe brighter. Equivalent to GIProbe.energy.
Sets the interior value of this GI probe. A GI probe set to interior does not include the sky when calculating lighting. Equivalent to GIProbe.interior.
Sets the normal bias for this GI probe. Normal bias behaves similar to the other form of bias and may help reduce self-occlusion. Equivalent to GIProbe.normal_bias.
Sets the propagation of light within this GI probe. Equivalent to GIProbe.propagation.
Sets the to cell Transform for this GI probe.
bool has_changed ( ) const
Devuelve true
si se han hecho cambios en los datos del VisualServer. Normalmente se llama force_draw si esto ocurre.
Aún no se ha implementado. Siempre devuelve false
.
Returns true
if the OS supports a certain feature. Features might be s3tc
, etc
, etc2
, pvrtc
and skinning_fallback
.
When rendering with GLES2, returns true
with skinning_fallback
in case the hardware doesn't support the default GPU skinning process.
void immediate_begin ( RID immediate, PrimitiveType primitive, RID texture )
Sets up ImmediateGeometry internals to prepare for drawing. Equivalent to ImmediateGeometry.begin.
void immediate_clear ( RID immediate )
Clears everything that was set up between immediate_begin and immediate_end. Equivalent to ImmediateGeometry.clear.
Sets the color to be used with next vertex. Equivalent to ImmediateGeometry.set_color.
RID immediate_create ( )
Creates an immediate geometry and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all immediate_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this immediate geometry to an instance using instance_set_base using the returned RID.
void immediate_end ( RID immediate )
Ends drawing the ImmediateGeometry and displays it. Equivalent to ImmediateGeometry.end.
Returns the material assigned to the ImmediateGeometry.
Sets the normal to be used with next vertex. Equivalent to ImmediateGeometry.set_normal.
Sets the material to be used to draw the ImmediateGeometry.
Sets the tangent to be used with next vertex. Equivalent to ImmediateGeometry.set_tangent.
Sets the UV to be used with next vertex. Equivalent to ImmediateGeometry.set_uv.
Sets the UV2 to be used with next vertex. Equivalent to ImmediateGeometry.set_uv2.
Adds the next vertex using the information provided in advance. Equivalent to ImmediateGeometry.add_vertex.
Adds the next vertex using the information provided in advance. This is a helper class that calls immediate_vertex under the hood. Equivalent to ImmediateGeometry.add_vertex.
void init ( )
Initializes the visual server. This function is called internally by platform-dependent code during engine initialization. If called from a running game, it will not do anything.
Adjunta una identificación de objeto única a la instancia. El ID de objeto debe adjuntarse a la instancia para una correcta selección con instances_cull_aabb, instances_cull_convex, y instances_cull_ray.
Adjunta un esqueleto a una instancia. Elimina el esqueleto anterior de la instancia.
RID instance_create ( )
Creates a visual instance and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all instance_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using instance_set_base.
Creates a visual instance, adds it to the VisualServer, and sets both base and scenario. It can be accessed with the RID that is returned. This RID will be used in all instance_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
No se implementó en Godot 3.x.
void instance_geometry_set_cast_shadows_setting ( RID instance, ShadowCastingSetting shadow_casting_setting )
Sets the shadow casting setting to one of ShadowCastingSetting. Equivalent to GeometryInstance.cast_shadow.
void instance_geometry_set_draw_range ( RID instance, float min, float max, float min_margin, float max_margin )
No se implementó en Godot 3.x.
void instance_geometry_set_flag ( RID instance, InstanceFlags flag, bool enabled )
Establece la bandera de un determinado InstanceFlags. Vea InstanceFlags para más detalles.
Sets a material that will be rendered for all surfaces on top of active materials for the mesh associated with this instance. Equivalent to GeometryInstance.material_overlay.
Sets a material that will override the material for all surfaces on the mesh associated with this instance. Equivalent to GeometryInstance.material_override.
Sets the base of the instance. A base can be any of the 3D objects that are created in the VisualServer that can be displayed. For example, any of the light types, mesh, multimesh, immediate geometry, particle system, reflection probe, lightmap capture, and the GI probe are all types that can be set as the base of an instance in order to be displayed in the scenario.
Establece el peso de una determinada forma de mezcla asociada a este caso.
Sets a custom AABB to use when culling objects from the view frustum. Equivalent to GeometryInstance.set_custom_aabb.
Función no implementada en Godot 3.x.
Sets a margin to increase the size of the AABB when culling objects from the view frustum. This allows you to avoid culling objects that fall outside the view frustum. Equivalent to GeometryInstance.extra_cull_margin.
Sets the render layers that this instance will be drawn to. Equivalent to VisualInstance.layers.
Establece el escenario en el que se encuentra la instancia. El escenario es el mundo tridimensional en el que se mostrarán los objetos.
Sets the material of a specific surface. Equivalent to MeshInstance.set_surface_material.
Sets the world space transform of the instance. Equivalent to Spatial.transform.
void instance_set_use_lightmap ( RID instance, RID lightmap_instance, RID lightmap, int lightmap_slice=-1, Rect2 lightmap_uv_rect=Rect2( 0, 0, 1, 1 ) )
Sets the lightmap to use with this instance.
Sets whether an instance is drawn or not. Equivalent to Spatial.visible.
Returns an array of object IDs intersecting with the provided AABB. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
Returns an array of object IDs intersecting with the provided convex shape. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
Returns an array of object IDs intersecting with the provided 3D ray. Only visual 3D nodes are considered, such as MeshInstance or DirectionalLight. Use @GDScript.instance_from_id to obtain the actual nodes. A scenario RID must be provided, which is available in the World you want to query. This forces an update for all resources queued to update.
Warning: This function is primarily intended for editor usage. For in-game use cases, prefer physics collision.
If true
, this directional light will blend between shadow map splits resulting in a smoother transition between them. Equivalent to DirectionalLight.directional_shadow_blend_splits.
void light_directional_set_shadow_depth_range_mode ( RID light, LightDirectionalShadowDepthRangeMode range_mode )
Sets the shadow depth range mode for this directional light. Equivalent to DirectionalLight.directional_shadow_depth_range. See LightDirectionalShadowDepthRangeMode for options.
void light_directional_set_shadow_mode ( RID light, LightDirectionalShadowMode mode )
Sets the shadow mode for this directional light. Equivalent to DirectionalLight.directional_shadow_mode. See LightDirectionalShadowMode for options.
void light_omni_set_shadow_detail ( RID light, LightOmniShadowDetail detail )
Sets whether to use vertical or horizontal detail for this omni light. This can be used to alleviate artifacts in the shadow map. Equivalent to OmniLight.omni_shadow_detail.
void light_omni_set_shadow_mode ( RID light, LightOmniShadowMode mode )
Sets whether to use a dual paraboloid or a cubemap for the shadow map. Dual paraboloid is faster but may suffer from artifacts. Equivalent to OmniLight.omni_shadow_mode.
void light_set_bake_mode ( RID light, LightBakeMode bake_mode )
Sets the bake mode for this light, see LightBakeMode for options. The bake mode affects how the light will be baked in BakedLightmaps and GIProbes.
Sets the color of the light. Equivalent to Light.light_color.
Sets the cull mask for this Light. Lights only affect objects in the selected layers. Equivalent to Light.light_cull_mask.
If true
, light will subtract light instead of adding light. Equivalent to Light.light_negative.
void light_set_param ( RID light, LightParam param, float value )
Sets the specified light parameter. See LightParam for options. Equivalent to Light.set_param.
No se implementó en Godot 3.x.
If true
, reverses the backface culling of the mesh. This can be useful when you have a flat mesh that has a light behind it. If you need to cast a shadow on both sides of the mesh, set the mesh to use double sided shadows with instance_geometry_set_cast_shadows_setting. Equivalent to Light.shadow_reverse_cull_face.
If true
, light will cast shadows. Equivalent to Light.shadow_enabled.
Sets the color of the shadow cast by the light. Equivalent to Light.shadow_color.
Sets whether GI probes capture light information from this light. Deprecated method. Use light_set_bake_mode instead. This method is only kept for compatibility reasons and calls light_set_bake_mode internally, setting the bake mode to LIGHT_BAKE_DISABLED or LIGHT_BAKE_INDIRECT depending on the given parameter.
RID lightmap_capture_create ( )
Creates a lightmap capture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all lightmap_capture_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this lightmap capture to an instance using instance_set_base using the returned RID.
Returns the size of the lightmap capture area.
Returns the energy multiplier used by the lightmap capture.
PoolByteArray lightmap_capture_get_octree ( RID capture ) const
Returns the octree used by the lightmap capture.
Returns the cell subdivision amount used by this lightmap capture's octree.
Returns the cell transform for this lightmap capture's octree.
Returns true
if capture is in "interior" mode.
Sets the size of the area covered by the lightmap capture. Equivalent to BakedLightmapData.bounds.
Sets the energy multiplier for this lightmap capture. Equivalent to BakedLightmapData.energy.
Sets the "interior" mode for this lightmap capture. Equivalent to BakedLightmapData.interior.
void lightmap_capture_set_octree ( RID capture, PoolByteArray octree )
Sets the octree to be used by this lightmap capture. This function is normally used by the BakedLightmap node. Equivalent to BakedLightmapData.octree.
Sets the subdivision level of this lightmap capture's octree. Equivalent to BakedLightmapData.cell_subdiv.
Sets the octree cell transform for this lightmap capture's octree. Equivalent to BakedLightmapData.cell_space_transform.
Devuelve una malla de una esfera con la cantidad dada de subdivisiones horizontales y verticales.
RID material_create ( )
Creates an empty material and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all material_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
Devuelve el valor del parámetro de un determinado material.
Returns the default value for the param if available. Otherwise returns an empty Variant.
Returns the shader of a certain material's shader. Returns an empty RID if the material doesn't have a shader.
Sets a material's line width.
Establece el próximo material de un objeto.
Establece el parámetro de un material.
Establece la prioridad de renderización de un material.
Establece un shader como el shader de un material.
void mesh_add_surface_from_arrays ( RID mesh, PrimitiveType primitive, Array arrays, Array blend_shapes=[ ], int compress_format=2194432 )
Adds a surface generated from the Arrays to a mesh. See PrimitiveType constants for types.
void mesh_clear ( RID mesh )
Quita todas las superficies de una malla.
RID mesh_create ( )
Creates a new mesh and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this mesh to an instance using instance_set_base using the returned RID.
Devuelve el recuento de la forma de la malla.
BlendShapeMode mesh_get_blend_shape_mode ( RID mesh ) const
Devuelve el modo de mezcla de una malla.
Devuelve el aabb personalizado de una malla.
Devuelve el número de superficies de una malla.
Removes a mesh's surface.
Sets a mesh's blend shape count.
void mesh_set_blend_shape_mode ( RID mesh, BlendShapeMode mode )
Establece el modo de mezcla de una malla.
Establece el aabb personalizado de una malla.
Returns a mesh's surface's aabb.
PoolByteArray mesh_surface_get_array ( RID mesh, int surface ) const
Returns a mesh's surface's vertex buffer.
Returns a mesh's surface's amount of indices.
Returns a mesh's surface's amount of vertices.
Devuelve los array de buffer de superficie de una malla.
Devuelve los arrays de la superficie de una malla para mezclar formas.
Returns the format of a mesh's surface.
int mesh_surface_get_format_offset ( int format, int vertex_len, int index_len, int array_index ) const
La función no se usa en Godot 3.x.
int mesh_surface_get_format_stride ( int format, int vertex_len, int index_len, int array_index ) const
PoolByteArray mesh_surface_get_index_array ( RID mesh, int surface ) const
Returns a mesh's surface's index buffer.
Devuelve el material de la superficie de una malla.
PrimitiveType mesh_surface_get_primitive_type ( RID mesh, int surface ) const
Returns the primitive type of a mesh's surface.
Returns the aabb of a mesh's surface's skeleton.
Establece el material de la superficie de una malla.
void mesh_surface_update_region ( RID mesh, int surface, int offset, PoolByteArray data )
Actualiza una región específica de un buffer de vértices para la superficie especificada. Advertencia: esta función altera el buffer de vértices directamente sin mecanismos de seguridad, puede fácilmente corromper su malla.
void multimesh_allocate ( RID multimesh, int instances, MultimeshTransformFormat transform_format, MultimeshColorFormat color_format, MultimeshCustomDataFormat custom_data_format=0 )
Allocates space for the multimesh data. Format parameters determine how the data will be stored by OpenGL. See MultimeshTransformFormat, MultimeshColorFormat, and MultimeshCustomDataFormat for usage. Equivalent to MultiMesh.instance_count.
RID multimesh_create ( )
Creates a new multimesh on the VisualServer and returns an RID handle. This RID will be used in all multimesh_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this multimesh to an instance using instance_set_base using the returned RID.
Calcula y devuelve el cuadro delimitador alineado con el eje que encierra todas las instancias dentro de la multimalla.
Devuelve el número de instancias asignadas para esta multimalla.
Devuelve el RID de la malla que se usará para dibujar este multimalla.
Devuelve el número de instancias visibles para este multimalla.
Devuelve el color por el cual la instancia especificada será modulada.
Devuelve los datos personalizados asociados a la instancia especificada.
Devuelve la Transform de la instancia especificada.
Transform2D multimesh_instance_get_transform_2d ( RID multimesh, int index ) const
Devuelve la Transform2D de la instancia especificada. Para usar cuando el multimalle está configurado para usar transformaciones 2D.
Establece el color por el cual esta instancia será modulada. Equivalente a MultiMesh.set_instance_color.
Establece los datos personalizados para este caso. Los datos personalizados se pasan como un Color, pero se interpretan como un vec4
en el sombreador. Equivalente al MultiMesh.set_instance_custom_data.
Establece la Transform para este caso. Equivalente a MultiMesh.set_instance_transform.
void multimesh_instance_set_transform_2d ( RID multimesh, int index, Transform2D transform )
Establece el Transform2D para este caso. Para su uso cuando se utiliza el multimesh en 2D. Equivalente al MultiMesh.set_instance_transform_2d.
void multimesh_set_as_bulk_array ( RID multimesh, PoolRealArray array )
Sets all data related to the instances in one go. This is especially useful when loading the data from disk or preparing the data from GDNative.
All data is packed in one large float array. An array may look like this: Transform for instance 1, color data for instance 1, custom data for instance 1, transform for instance 2, color data for instance 2, etc.
Transform is stored as 12 floats, Transform2D is stored as 8 floats, COLOR_8BIT
/ CUSTOM_DATA_8BIT
is stored as 1 float (4 bytes as is) and COLOR_FLOAT
/ CUSTOM_DATA_FLOAT
is stored as 4 floats.
Establece la malla a ser dibujada por la multimalla. Equivalente a MultiMesh.mesh.
Establece el número de instancias visibles en un momento dado. Si es -1, se sortean todas las instancias que han sido asignadas. Equivalente a MultiMesh.visible_instance_count.
RID omni_light_create ( )
Creates a new omni light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this omni light to an instance using instance_set_base using the returned RID.
RID particles_create ( )
Creates a particle system and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all particles_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach these particles to an instance using instance_set_base using the returned RID.
Calculates and returns the axis-aligned bounding box that contains all the particles. Equivalent to Particles.capture_aabb.
Devuelve true
si las partículas están actualmente fijadas para emitir.
Devuelve true
si las partículas no están emitiendo y las partículas están inactivas.
void particles_request_process ( RID particles )
Añade el sistema de partículas a la lista de sistemas de partículas que deben ser actualizados. La actualización tendrá lugar en el siguiente fotograma, o en la siguiente llamada a instances_cull_aabb, instances_cull_convex, o instances_cull_ray.
void particles_restart ( RID particles )
Reset the particles on the next update. Equivalent to Particles.restart.
Sets the number of particles to be drawn and allocates the memory for them. Equivalent to Particles.amount.
Sets a custom axis-aligned bounding box for the particle system. Equivalent to Particles.visibility_aabb.
void particles_set_draw_order ( RID particles, ParticlesDrawOrder order )
Sets the draw order of the particles to one of the named enums from ParticlesDrawOrder. See ParticlesDrawOrder for options. Equivalent to Particles.draw_order.
Sets the mesh to be used for the specified draw pass. Equivalent to Particles.draw_pass_1, Particles.draw_pass_2, Particles.draw_pass_3, and Particles.draw_pass_4.
Sets the number of draw passes to use. Equivalent to Particles.draw_passes.
Establece la Transform que será utilizada por las partículas cuando emitan por primera vez.
If true
, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to Particles.emitting.
Sets the explosiveness ratio. Equivalent to Particles.explosiveness.
Sets the frame rate that the particle system rendering will be fixed to. Equivalent to Particles.fixed_fps.
If true
, uses fractional delta which smooths the movement of the particles. Equivalent to Particles.fract_delta.
Sets the lifetime of each particle in the system. Equivalent to Particles.lifetime.
If true
, particles will emit once and then stop. Equivalent to Particles.one_shot.
Sets the preprocess time for the particles' animation. This lets you delay starting an animation until after the particles have begun emitting. Equivalent to Particles.preprocess.
Sets the material for processing the particles.
Note: This is not the material used to draw the materials. Equivalent to Particles.process_material.
Sets the emission randomness ratio. This randomizes the emission of particles within their phase. Equivalent to Particles.randomness.
Sets the speed scale of the particle system. Equivalent to Particles.speed_scale.
If true
, particles use local coordinates. If false
they use global coordinates. Equivalent to Particles.local_coords.
RID reflection_probe_create ( )
Creates a reflection probe and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all reflection_probe_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this reflection probe to an instance using instance_set_base using the returned RID.
If true
, reflections will ignore sky contribution. Equivalent to ReflectionProbe.interior_enable.
Establece la máscara de selección de renderizado para esta sonda de reflexión. Sólo los casos con una máscara de selección que coincida serán renderizados por esta sonda. Equivalente a ReflectionProbe.cull_mask.
Si true
, usa la proyección de caja. Esto puede hacer que los reflejos se vean más correctos en ciertas situaciones. Equivalente a ReflectionProbe.box_projection.
Si true
, calcula las sombras en la sonda de reflexión. Esto hace que el reflejo sea mucho más lento de calcular. Equivalente a ReflectionProbe.enable_shadows.
Establece el tamaño del área que la sonda de reflexión capturará. Equivalente a ReflectionProbe.extents.
Establece la intensidad de la sonda de reflexión. La intensidad modula la fuerza de la reflexión. Equivalente a ReflectionProbe.intensity.
Sets the ambient light color for this reflection probe when set to interior mode. Equivalent to ReflectionProbe.interior_ambient_color.
Sets the energy multiplier for this reflection probes ambient light contribution when set to interior mode. Equivalent to ReflectionProbe.interior_ambient_energy.
Sets the contribution value for how much the reflection affects the ambient light for this reflection probe when set to interior mode. Useful so that ambient light matches the color of the room. Equivalent to ReflectionProbe.interior_ambient_contrib.
Establece la máxima distancia de la sonda a la que puede estar un objeto antes de ser seleccionado. Equivalente a ReflectionProbe.max_distance.
Establece el desplazamiento de origen que se utilizará cuando esta sonda de reflexión esté en modo de proyecto de caja. Equivalente a ReflectionProbe.origin_offset.
void reflection_probe_set_update_mode ( RID probe, ReflectionProbeUpdateMode mode )
Establece con qué frecuencia se actualiza la sonda de reflexión. Puede ser una vez o cada fotograma. Ver ReflectionProbeUpdateMode para las opciones.
Programa una llamada al method
correspondiente en where
después de que se haya dibujado un fotograma.
El método de devolución debe utilizar sólo 1 argumento que será llamado con userdata
.
RID scenario_create ( )
Creates a scenario and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all scenario_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
The scenario is the 3D world that all the visual instances exist in.
void scenario_set_debug ( RID scenario, ScenarioDebugMode debug_mode )
Establece el ScenarioDebugMode para este escenario. Vea ScenarioDebugMode para las opciones.
Establece el entorno que se utilizará con este escenario.
Establece el entorno de reserva que se utilizará en este escenario. El entorno de reserva se utiliza si no se establece ningún entorno. Internamente, es usado por el editor para proporcionar un entorno por defecto.
Sets the size of the reflection atlas shared by all reflection probes in this scenario.
Establece una imagen de arranque. El color define el color de fondo. Si scale
es true
, la imagen será escalada para ajustarse al tamaño de la pantalla. Si use_filter
es true
, la imagen será escalada con interpolación lineal. Si use_filter
es false
, la imagen se escalará con la interpolación del vecino más cercano.
void set_debug_generate_wireframes ( bool generate )
Si true
, el motor generará mallas de alambre para su uso con el modo de depuración de mallas de alambre.
void set_default_clear_color ( Color color )
Establece el color claro predeterminado que se utiliza cuando no se ha seleccionado un color claro específico.
If asynchronous shader compilation is enabled, this controls whether SpatialMaterial.ASYNC_MODE_HIDDEN is obeyed.
For instance, you may want to enable this temporarily before taking a screenshot. This ensures everything is visible even if shaders with async mode hidden are not ready yet.
Reflection probes use this internally to ensure they capture everything regardless the shaders are ready or not.
void set_shader_time_scale ( float scale )
Sets the scale to apply to the passage of time for the shaders' TIME
builtin.
The default value is 1.0
, which means TIME
will count the real time as it goes by, without narrowing or stretching it.
void set_use_occlusion_culling ( bool enable )
Enables or disables occlusion culling.
RID shader_create ( )
Creates an empty shader and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all shader_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
Devuelve un código de shader.
Devuelve una textura por defecto de un shader buscado por nombre.
Devuelve los parámetros de un shader.
Establece un código de shader.
Establece la textura por defecto de un shader. Sobrescribe la textura dada por el nombre.
Asigna los buffers de la GPU para este esqueleto.
Devuelve el conjunto Transform para un hueso específico de este esqueleto.
Transform2D skeleton_bone_get_transform_2d ( RID skeleton, int bone ) const
Devuelve el conjunto Transform para un hueso específico de este esqueleto.
Devuelve el conjunto Transform para un hueso específico de este esqueleto.
void skeleton_bone_set_transform_2d ( RID skeleton, int bone, Transform2D transform )
Establece la Transform2D para un hueso específico de este esqueleto.
RID skeleton_create ( )
Creates a skeleton and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all skeleton_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
Devuelve el número de huesos asignados a este esqueleto.
RID sky_create ( )
Creates an empty sky and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all sky_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
Sets a sky's texture.
RID spot_light_create ( )
Creates a spot light and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID can be used in most light_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
To place in a scene, attach this spot light to an instance using instance_set_base using the returned RID.
void sync ( )
No se implementó en Godot 3.x.
void texture_allocate ( RID texture, int width, int height, int depth_3d, Format format, TextureType type, int flags=7 )
Allocates the GPU memory for the texture.
Binds the texture to a texture slot.
RID texture_create ( )
Creates an empty texture and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all texture_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
Creates a texture, allocates the space for an image, and fills in the image.
Array texture_debug_usage ( )
Returns a list of all the textures and their information.
Returns a copy of a texture's image unless it's a CubeMap, in which case it returns the RID of the image at one of the cubes sides.
Returns the depth of the texture.
Returns the flags of a texture.
Returns the format of the texture's image.
Returns the texture's height.
Returns the texture's path.
Returns the opengl id of the texture's image.
TextureType texture_get_type ( RID texture ) const
Returns the type of the texture, can be any of the TextureType.
Returns the texture's width.
Sets the texture's image data. If it's a CubeMap, it sets the image data at a cube side.
void texture_set_data_partial ( RID texture, Image image, int src_x, int src_y, int src_w, int src_h, int dst_x, int dst_y, int dst_mip, int layer=0 )
Sets a part of the data for a texture. Warning: this function calls the underlying graphics API directly and may corrupt your texture if used improperly.
Sets the texture's flags. See TextureFlags for options.
Sets the texture's path.
void texture_set_shrink_all_x2_on_set_data ( bool shrink )
If true
, sets internal processes to shrink all image data to half the size.
Resizes the texture to the specified dimensions.
void textures_keep_original ( bool enable )
If true
, the image will be stored in the texture's images array if overwritten.
Establece la cámara de un viewport.
Establece el canvas de un viewport.
Copies viewport to a region of the screen specified by rect
. If Viewport.render_direct_to_screen is true
, then viewport does not use a framebuffer and the contents of the viewport are rendered directly to screen. However, note that the root viewport is drawn last, therefore it will draw over the screen. Accordingly, you must set the root viewport to an area that does not cover the area that you have attached this viewport to.
For example, you can set the root viewport to not render at all with the following code:
func _ready():
get_viewport().set_attach_to_screen_rect(Rect2())
$Viewport.set_attach_to_screen_rect(Rect2(0, 0, 600, 600))
Using this can result in significant optimization, especially on lower-end devices. However, it comes at the cost of having to manage your viewports manually. For a further optimization see, viewport_set_render_direct_to_screen.
RID viewport_create ( )
Creates an empty viewport and adds it to the VisualServer. It can be accessed with the RID that is returned. This RID will be used in all viewport_*
VisualServer functions.
Once finished with your RID, you will want to free the RID using the VisualServer's free_rid static method.
void viewport_detach ( RID viewport )
Detaches the viewport from the screen.
int viewport_get_render_info ( RID viewport, ViewportRenderInfo info )
Devuelve la información de renderización de un viewport. Para las opciones, ver las constantes ViewportRenderInfo.
Devuelve el último fotograma renderizado del viewport.
Separa un punto de vista de un canvas y viceversa.
Si true
, activa la ventana de visualización, si no, la desactiva.
Establece el orden de apilamiento para el canvas de un viewport.
layer
es la capa real del canvas, mientras que sublayer
especifica el orden de apilamiento del canvas entre los de la misma capa.
void viewport_set_canvas_transform ( RID viewport, RID canvas, Transform2D offset )
Establece la transformación del canvas de un viewport.
void viewport_set_clear_mode ( RID viewport, ViewportClearMode clear_mode )
Establece el modo claro de una vista. Consulte ViewportClearMode para ver las opciones.
void viewport_set_debug_draw ( RID viewport, ViewportDebugDraw draw )
Establece el modo de dibujo de depuración de un viewport. Ver ViewportDebugDraw para las opciones.
If true
, a viewport's 3D rendering is disabled.
Si true
, se desactiva la renderización del entorno de un viewport.
void viewport_set_global_canvas_transform ( RID viewport, Transform2D transform )
Establece la matriz de transformación global del Viewport.
If true
, the viewport renders to hdr.
Si true
, el canvas del viewport no se renderiza.
Actualmente sin implementar en Godot 3.x.
void viewport_set_msaa ( RID viewport, ViewportMSAA msaa )
Establece el modo anti-aliasing. Ver ViewportMSAA para las opciones.
Establece el padre del viewport a otra viewport.
Si true
, renderiza el contenido del viewport directamente a la pantalla. Esto permite una optimización de bajo nivel en la que se puede omitir el dibujo de una ventana de visualización en la ventana de la raíz. Aunque esta optimización puede resultar en un aumento significativo de la velocidad (especialmente en los dispositivos más antiguos), tiene un costo de usabilidad. Cuando esto está habilitado, no se puede leer desde el viewport o desde el SCREEN_TEXTURE
. También se pierde el beneficio de ciertos ajustes de la ventana, como los diversos modos de estiramiento. Otra consecuencia que hay que tener en cuenta es que en 2D el renderizado se produce en coordenadas de ventana, por lo que si tienes una vista que es el doble del tamaño de la ventana, y la configuras, sólo se dibujará la parte que cabe dentro de la ventana, no es posible el escalado automático, incluso si tu escena de juego es significativamente más grande que el tamaño de la ventana.
Establece el escenario de un viewport.
El escenario contiene información sobre el ScenarioDebugMode, información del entorno, atlas de reflexión, etc.
Establece la subdivisión del cuadrante del atlas de las sombras.
Establece el tamaño de las imágenes del atlas de sombras (usado para omni y focos). El valor se redondeará a la potencia más cercana de 2.
Sets the sharpening intensity
for the viewport
. If set to a value greater than 0.0
, contrast-adaptive sharpening will be applied to the 3D viewport. This has a low performance cost and can be used to recover some of the sharpness lost from using FXAA. Values around 0.5
generally give the best results. See also viewport_set_use_fxaa.
Establece el ancho y la altura del viewport.
Si true
, el viewport hace que su fondo sea transparente.
void viewport_set_update_mode ( RID viewport, ViewportUpdateMode update_mode )
Establece cuándo debe actualizarse el viewport. Ver las constantes ViewportUpdateMode para las opciones.
void viewport_set_usage ( RID viewport, ViewportUsage usage )
Sets the viewport's 2D/3D mode. See ViewportUsage constants for options.
If true
, the viewport uses augmented or virtual reality technologies. See ARVRInterface.
If true
, uses a fast post-processing filter to make banding significantly less visible. In some cases, debanding may introduce a slightly noticeable dithering pattern. It's recommended to enable debanding only when actually needed since the dithering pattern will make lossless-compressed screenshots larger.
Note: Only available on the GLES3 backend. Viewport.hdr must also be true
for debanding to be effective.
Enables fast approximate antialiasing for this viewport. FXAA is a popular screen-space antialiasing method, which is fast but will make the image look blurry, especially at lower resolutions. It can still work relatively well at large resolutions such as 1440p and 4K. Some of the lost sharpness can be recovered by enabling contrast-adaptive sharpening (see viewport_set_sharpen_intensity).
If true
, the viewport's rendering is flipped vertically.