Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

RenderingServer

繼承: Object

任何可見的東西的伺服器。

說明

算繪伺服器是所有可見內容的 API 後端。整個場景系統都掛載在它上面來顯示。算繪服務器是完全不透明的:內部實作完全取決於具體的實作,無法進行存取。

使用算繪伺服器可以完全繞過場景和 Node 系統。如果場景系統是瓶頸所在,那麼這樣做就可以提升性能,否則無法提升性能(例如已經完全利用 GPU 的情況)。

資源是使用 *_create 函式建立的。這些函式返回的 RID 並不是對對象本身的引用,而是指向這些物件的不透明指標

所有物件都會被繪製到視口中。你可以使用附加到 SceneTreeViewport,或者也可以使用 viewport_create() 自行建立。使用自訂場景或畫布時,需要使用 viewport_set_scenario()viewport_attach_canvas() 將場景或畫布附加到視口。

場景:在 3D 中,所有可視物件都必須與一個場景(Scenario)相關聯。場景是世界的視覺化表示。如果要從正在運作的遊戲中存取算繪伺服器,那麼就可以使用 Node3D.get_world_3d() 從任何 Node3D 節點的場景樹存取該場景。此外,也可以使用 scenario_create() 建立場景。

在 2D 中也是類似的,需要一個畫布(Canvas)來繪製所有的畫布項。

3D:在 3D 中,所有可視物件都由資源(Resource)和實例(Instance)組成。資源可以是網格、粒子系統、燈光或任何其他 3D 物件。為了使資源可見,必須使用 instance_set_base() 將其附加到一個實例。該實例還必須使用 instance_set_scenario() 附加到場景中才可見。不帶前綴的 RenderingServer 方法通常都是針對 3D 的(但也有例外)。

2D:在 2D 中,所有可見物件都是某種形式的畫布項(Canvas Item)。為了使畫布項可見,就需要讓它成為附加到視口的畫布的子項,或者需要讓它成為其他畫布項的子項,但這些畫布項最終也需要是畫布的子項。針對 2D 的 RenderingServer 方法一般都以 canvas_* 開頭。

無頭模式:使用 --headless 命令列參數啟動引擎將禁用所有算繪和窗口管理功能。在這種情況下,RenderingServer 中的大多數函式將返回虛值。

教學

屬性

bool

render_loop_enabled

方法

RID

area_light_create()

Array[Image]

bake_render_uv2(base: RID, material_overrides: Array[RID], image_size: Vector2i)

void

call_on_render_thread(callable: Callable)

RID

camera_attributes_create()

void

camera_attributes_set_auto_exposure(camera_attributes: RID, enable: bool, min_sensitivity: float, max_sensitivity: float, speed: float, scale: float)

void

camera_attributes_set_dof_blur(camera_attributes: RID, far_enable: bool, far_distance: float, far_transition: float, near_enable: bool, near_distance: float, near_transition: float, amount: float)

void

camera_attributes_set_dof_blur_bokeh_shape(shape: DOFBokehShape)

void

camera_attributes_set_dof_blur_quality(quality: DOFBlurQuality, use_jitter: bool)

void

camera_attributes_set_exposure(camera_attributes: RID, multiplier: float, normalization: float)

RID

camera_create()

void

camera_set_camera_attributes(camera: RID, effects: RID)

void

camera_set_compositor(camera: RID, compositor: RID)

void

camera_set_cull_mask(camera: RID, layers: int)

void

camera_set_environment(camera: RID, env: RID)

void

camera_set_frustum(camera: RID, size: float, offset: Vector2, z_near: float, z_far: float)

void

camera_set_orthogonal(camera: RID, size: float, z_near: float, z_far: float)

void

camera_set_perspective(camera: RID, fovy_degrees: float, z_near: float, z_far: float)

void

camera_set_transform(camera: RID, transform: Transform3D)

void

camera_set_use_vertical_aspect(camera: RID, enable: bool)

RID

canvas_create()

void

canvas_item_add_animation_slice(item: RID, animation_length: float, slice_begin: float, slice_end: float, offset: float = 0.0)

void

canvas_item_add_circle(item: RID, pos: Vector2, radius: float, color: Color, antialiased: bool = false)

void

canvas_item_add_clip_ignore(item: RID, ignore: bool)

void

canvas_item_add_ellipse(item: RID, pos: Vector2, major: float, minor: float, color: Color, antialiased: bool = false)

void

canvas_item_add_lcd_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color)

void

canvas_item_add_line(item: RID, from: Vector2, to: Vector2, color: Color, width: float = -1.0, antialiased: bool = false)

void

canvas_item_add_mesh(item: RID, mesh: RID, transform: Transform2D = Transform2D(1, 0, 0, 1, 0, 0), modulate: Color = Color(1, 1, 1, 1), texture: RID = RID())

void

canvas_item_add_msdf_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), outline_size: int = 0, px_range: float = 1.0, scale: float = 1.0)

void

canvas_item_add_multiline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false)

void

canvas_item_add_multimesh(item: RID, mesh: RID, texture: RID = RID())

void

canvas_item_add_nine_patch(item: RID, rect: Rect2, source: Rect2, texture: RID, topleft: Vector2, bottomright: Vector2, x_axis_mode: NinePatchAxisMode = 0, y_axis_mode: NinePatchAxisMode = 0, draw_center: bool = true, modulate: Color = Color(1, 1, 1, 1))

void

canvas_item_add_particles(item: RID, particles: RID, texture: RID)

void

canvas_item_add_polygon(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), texture: RID = RID())

void

canvas_item_add_polyline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false)

void

canvas_item_add_primitive(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: RID)

void

canvas_item_add_rect(item: RID, rect: Rect2, color: Color, antialiased: bool = false)

void

canvas_item_add_set_transform(item: RID, transform: Transform2D)

void

canvas_item_add_texture_rect(item: RID, rect: Rect2, texture: RID, tile: bool = false, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false)

void

canvas_item_add_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false, clip_uv: bool = true)

void

canvas_item_add_triangle_array(item: RID, indices: PackedInt32Array, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), bones: PackedInt32Array = PackedInt32Array(), weights: PackedFloat32Array = PackedFloat32Array(), texture: RID = RID(), count: int = -1)

void

canvas_item_attach_skeleton(item: RID, skeleton: RID)

void

canvas_item_clear(item: RID)

RID

canvas_item_create()

Variant

canvas_item_get_instance_shader_parameter(instance: RID, parameter: StringName) const

Variant

canvas_item_get_instance_shader_parameter_default_value(instance: RID, parameter: StringName) const

Array[Dictionary]

canvas_item_get_instance_shader_parameter_list(instance: RID) const

void

canvas_item_reset_physics_interpolation(item: RID)

void

canvas_item_set_canvas_group_mode(item: RID, mode: CanvasGroupMode, clear_margin: float = 5.0, fit_empty: bool = false, fit_margin: float = 0.0, blur_mipmaps: bool = false)

void

canvas_item_set_clip(item: RID, clip: bool)

void

canvas_item_set_copy_to_backbuffer(item: RID, enabled: bool, rect: Rect2)

void

canvas_item_set_custom_rect(item: RID, use_custom_rect: bool, rect: Rect2 = Rect2(0, 0, 0, 0))

void

canvas_item_set_default_texture_filter(item: RID, filter: CanvasItemTextureFilter)

void

canvas_item_set_default_texture_repeat(item: RID, repeat: CanvasItemTextureRepeat)

void

canvas_item_set_distance_field_mode(item: RID, enabled: bool)

void

canvas_item_set_draw_behind_parent(item: RID, enabled: bool)

void

canvas_item_set_draw_index(item: RID, index: int)

void

canvas_item_set_instance_shader_parameter(instance: RID, parameter: StringName, value: Variant)

void

canvas_item_set_interpolated(item: RID, interpolated: bool)

void

canvas_item_set_light_mask(item: RID, mask: int)

void

canvas_item_set_material(item: RID, material: RID)

void

canvas_item_set_modulate(item: RID, color: Color)

void

canvas_item_set_parent(item: RID, parent: RID)

void

canvas_item_set_self_modulate(item: RID, color: Color)

void

canvas_item_set_sort_children_by_y(item: RID, enabled: bool)

void

canvas_item_set_transform(item: RID, transform: Transform2D)

void

canvas_item_set_use_parent_material(item: RID, enabled: bool)

void

canvas_item_set_visibility_layer(item: RID, visibility_layer: int)

void

canvas_item_set_visibility_notifier(item: RID, enable: bool, area: Rect2, enter_callable: Callable, exit_callable: Callable)

void

canvas_item_set_visible(item: RID, visible: bool)

void

canvas_item_set_z_as_relative_to_parent(item: RID, enabled: bool)

void

canvas_item_set_z_index(item: RID, z_index: int)

void

canvas_item_transform_physics_interpolation(item: RID, transform: Transform2D)

void

canvas_light_attach_to_canvas(light: RID, canvas: RID)

RID

canvas_light_create()

void

canvas_light_occluder_attach_to_canvas(occluder: RID, canvas: RID)

RID

canvas_light_occluder_create()

void

canvas_light_occluder_reset_physics_interpolation(occluder: RID)

void

canvas_light_occluder_set_as_sdf_collision(occluder: RID, enable: bool)

void

canvas_light_occluder_set_enabled(occluder: RID, enabled: bool)

void

canvas_light_occluder_set_interpolated(occluder: RID, interpolated: bool)

void

canvas_light_occluder_set_light_mask(occluder: RID, mask: int)

void

canvas_light_occluder_set_polygon(occluder: RID, polygon: RID)

void

canvas_light_occluder_set_transform(occluder: RID, transform: Transform2D)

void

canvas_light_occluder_transform_physics_interpolation(occluder: RID, transform: Transform2D)

void

canvas_light_reset_physics_interpolation(light: RID)

void

canvas_light_set_blend_mode(light: RID, mode: CanvasLightBlendMode)

void

canvas_light_set_color(light: RID, color: Color)

void

canvas_light_set_enabled(light: RID, enabled: bool)

void

canvas_light_set_energy(light: RID, energy: float)

void

canvas_light_set_height(light: RID, height: float)

void

canvas_light_set_interpolated(light: RID, interpolated: bool)

void

canvas_light_set_item_cull_mask(light: RID, mask: int)

void

canvas_light_set_item_shadow_cull_mask(light: RID, mask: int)

void

canvas_light_set_layer_range(light: RID, min_layer: int, max_layer: int)

void

canvas_light_set_mode(light: RID, mode: CanvasLightMode)

void

canvas_light_set_shadow_color(light: RID, color: Color)

void

canvas_light_set_shadow_enabled(light: RID, enabled: bool)

void

canvas_light_set_shadow_filter(light: RID, filter: CanvasLightShadowFilter)

void

canvas_light_set_shadow_smooth(light: RID, smooth: float)

void

canvas_light_set_texture(light: RID, texture: RID)

void

canvas_light_set_texture_offset(light: RID, offset: Vector2)

void

canvas_light_set_texture_scale(light: RID, scale: float)

void

canvas_light_set_transform(light: RID, transform: Transform2D)

void

canvas_light_set_z_range(light: RID, min_z: int, max_z: int)

void

canvas_light_transform_physics_interpolation(light: RID, transform: Transform2D)

RID

canvas_occluder_polygon_create()

void

canvas_occluder_polygon_set_cull_mode(occluder_polygon: RID, mode: CanvasOccluderPolygonCullMode)

void

canvas_occluder_polygon_set_shape(occluder_polygon: RID, shape: PackedVector2Array, closed: bool)

void

canvas_set_disable_scale(disable: bool)

void

canvas_set_item_mirroring(canvas: RID, item: RID, mirroring: Vector2)

void

canvas_set_item_repeat(item: RID, repeat_size: Vector2, repeat_times: int)

void

canvas_set_modulate(canvas: RID, color: Color)

void

canvas_set_shadow_texture_size(size: int)

RID

canvas_texture_create()

void

canvas_texture_set_channel(canvas_texture: RID, channel: CanvasTextureChannel, texture: RID)

void

canvas_texture_set_shading_parameters(canvas_texture: RID, base_color: Color, shininess: float)

void

canvas_texture_set_texture_filter(canvas_texture: RID, filter: CanvasItemTextureFilter)

void

canvas_texture_set_texture_repeat(canvas_texture: RID, repeat: CanvasItemTextureRepeat)

RID

compositor_create()

RID

compositor_effect_create()

void

compositor_effect_set_callback(effect: RID, callback_type: CompositorEffectCallbackType, callback: Callable)

void

compositor_effect_set_enabled(effect: RID, enabled: bool)

void

compositor_effect_set_flag(effect: RID, flag: CompositorEffectFlags, set: bool)

void

compositor_set_compositor_effects(compositor: RID, effects: Array[RID])

RenderingDevice

create_local_rendering_device() const

Rect2

debug_canvas_item_get_rect(item: RID)

RID

decal_create()

void

decal_set_albedo_mix(decal: RID, albedo_mix: float)

void

decal_set_cull_mask(decal: RID, mask: int)

void

decal_set_distance_fade(decal: RID, enabled: bool, begin: float, length: float)

void

decal_set_emission_energy(decal: RID, energy: float)

void

decal_set_fade(decal: RID, above: float, below: float)

void

decal_set_modulate(decal: RID, color: Color)

void

decal_set_normal_fade(decal: RID, fade: float)

void

decal_set_size(decal: RID, size: Vector3)

void

decal_set_texture(decal: RID, type: DecalTexture, texture: RID)

void

decals_set_filter(filter: DecalFilter)

RID

directional_light_create()

void

directional_shadow_atlas_set_size(size: int, is_16bits: bool)

void

directional_soft_shadow_filter_set_quality(quality: ShadowQuality)

Image

environment_bake_panorama(environment: RID, bake_irradiance: bool, size: Vector2i)

RID

environment_create()

void

environment_glow_set_use_bicubic_upscale(enable: bool)

void

environment_set_adjustment(env: RID, enable: bool, brightness: float, contrast: float, saturation: float, use_1d_color_correction: bool, color_correction: RID)

void

environment_set_ambient_light(env: RID, color: Color, ambient: EnvironmentAmbientSource = 0, energy: float = 1.0, sky_contribution: float = 0.0, reflection_source: EnvironmentReflectionSource = 0)

void

environment_set_background(env: RID, bg: EnvironmentBG)

void

environment_set_bg_color(env: RID, color: Color)

void

environment_set_bg_energy(env: RID, multiplier: float, exposure_value: float)

void

environment_set_camera_id(env: RID, id: int)

void

environment_set_canvas_max_layer(env: RID, max_layer: int)

void

environment_set_fog(env: RID, enable: bool, light_color: Color, light_energy: float, sun_scatter: float, density: float, height: float, height_density: float, aerial_perspective: float, sky_affect: float, fog_mode: EnvironmentFogMode = 0)

void

environment_set_fog_depth(env: RID, curve: float, begin: float, end: float)

void

environment_set_glow(env: RID, enable: bool, levels: PackedFloat32Array, intensity: float, strength: float, mix: float, bloom_threshold: float, blend_mode: EnvironmentGlowBlendMode, hdr_bleed_threshold: float, hdr_bleed_scale: float, hdr_luminance_cap: float, glow_map_strength: float, glow_map: RID)

void

environment_set_sdfgi(env: RID, enable: bool, cascades: int, min_cell_size: float, y_scale: EnvironmentSDFGIYScale, use_occlusion: bool, bounce_feedback: float, read_sky: bool, energy: float, normal_bias: float, probe_bias: float)

void

environment_set_sdfgi_frames_to_converge(frames: EnvironmentSDFGIFramesToConverge)

void

environment_set_sdfgi_frames_to_update_light(frames: EnvironmentSDFGIFramesToUpdateLight)

void

environment_set_sdfgi_ray_count(ray_count: EnvironmentSDFGIRayCount)

void

environment_set_sky(env: RID, sky: RID)

void

environment_set_sky_custom_fov(env: RID, scale: float)

void

environment_set_sky_orientation(env: RID, orientation: Basis)

void

environment_set_ssao(env: RID, enable: bool, radius: float, intensity: float, power: float, detail: float, horizon: float, sharpness: float, light_affect: float, ao_channel_affect: float)

void

environment_set_ssao_quality(quality: EnvironmentSSAOQuality, half_size: bool, adaptive_target: float, blur_passes: int, fadeout_from: float, fadeout_to: float)

void

environment_set_ssil_quality(quality: EnvironmentSSILQuality, half_size: bool, adaptive_target: float, blur_passes: int, fadeout_from: float, fadeout_to: float)

void

environment_set_ssr(env: RID, enable: bool, max_steps: int, fade_in: float, fade_out: float, depth_tolerance: float)

void

environment_set_ssr_half_size(half_size: bool)

void

environment_set_ssr_roughness_quality(quality: EnvironmentSSRRoughnessQuality)

void

environment_set_tonemap(env: RID, tone_mapper: EnvironmentToneMapper, exposure: float, white: float)

void

environment_set_tonemap_agx_contrast(env: RID, agx_contrast: float)

void

environment_set_volumetric_fog(env: RID, enable: bool, density: float, albedo: Color, emission: Color, emission_energy: float, anisotropy: float, length: float, detail_spread: float, gi_inject: float, temporal_reprojection: bool, temporal_reprojection_amount: float, ambient_inject: float, sky_affect: float)

void

environment_set_volumetric_fog_filter_active(active: bool)

void

environment_set_volumetric_fog_volume_size(size: int, depth: int)

RID

fog_volume_create()

void

fog_volume_set_material(fog_volume: RID, material: RID)

void

fog_volume_set_shape(fog_volume: RID, shape: FogVolumeShape)

void

fog_volume_set_size(fog_volume: RID, size: Vector3)

void

force_draw(swap_buffers: bool = true, frame_step: float = 0.0)

void

force_sync()

void

free_rid(rid: RID)

String

get_current_rendering_driver_name() const

String

get_current_rendering_method() const

Color

get_default_clear_color()

float

get_frame_setup_time_cpu() const

RenderingDevice

get_rendering_device() const

int

get_rendering_info(info: RenderingInfo)

Array[Dictionary]

get_shader_parameter_list(shader: RID) const

RID

get_test_cube()

RID

get_test_texture()

String

get_video_adapter_api_version() const

String

get_video_adapter_name() const

DeviceType

get_video_adapter_type() const

String

get_video_adapter_vendor() const

RID

get_white_texture()

void

gi_set_use_half_resolution(half_resolution: bool)

void

global_shader_parameter_add(name: StringName, type: GlobalShaderParameterType, default_value: Variant)

Variant

global_shader_parameter_get(name: StringName) const

Array[StringName]

global_shader_parameter_get_list() const

GlobalShaderParameterType

global_shader_parameter_get_type(name: StringName) const

void

global_shader_parameter_remove(name: StringName)

void

global_shader_parameter_set(name: StringName, value: Variant)

void

global_shader_parameter_set_override(name: StringName, value: Variant)

bool

has_changed() const

bool

has_feature(feature: Features) const

bool

has_os_feature(feature: String) const

void

instance_attach_object_instance_id(instance: RID, id: int)

void

instance_attach_skeleton(instance: RID, skeleton: RID)

RID

instance_create()

RID

instance_create2(base: RID, scenario: RID)

Variant

instance_geometry_get_shader_parameter(instance: RID, parameter: StringName) const

Variant

instance_geometry_get_shader_parameter_default_value(instance: RID, parameter: StringName) const

Array[Dictionary]

instance_geometry_get_shader_parameter_list(instance: RID) const

void

instance_geometry_set_cast_shadows_setting(instance: RID, shadow_casting_setting: ShadowCastingSetting)

void

instance_geometry_set_flag(instance: RID, flag: InstanceFlags, enabled: bool)

void

instance_geometry_set_lightmap(instance: RID, lightmap: RID, lightmap_uv_scale: Rect2, lightmap_slice: int)

void

instance_geometry_set_lod_bias(instance: RID, lod_bias: float)

void

instance_geometry_set_material_overlay(instance: RID, material: RID)

void

instance_geometry_set_material_override(instance: RID, material: RID)

void

instance_geometry_set_shader_parameter(instance: RID, parameter: StringName, value: Variant)

void

instance_geometry_set_transparency(instance: RID, transparency: float)

void

instance_geometry_set_visibility_range(instance: RID, min: float, max: float, min_margin: float, max_margin: float, fade_mode: VisibilityRangeFadeMode)

void

instance_set_base(instance: RID, base: RID)

void

instance_set_blend_shape_weight(instance: RID, shape: int, weight: float)

void

instance_set_custom_aabb(instance: RID, aabb: AABB)

void

instance_set_extra_visibility_margin(instance: RID, margin: float)

void

instance_set_ignore_culling(instance: RID, enabled: bool)

void

instance_set_layer_mask(instance: RID, mask: int)

void

instance_set_pivot_data(instance: RID, sorting_offset: float, use_aabb_center: bool)

void

instance_set_scenario(instance: RID, scenario: RID)

void

instance_set_surface_override_material(instance: RID, surface: int, material: RID)

void

instance_set_transform(instance: RID, transform: Transform3D)

void

instance_set_visibility_parent(instance: RID, parent: RID)

void

instance_set_visible(instance: RID, visible: bool)

void

instance_teleport(instance: RID)

PackedInt64Array

instances_cull_aabb(aabb: AABB, scenario: RID = RID()) const

PackedInt64Array

instances_cull_convex(convex: Array[Plane], scenario: RID = RID()) const

PackedInt64Array

instances_cull_ray(from: Vector3, to: Vector3, scenario: RID = RID()) const

bool

is_on_render_thread()

void

light_area_set_normalize_energy(light: RID, enable: bool)

void

light_area_set_size(light: RID, size: Vector2)

void

light_directional_set_blend_splits(light: RID, enable: bool)

void

light_directional_set_shadow_mode(light: RID, mode: LightDirectionalShadowMode)

void

light_directional_set_sky_mode(light: RID, mode: LightDirectionalSkyMode)

void

light_omni_set_shadow_mode(light: RID, mode: LightOmniShadowMode)

void

light_projectors_set_filter(filter: LightProjectorFilter)

void

light_set_bake_mode(light: RID, bake_mode: LightBakeMode)

void

light_set_color(light: RID, color: Color)

void

light_set_cull_mask(light: RID, mask: int)

void

light_set_distance_fade(decal: RID, enabled: bool, begin: float, shadow: float, length: float)

void

light_set_max_sdfgi_cascade(light: RID, cascade: int)

void

light_set_negative(light: RID, enable: bool)

void

light_set_param(light: RID, param: LightParam, value: float)

void

light_set_projector(light: RID, texture: RID)

void

light_set_reverse_cull_face_mode(light: RID, enabled: bool)

void

light_set_shadow(light: RID, enabled: bool)

void

light_set_shadow_caster_mask(light: RID, mask: int)

RID

lightmap_create()

PackedInt32Array

lightmap_get_probe_capture_bsp_tree(lightmap: RID) const

PackedVector3Array

lightmap_get_probe_capture_points(lightmap: RID) const

PackedColorArray

lightmap_get_probe_capture_sh(lightmap: RID) const

PackedInt32Array

lightmap_get_probe_capture_tetrahedra(lightmap: RID) const

void

lightmap_set_baked_exposure_normalization(lightmap: RID, baked_exposure: float)

void

lightmap_set_probe_bounds(lightmap: RID, bounds: AABB)

void

lightmap_set_probe_capture_data(lightmap: RID, points: PackedVector3Array, point_sh: PackedColorArray, tetrahedra: PackedInt32Array, bsp_tree: PackedInt32Array)

void

lightmap_set_probe_capture_update_speed(speed: float)

void

lightmap_set_probe_interior(lightmap: RID, interior: bool)

void

lightmap_set_textures(lightmap: RID, light: RID, uses_sh: bool)

void

lightmaps_set_bicubic_filter(enable: bool)

RID

make_sphere_mesh(latitudes: int, longitudes: int, radius: float)

RID

material_create()

Variant

material_get_param(material: RID, parameter: StringName) const

void

material_set_next_pass(material: RID, next_material: RID)

void

material_set_param(material: RID, parameter: StringName, value: Variant)

void

material_set_render_priority(material: RID, priority: int)

void

material_set_shader(shader_material: RID, shader: RID)

void

material_set_use_debanding(enable: bool)

void

mesh_add_surface(mesh: RID, surface: Dictionary)

void

mesh_add_surface_from_arrays(mesh: RID, primitive: PrimitiveType, arrays: Array, blend_shapes: Array = [], lods: Dictionary = {}, compress_format: BitField[ArrayFormat] = 0)

void

mesh_clear(mesh: RID)

RID

mesh_create()

RID

mesh_create_from_surfaces(surfaces: Array[Dictionary], blend_shape_count: int = 0)

int

mesh_get_blend_shape_count(mesh: RID) const

BlendShapeMode

mesh_get_blend_shape_mode(mesh: RID) const

AABB

mesh_get_custom_aabb(mesh: RID) const

Dictionary

mesh_get_surface(mesh: RID, surface: int)

int

mesh_get_surface_count(mesh: RID) const

void

mesh_set_blend_shape_mode(mesh: RID, mode: BlendShapeMode)

void

mesh_set_custom_aabb(mesh: RID, aabb: AABB)

void

mesh_set_shadow_mesh(mesh: RID, shadow_mesh: RID)

Array

mesh_surface_get_arrays(mesh: RID, surface: int) const

Array[Array]

mesh_surface_get_blend_shape_arrays(mesh: RID, surface: int) const

int

mesh_surface_get_format_attribute_stride(format: BitField[ArrayFormat], vertex_count: int) const

int

mesh_surface_get_format_index_stride(format: BitField[ArrayFormat], vertex_count: int) const

int

mesh_surface_get_format_normal_tangent_stride(format: BitField[ArrayFormat], vertex_count: int) const

int

mesh_surface_get_format_offset(format: BitField[ArrayFormat], vertex_count: int, array_index: int) const

int

mesh_surface_get_format_skin_stride(format: BitField[ArrayFormat], vertex_count: int) const

int

mesh_surface_get_format_vertex_stride(format: BitField[ArrayFormat], vertex_count: int) const

RID

mesh_surface_get_material(mesh: RID, surface: int) const

void

mesh_surface_remove(mesh: RID, surface: int)

void

mesh_surface_set_material(mesh: RID, surface: int, material: RID)

void

mesh_surface_update_attribute_region(mesh: RID, surface: int, offset: int, data: PackedByteArray)

void

mesh_surface_update_index_region(mesh: RID, surface: int, offset: int, data: PackedByteArray)

void

mesh_surface_update_skin_region(mesh: RID, surface: int, offset: int, data: PackedByteArray)

void

mesh_surface_update_vertex_region(mesh: RID, surface: int, offset: int, data: PackedByteArray)

void

multimesh_allocate_data(multimesh: RID, instances: int, transform_format: MultimeshTransformFormat, color_format: bool = false, custom_data_format: bool = false, use_indirect: bool = false)

RID

multimesh_create()

AABB

multimesh_get_aabb(multimesh: RID) const

PackedFloat32Array

multimesh_get_buffer(multimesh: RID) const

RID

multimesh_get_buffer_rd_rid(multimesh: RID) const

RID

multimesh_get_command_buffer_rd_rid(multimesh: RID) const

AABB

multimesh_get_custom_aabb(multimesh: RID) const

int

multimesh_get_instance_count(multimesh: RID) const

RID

multimesh_get_mesh(multimesh: RID) const

int

multimesh_get_visible_instances(multimesh: RID) const

Color

multimesh_instance_get_color(multimesh: RID, index: int) const

Color

multimesh_instance_get_custom_data(multimesh: RID, index: int) const

Transform3D

multimesh_instance_get_transform(multimesh: RID, index: int) const

Transform2D

multimesh_instance_get_transform_2d(multimesh: RID, index: int) const

void

multimesh_instance_reset_physics_interpolation(multimesh: RID, index: int)

void

multimesh_instance_set_color(multimesh: RID, index: int, color: Color)

void

multimesh_instance_set_custom_data(multimesh: RID, index: int, custom_data: Color)

void

multimesh_instance_set_transform(multimesh: RID, index: int, transform: Transform3D)

void

multimesh_instance_set_transform_2d(multimesh: RID, index: int, transform: Transform2D)

void

multimesh_instances_reset_physics_interpolation(multimesh: RID)

void

multimesh_set_buffer(multimesh: RID, buffer: PackedFloat32Array)

void

multimesh_set_buffer_interpolated(multimesh: RID, buffer: PackedFloat32Array, buffer_previous: PackedFloat32Array)

void

multimesh_set_custom_aabb(multimesh: RID, aabb: AABB)

void

multimesh_set_mesh(multimesh: RID, mesh: RID)

void

multimesh_set_physics_interpolated(multimesh: RID, interpolated: bool)

void

multimesh_set_physics_interpolation_quality(multimesh: RID, quality: MultimeshPhysicsInterpolationQuality)

void

multimesh_set_visible_instances(multimesh: RID, visible: int)

RID

occluder_create()

void

occluder_set_mesh(occluder: RID, vertices: PackedVector3Array, indices: PackedInt32Array)

RID

omni_light_create()

RID

particles_collision_create()

void

particles_collision_height_field_update(particles_collision: RID)

void

particles_collision_set_attractor_attenuation(particles_collision: RID, curve: float)

void

particles_collision_set_attractor_directionality(particles_collision: RID, amount: float)

void

particles_collision_set_attractor_strength(particles_collision: RID, strength: float)

void

particles_collision_set_box_extents(particles_collision: RID, extents: Vector3)

void

particles_collision_set_collision_type(particles_collision: RID, type: ParticlesCollisionType)

void

particles_collision_set_cull_mask(particles_collision: RID, mask: int)

void

particles_collision_set_field_texture(particles_collision: RID, texture: RID)

void

particles_collision_set_height_field_mask(particles_collision: RID, mask: int)

void

particles_collision_set_height_field_resolution(particles_collision: RID, resolution: ParticlesCollisionHeightfieldResolution)

void

particles_collision_set_sphere_radius(particles_collision: RID, radius: float)

RID

particles_create()

void

particles_emit(particles: RID, transform: Transform3D, velocity: Vector3, color: Color, custom: Color, emit_flags: int)

AABB

particles_get_current_aabb(particles: RID)

bool

particles_get_emitting(particles: RID)

bool

particles_is_inactive(particles: RID)

void

particles_request_process(particles: RID)

void

particles_request_process_time(particles: RID, process_time: float, process_time_residual: float = 0.0)

void

particles_restart(particles: RID)

void

particles_set_amount(particles: RID, amount: int)

void

particles_set_amount_ratio(particles: RID, ratio: float)

void

particles_set_collision_base_size(particles: RID, size: float)

void

particles_set_custom_aabb(particles: RID, aabb: AABB)

void

particles_set_draw_order(particles: RID, order: ParticlesDrawOrder)

void

particles_set_draw_pass_mesh(particles: RID, pass: int, mesh: RID)

void

particles_set_draw_passes(particles: RID, count: int)

void

particles_set_emission_transform(particles: RID, transform: Transform3D)

void

particles_set_emitter_velocity(particles: RID, velocity: Vector3)

void

particles_set_emitting(particles: RID, emitting: bool)

void

particles_set_explosiveness_ratio(particles: RID, ratio: float)

void

particles_set_fixed_fps(particles: RID, fps: int)

void

particles_set_fractional_delta(particles: RID, enable: bool)

void

particles_set_interp_to_end(particles: RID, factor: float)

void

particles_set_interpolate(particles: RID, enable: bool)

void

particles_set_lifetime(particles: RID, lifetime: float)

void

particles_set_mode(particles: RID, mode: ParticlesMode)

void

particles_set_one_shot(particles: RID, one_shot: bool)

void

particles_set_pre_process_time(particles: RID, time: float)

void

particles_set_process_material(particles: RID, material: RID)

void

particles_set_randomness_ratio(particles: RID, ratio: float)

void

particles_set_speed_scale(particles: RID, scale: float)

void

particles_set_subemitter(particles: RID, subemitter_particles: RID)

void

particles_set_trail_bind_poses(particles: RID, bind_poses: Array[Transform3D])

void

particles_set_trails(particles: RID, enable: bool, length_sec: float)

void

particles_set_transform_align(particles: RID, align: ParticlesTransformAlign)

void

particles_set_transform_align_axis(particles: RID, rotation_axis: ParticlesTransformAlignAxis)

void

particles_set_transform_align_channel_filter(particles: RID, channel_filter: ParticlesTransformAlignCustomSrc)

void

particles_set_use_local_coordinates(particles: RID, enable: bool)

void

positional_soft_shadow_filter_set_quality(quality: ShadowQuality)

RID

reflection_probe_create()

void

reflection_probe_set_ambient_color(probe: RID, color: Color)

void

reflection_probe_set_ambient_energy(probe: RID, energy: float)

void

reflection_probe_set_ambient_mode(probe: RID, mode: ReflectionProbeAmbientMode)

void

reflection_probe_set_as_interior(probe: RID, enable: bool)

void

reflection_probe_set_blend_distance(probe: RID, blend_distance: float)

void

reflection_probe_set_cull_mask(probe: RID, layers: int)

void

reflection_probe_set_enable_box_projection(probe: RID, enable: bool)

void

reflection_probe_set_enable_shadows(probe: RID, enable: bool)

void

reflection_probe_set_intensity(probe: RID, intensity: float)

void

reflection_probe_set_max_distance(probe: RID, distance: float)

void

reflection_probe_set_mesh_lod_threshold(probe: RID, pixels: float)

void

reflection_probe_set_origin_offset(probe: RID, offset: Vector3)

void

reflection_probe_set_reflection_mask(probe: RID, layers: int)

void

reflection_probe_set_resolution(probe: RID, resolution: int)

void

reflection_probe_set_size(probe: RID, size: Vector3)

void

reflection_probe_set_update_mode(probe: RID, mode: ReflectionProbeUpdateMode)

void

request_frame_drawn_callback(callable: Callable)

RID

scenario_create()

void

scenario_set_camera_attributes(scenario: RID, effects: RID)

void

scenario_set_compositor(scenario: RID, compositor: RID)

void

scenario_set_environment(scenario: RID, environment: RID)

void

scenario_set_fallback_environment(scenario: RID, environment: RID)

void

screen_space_roughness_limiter_set_active(enable: bool, amount: float, limit: float)

void

set_boot_image(image: Image, color: Color, scale: bool, use_filter: bool = true)

void

set_boot_image_with_stretch(image: Image, color: Color, stretch_mode: SplashStretchMode, use_filter: bool = true)

void

set_debug_generate_wireframes(generate: bool)

void

set_default_clear_color(color: Color)

RID

shader_create()

String

shader_get_code(shader: RID) const

RID

shader_get_default_texture_parameter(shader: RID, name: StringName, index: int = 0) const

Variant

shader_get_parameter_default(shader: RID, name: StringName) const

void

shader_set_code(shader: RID, code: String)

void

shader_set_default_texture_parameter(shader: RID, name: StringName, texture: RID, index: int = 0)

void

shader_set_path_hint(shader: RID, path: String)

void

skeleton_allocate_data(skeleton: RID, bones: int, is_2d_skeleton: bool = false)

Transform3D

skeleton_bone_get_transform(skeleton: RID, bone: int) const

Transform2D

skeleton_bone_get_transform_2d(skeleton: RID, bone: int) const

void

skeleton_bone_set_transform(skeleton: RID, bone: int, transform: Transform3D)

void

skeleton_bone_set_transform_2d(skeleton: RID, bone: int, transform: Transform2D)

RID

skeleton_create()

int

skeleton_get_bone_count(skeleton: RID) const

void

skeleton_set_base_transform_2d(skeleton: RID, base_transform: Transform2D)

Image

sky_bake_panorama(sky: RID, energy: float, bake_irradiance: bool, size: Vector2i)

RID

sky_create()

void

sky_set_material(sky: RID, material: RID)

void

sky_set_mode(sky: RID, mode: SkyMode)

void

sky_set_radiance_size(sky: RID, radiance_size: int)

RID

spot_light_create()

void

sub_surface_scattering_set_quality(quality: SubSurfaceScatteringQuality)

void

sub_surface_scattering_set_scale(scale: float, depth_scale: float)

RID

texture_2d_create(image: Image)

Image

texture_2d_get(texture: RID) const

Image

texture_2d_layer_get(texture: RID, layer: int) const

RID

texture_2d_layered_create(layers: Array[Image], layered_type: TextureLayeredType)

RID

texture_2d_layered_placeholder_create(layered_type: TextureLayeredType)

RID

texture_2d_placeholder_create()

void

texture_2d_update(texture: RID, image: Image, layer: int)

RID

texture_3d_create(format: Format, width: int, height: int, depth: int, mipmaps: bool, data: Array[Image])

Array[Image]

texture_3d_get(texture: RID) const

RID

texture_3d_placeholder_create()

void

texture_3d_update(texture: RID, data: Array[Image])

RID

texture_create_from_native_handle(type: TextureType, format: Format, native_handle: int, width: int, height: int, depth: int, layers: int = 1, layered_type: TextureLayeredType = 0)

void

texture_drawable_blit_rect(textures: Array[RID], rect: Rect2i, material: RID, modulate: Color, source_textures: Array[RID], to_mipmap: int = 0)

RID

texture_drawable_create(width: int, height: int, format: TextureDrawableFormat, color: Color = Color(1, 1, 1, 1), with_mipmaps: bool = false)

void

texture_drawable_generate_mipmaps(texture: RID)

RID

texture_drawable_get_default_material() const

Format

texture_get_format(texture: RID) const

int

texture_get_native_handle(texture: RID, srgb: bool = false) const

String

texture_get_path(texture: RID) const

RID

texture_get_rd_texture(texture: RID, srgb: bool = false) const

RID

texture_proxy_create(base: RID)

void

texture_proxy_update(texture: RID, proxy_to: RID)

RID

texture_rd_create(rd_texture: RID, layer_type: TextureLayeredType = 0)

void

texture_replace(texture: RID, by_texture: RID)

void

texture_set_force_redraw_if_visible(texture: RID, enable: bool)

void

texture_set_path(texture: RID, path: String)

void

texture_set_size_override(texture: RID, width: int, height: int)

void

viewport_attach_camera(viewport: RID, camera: RID)

void

viewport_attach_canvas(viewport: RID, canvas: RID)

void

viewport_attach_to_screen(viewport: RID, rect: Rect2 = Rect2(0, 0, 0, 0), screen: int = 0)

RID

viewport_create()

float

viewport_get_measured_render_time_cpu(viewport: RID) const

float

viewport_get_measured_render_time_gpu(viewport: RID) const

int

viewport_get_render_info(viewport: RID, type: ViewportRenderInfoType, info: ViewportRenderInfo)

RID

viewport_get_render_target(viewport: RID) const

RID

viewport_get_texture(viewport: RID) const

ViewportUpdateMode

viewport_get_update_mode(viewport: RID) const

void

viewport_remove_canvas(viewport: RID, canvas: RID)

void

viewport_set_active(viewport: RID, active: bool)

void

viewport_set_anisotropic_filtering_level(viewport: RID, anisotropic_filtering_level: ViewportAnisotropicFiltering)

void

viewport_set_canvas_cull_mask(viewport: RID, canvas_cull_mask: int)

void

viewport_set_canvas_stacking(viewport: RID, canvas: RID, layer: int, sublayer: int)

void

viewport_set_canvas_transform(viewport: RID, canvas: RID, offset: Transform2D)

void

viewport_set_clear_mode(viewport: RID, clear_mode: ViewportClearMode)

void

viewport_set_debug_draw(viewport: RID, draw: ViewportDebugDraw)

void

viewport_set_default_canvas_item_texture_filter(viewport: RID, filter: CanvasItemTextureFilter)

void

viewport_set_default_canvas_item_texture_repeat(viewport: RID, repeat: CanvasItemTextureRepeat)

void

viewport_set_disable_2d(viewport: RID, disable: bool)

void

viewport_set_disable_3d(viewport: RID, disable: bool)

void

viewport_set_environment_mode(viewport: RID, mode: ViewportEnvironmentMode)

void

viewport_set_fsr_sharpness(viewport: RID, sharpness: float)

void

viewport_set_global_canvas_transform(viewport: RID, transform: Transform2D)

void

viewport_set_measure_render_time(viewport: RID, enable: bool)

void

viewport_set_msaa_2d(viewport: RID, msaa: ViewportMSAA)

void

viewport_set_msaa_3d(viewport: RID, msaa: ViewportMSAA)

void

viewport_set_occlusion_culling_build_quality(quality: ViewportOcclusionCullingBuildQuality)

void

viewport_set_occlusion_rays_per_thread(rays_per_thread: int)

void

viewport_set_parent_viewport(viewport: RID, parent_viewport: RID)

void

viewport_set_positional_shadow_atlas_quadrant_subdivision(viewport: RID, quadrant: int, subdivision: int)

void

viewport_set_positional_shadow_atlas_size(viewport: RID, size: int, use_16_bits: bool = false)

void

viewport_set_render_direct_to_screen(viewport: RID, enabled: bool)

void

viewport_set_scaling_3d_mode(viewport: RID, scaling_3d_mode: ViewportScaling3DMode)

void

viewport_set_scaling_3d_scale(viewport: RID, scale: float)

void

viewport_set_scenario(viewport: RID, scenario: RID)

void

viewport_set_screen_space_aa(viewport: RID, mode: ViewportScreenSpaceAA)

void

viewport_set_sdf_oversize_and_scale(viewport: RID, oversize: ViewportSDFOversize, scale: ViewportSDFScale)

void

viewport_set_size(viewport: RID, width: int, height: int, view_count: int = 1)

void

viewport_set_snap_2d_transforms_to_pixel(viewport: RID, enabled: bool)

void

viewport_set_snap_2d_vertices_to_pixel(viewport: RID, enabled: bool)

void

viewport_set_texture_mipmap_bias(viewport: RID, mipmap_bias: float)

void

viewport_set_transparent_background(viewport: RID, enabled: bool)

void

viewport_set_update_mode(viewport: RID, update_mode: ViewportUpdateMode)

void

viewport_set_use_debanding(viewport: RID, enable: bool)

void

viewport_set_use_hdr_2d(viewport: RID, enabled: bool)

void

viewport_set_use_occlusion_culling(viewport: RID, enable: bool)

void

viewport_set_use_taa(viewport: RID, enable: bool)

void

viewport_set_use_xr(viewport: RID, use_xr: bool)

void

viewport_set_vrs_mode(viewport: RID, mode: ViewportVRSMode)

void

viewport_set_vrs_texture(viewport: RID, texture: RID)

void

viewport_set_vrs_update_mode(viewport: RID, mode: ViewportVRSUpdateMode)

RID

visibility_notifier_create()

void

visibility_notifier_set_aabb(notifier: RID, aabb: AABB)

void

visibility_notifier_set_callbacks(notifier: RID, enter_callable: Callable, exit_callable: Callable)

void

voxel_gi_allocate_data(voxel_gi: RID, to_cell_xform: Transform3D, aabb: AABB, octree_size: Vector3i, octree_cells: PackedByteArray, data_cells: PackedByteArray, distance_field: PackedByteArray, level_counts: PackedInt32Array)

RID

voxel_gi_create()

PackedByteArray

voxel_gi_get_data_cells(voxel_gi: RID) const

PackedByteArray

voxel_gi_get_distance_field(voxel_gi: RID) const

PackedInt32Array

voxel_gi_get_level_counts(voxel_gi: RID) const

PackedByteArray

voxel_gi_get_octree_cells(voxel_gi: RID) const

Vector3i

voxel_gi_get_octree_size(voxel_gi: RID) const

Transform3D

voxel_gi_get_to_cell_xform(voxel_gi: RID) const

void

voxel_gi_set_baked_exposure_normalization(voxel_gi: RID, baked_exposure: float)

void

voxel_gi_set_bias(voxel_gi: RID, bias: float)

void

voxel_gi_set_dynamic_range(voxel_gi: RID, range: float)

void

voxel_gi_set_energy(voxel_gi: RID, energy: float)

void

voxel_gi_set_interior(voxel_gi: RID, enable: bool)

void

voxel_gi_set_normal_bias(voxel_gi: RID, bias: float)

void

voxel_gi_set_propagation(voxel_gi: RID, amount: float)

void

voxel_gi_set_quality(quality: VoxelGIQuality)

void

voxel_gi_set_use_two_bounces(voxel_gi: RID, enable: bool)


訊號

frame_post_draw() 🔗

在該影格的結尾發出,此時 RenderingServer 剛剛完成對所有 Viewport 的更新。


frame_pre_draw() 🔗

在該影格的開頭發出,此後 RenderingServer 會更新所有 Viewport。


列舉

enum TextureType: 🔗

TextureType TEXTURE_TYPE_2D = 0

2D texture.

TextureType TEXTURE_TYPE_LAYERED = 1

Layered texture.

TextureType TEXTURE_TYPE_3D = 2

3D texture.


enum TextureLayeredType: 🔗

TextureLayeredType TEXTURE_LAYERED_2D_ARRAY = 0

二維紋理陣列(見 Texture2DArray)。

TextureLayeredType TEXTURE_LAYERED_CUBEMAP = 1

立方體貼圖紋理(見 Cubemap)。

TextureLayeredType TEXTURE_LAYERED_CUBEMAP_ARRAY = 2

立方體貼圖紋理陣列(見 CubemapArray)。


enum CubeMapLayer: 🔗

CubeMapLayer CUBEMAP_LAYER_LEFT = 0

Cubemap 的左面。

CubeMapLayer CUBEMAP_LAYER_RIGHT = 1

Cubemap 的右面。

CubeMapLayer CUBEMAP_LAYER_BOTTOM = 2

Cubemap 的底面。

CubeMapLayer CUBEMAP_LAYER_TOP = 3

Cubemap 的頂面。

CubeMapLayer CUBEMAP_LAYER_FRONT = 4

Cubemap 的正面。

CubeMapLayer CUBEMAP_LAYER_BACK = 5

Cubemap 的背面。


enum TextureDrawableFormat: 🔗

TextureDrawableFormat TEXTURE_DRAWABLE_FORMAT_RGBA8 = 0

OpenGL texture format RGBA with four components, each with a bitdepth of 8.

TextureDrawableFormat TEXTURE_DRAWABLE_FORMAT_RGBA8_SRGB = 1

OpenGL texture format RGBA with four components, each with a bitdepth of 8.

When drawn to, an sRGB to linear color space conversion is performed.

TextureDrawableFormat TEXTURE_DRAWABLE_FORMAT_RGBAH = 2

OpenGL texture format GL_RGBA16F where there are four components, each a 16-bit "half-precision" floating-point value.

TextureDrawableFormat TEXTURE_DRAWABLE_FORMAT_RGBAF = 3

OpenGL texture format GL_RGBA32F where there are four components, each a 32-bit floating-point value.


enum ShaderMode: 🔗

ShaderMode SHADER_SPATIAL = 0

著色器是 3D 著色器。

ShaderMode SHADER_CANVAS_ITEM = 1

著色器是 2D 著色器。

ShaderMode SHADER_PARTICLES = 2

著色器是粒子著色器(2D 和 3D 均可使用)。

ShaderMode SHADER_SKY = 3

著色器是 3D 天空著色器。

ShaderMode SHADER_FOG = 4

著色器是 3D 霧著色器。

ShaderMode SHADER_TEXTURE_BLIT = 5

Shader is a texture_blit shader.

ShaderMode SHADER_MAX = 6

代表 ShaderMode 列舉的大小。


enum ArrayType: 🔗

ArrayType ARRAY_VERTEX = 0

陣列是頂點位置陣列。

ArrayType ARRAY_NORMAL = 1

陣列是法線陣列。

ArrayType ARRAY_TANGENT = 2

陣列是切線陣列。

ArrayType ARRAY_COLOR = 3

陣列是頂點顏色陣列。

ArrayType ARRAY_TEX_UV = 4

陣列是 UV 座標陣列。

ArrayType ARRAY_TEX_UV2 = 5

陣列是第二組 UV 座標的 UV 座標陣列。

ArrayType ARRAY_CUSTOM0 = 6

陣列是第一組自訂資料的自訂資料陣列。

ArrayType ARRAY_CUSTOM1 = 7

陣列是第二組自訂資料的自訂資料陣列。

ArrayType ARRAY_CUSTOM2 = 8

陣列是第三組自訂資料的自訂資料陣列。

ArrayType ARRAY_CUSTOM3 = 9

陣列是第四組自訂資料的自訂資料陣列。

ArrayType ARRAY_BONES = 10

陣列包含骨骼資訊。

ArrayType ARRAY_WEIGHTS = 11

陣列是重量資訊。

ArrayType ARRAY_INDEX = 12

陣列是索引陣列。

ArrayType ARRAY_MAX = 13

代表 ArrayType 列舉的大小。


enum ArrayCustomFormat: 🔗

ArrayCustomFormat ARRAY_CUSTOM_RGBA8_UNORM = 0

自訂資料陣列包含的是每通道 8 位的紅、綠、藍、Alpha 顏色資料。元素經過歸一化,是 [0.0, 1.0] 範圍內的無符號浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RGBA8_SNORM = 1

自訂資料陣列包含的是每通道 8 位的紅、綠、藍、Alpha 顏色資料。元素經過歸一化,是 [0.0, 1.0] 範圍內的帶符號浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RG_HALF = 2

自訂資料陣列包含的是每通道 16 位的紅、綠、藍顏色資料。元素為半精度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RGBA_HALF = 3

自訂資料陣列包含的是每通道 16 位的紅、綠、藍、Alpha 顏色資料。元素為半精度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_R_FLOAT = 4

自訂資料陣列包含的是每通道 32 位元的紅色資料。元素為單精確度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RG_FLOAT = 5

自訂資料陣列包含的是每通道 32 位的紅、綠顏色資料。元素為單精確度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RGB_FLOAT = 6

自訂資料陣列包含的是每通道 32 位的紅、綠、藍顏色資料。元素為單精確度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_RGBA_FLOAT = 7

自訂資料陣列包含的是每通道 32 位的紅、綠、藍、Alpha 顏色資料。元素為單精確度浮點數。

ArrayCustomFormat ARRAY_CUSTOM_MAX = 8

代表 ArrayCustomFormat 列舉的大小。


flags ArrayFormat: 🔗

ArrayFormat ARRAY_FORMAT_VERTEX = 1

用於標記頂點位置陣列的旗標。

ArrayFormat ARRAY_FORMAT_NORMAL = 2

用於標記法線陣列的旗標。

ArrayFormat ARRAY_FORMAT_TANGENT = 4

用於標記切線陣列的旗標。

ArrayFormat ARRAY_FORMAT_COLOR = 8

用於標記頂點顏色陣列的旗標。

ArrayFormat ARRAY_FORMAT_TEX_UV = 16

用於標記 UV 座標陣列的旗標。

ArrayFormat ARRAY_FORMAT_TEX_UV2 = 32

用於標記第二個 UV 座標的 UV 座標陣列的旗標。

ArrayFormat ARRAY_FORMAT_CUSTOM0 = 64

用於標記第一組自訂資料的自訂頂點資料陣列的旗標。

ArrayFormat ARRAY_FORMAT_CUSTOM1 = 128

用於標記第二組自訂資料的自訂頂點資料陣列的旗標。

ArrayFormat ARRAY_FORMAT_CUSTOM2 = 256

用於標記第三組自訂資料的自訂頂點資料陣列的旗標。

ArrayFormat ARRAY_FORMAT_CUSTOM3 = 512

用於標記第四組自訂資料的自訂頂點資料陣列的旗標。

ArrayFormat ARRAY_FORMAT_BONES = 1024

用來標記骨骼資訊陣列的旗標。

ArrayFormat ARRAY_FORMAT_WEIGHTS = 2048

用於標記重量陣列的標記。

ArrayFormat ARRAY_FORMAT_INDEX = 4096

用於標記索引陣列的旗標。

ArrayFormat ARRAY_FORMAT_BLEND_SHAPE_MASK = 7

混合形狀中允許使用的網格通道的遮罩。

ArrayFormat ARRAY_FORMAT_CUSTOM_BASE = 13

第一個自訂通道的移位量。

ArrayFormat ARRAY_FORMAT_CUSTOM_BITS = 3

每個自訂通道的格式位數。請參閱 ArrayCustomFormat

ArrayFormat ARRAY_FORMAT_CUSTOM0_SHIFT = 13

自訂通道索引 0 需要對 ArrayCustomFormat 進行的按位移動量。

ArrayFormat ARRAY_FORMAT_CUSTOM1_SHIFT = 16

自訂通道索引 1 需要對 ArrayCustomFormat 進行的按位移動量。

ArrayFormat ARRAY_FORMAT_CUSTOM2_SHIFT = 19

自訂通道索引 2 需要對 ArrayCustomFormat 進行的按位移動量。

ArrayFormat ARRAY_FORMAT_CUSTOM3_SHIFT = 22

自訂通道索引 3 需要對 ArrayCustomFormat 進行的按位移動量。

ArrayFormat ARRAY_FORMAT_CUSTOM_MASK = 7

每個自訂通道的自訂格式位元遮罩。必須按 SHIFT 常數之一進行移位。請參閱 ArrayCustomFormat

ArrayFormat ARRAY_COMPRESS_FLAGS_BASE = 25

第一個壓縮旗標的移位元。壓縮旗標應該被傳遞給 ArrayMesh.add_surface_from_arrays()SurfaceTool.commit()

ArrayFormat ARRAY_FLAG_USE_2D_VERTICES = 33554432

用於標記包含 2D 頂點的陣列的旗標。

ArrayFormat ARRAY_FLAG_USE_DYNAMIC_UPDATE = 67108864

Flag used to mark that the mesh data will use GL_DYNAMIC_DRAW on GLES. Unused on Vulkan.

ArrayFormat ARRAY_FLAG_USE_8_BONE_WEIGHTS = 134217728

用於標記陣列使用 8 個骨骼權重而不是 4 個的旗標。

ArrayFormat ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY = 268435456

Flag used to mark that the mesh does not have a vertex array and instead will infer vertex positions in the shader using indices and other information.

ArrayFormat ARRAY_FLAG_COMPRESS_ATTRIBUTES = 536870912

Flag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can.

ArrayFormat ARRAY_FLAG_FORMAT_VERSION_BASE = 35

Flag used to mark the start of the bits used to store the mesh version.

ArrayFormat ARRAY_FLAG_FORMAT_VERSION_SHIFT = 35

Flag used to shift a mesh format int to bring the version into the lowest digits.

ArrayFormat ARRAY_FLAG_FORMAT_VERSION_1 = 0

Flag used to record the format used by prior mesh versions before the introduction of a version.

ArrayFormat ARRAY_FLAG_FORMAT_VERSION_2 = 34359738368

Flag used to record the second iteration of the mesh version flag. The primary difference between this and ARRAY_FLAG_FORMAT_VERSION_1 is that this version supports ARRAY_FLAG_COMPRESS_ATTRIBUTES and in this version vertex positions are de-interleaved from normals and tangents.

ArrayFormat ARRAY_FLAG_FORMAT_CURRENT_VERSION = 34359738368

Flag used to record the current version that the engine expects. Currently this is the same as ARRAY_FLAG_FORMAT_VERSION_2.

ArrayFormat ARRAY_FLAG_FORMAT_VERSION_MASK = 255

Flag used to isolate the bits used for mesh version after using ARRAY_FLAG_FORMAT_VERSION_SHIFT to shift them into place.


enum PrimitiveType: 🔗

PrimitiveType PRIMITIVE_POINTS = 0

繪製的圖元由點組成。

PrimitiveType PRIMITIVE_LINES = 1

繪製的圖元由線組成。

PrimitiveType PRIMITIVE_LINE_STRIP = 2

繪製的圖元由單條線帶組成。

PrimitiveType PRIMITIVE_TRIANGLES = 3

繪製的圖元由三角形組成。

PrimitiveType PRIMITIVE_TRIANGLE_STRIP = 4

繪製的圖元由單條三角形帶組成(最後 3 個頂點總是會構成三角形)。

PrimitiveType PRIMITIVE_MAX = 5

代表 PrimitiveType 列舉的大小。


enum BlendShapeMode: 🔗

BlendShapeMode BLEND_SHAPE_MODE_NORMALIZED = 0

混合形狀是被正規化了的。

BlendShapeMode BLEND_SHAPE_MODE_RELATIVE = 1

混合形狀是相對於基礎的權重。


enum MultimeshTransformFormat: 🔗

MultimeshTransformFormat MULTIMESH_TRANSFORM_2D = 0

使用 Transform2D 儲存 MultiMesh 變換。

MultimeshTransformFormat MULTIMESH_TRANSFORM_3D = 1

使用 Transform3D 儲存 MultiMesh 變換。


enum MultimeshPhysicsInterpolationQuality: 🔗

MultimeshPhysicsInterpolationQuality MULTIMESH_INTERP_QUALITY_FAST = 0

MultiMesh physics interpolation favors speed over quality.

MultimeshPhysicsInterpolationQuality MULTIMESH_INTERP_QUALITY_HIGH = 1

MultiMesh physics interpolation favors quality over speed.


enum LightProjectorFilter: 🔗

LightProjectorFilter LIGHT_PROJECTOR_FILTER_NEAREST = 0

光線投射器的最近鄰篩選(用於圖元風光線投射器)。算繪時不使用 mipmap,這意味著較遠處的光線投射器看上去會很銳利,但會有顆粒狀的圖案。與使用 mipmap 的性能開銷大致相同。

LightProjectorFilter LIGHT_PROJECTOR_FILTER_LINEAR = 1

光線投射器的線性篩選(用於非圖元風光線投射器)。算繪時不使用 mipmap,這意味著較遠處的光線投射器看上去會很平滑,但會有模糊的效果。與使用 mipmap 的性能開銷大致相同。

LightProjectorFilter LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS = 2

光線投射器的最近鄰篩選(用於圖元風光線投射器)。算繪時使用各向同性的 mipmap,這意味著較遠處的光線投射器看上去會很平滑,但會有模糊的效果。與不使用 mipmap 的性能開銷大致相同。

LightProjectorFilter LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS = 3

光線投射器的線性篩選(用於非圖元風光線投射器)。算繪時使用各向同性的 mipmap,這意味著較遠處的光線投射器看上去會很平滑,但會有模糊的效果。與不使用 mipmap 的性能開銷大致相同。

LightProjectorFilter LIGHT_PROJECTOR_FILTER_NEAREST_MIPMAPS_ANISOTROPIC = 4

光線投射器的最近鄰篩選(用於圖元風光線投射器)。算繪時使用各向異性的 mipmap,這意味著光線投射器從斜角度觀察會既平滑又銳利。比各向同性的 mipmap 更好看,但也更慢。各向異性的級別由 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level 定義。

LightProjectorFilter LIGHT_PROJECTOR_FILTER_LINEAR_MIPMAPS_ANISOTROPIC = 5

光線投射器的線性篩選(用於非圖元風光線投射器)。算繪時使用各向異性的 mipmap,這意味著光線投射器從斜角度觀察會既平滑又銳利。比各向同性的 mipmap 更好看,但也更慢。各向異性的級別由 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level 定義。


enum LightType: 🔗

LightType LIGHT_DIRECTIONAL = 0

方向(太陽/月亮)燈(見 DirectionalLight3D)。

LightType LIGHT_OMNI = 1

全向燈(見 OmniLight3D)。

LightType LIGHT_SPOT = 2

聚光燈(見 SpotLight3D)。

LightType LIGHT_AREA = 3

Area light (see AreaLight3D).


enum LightParam: 🔗

LightParam LIGHT_PARAM_ENERGY = 0

該燈光的能量倍數。

LightParam LIGHT_PARAM_INDIRECT_ENERGY = 1

該燈光的間接能量倍數(最終的間接能量為 LIGHT_PARAM_ENERGY * LIGHT_PARAM_INDIRECT_ENERGY)。

LightParam LIGHT_PARAM_VOLUMETRIC_FOG_ENERGY = 2

該燈光的體積霧能量倍數(最終的體積霧能量為 LIGHT_PARAM_ENERGY * LIGHT_PARAM_VOLUMETRIC_FOG_ENERGY)。

LightParam LIGHT_PARAM_SPECULAR = 3

燈光對鏡面反射的影響。

LightParam LIGHT_PARAM_RANGE = 4

燈光的範圍。

LightParam LIGHT_PARAM_SIZE = 5

使用聚光燈或全向燈時的燈光大小。使用定向光時是光的角度大小。

LightParam LIGHT_PARAM_ATTENUATION = 6

光線的衰減。

LightParam LIGHT_PARAM_SPOT_ANGLE = 7

聚光燈的角度。

LightParam LIGHT_PARAM_SPOT_ATTENUATION = 8

聚光燈的衰減。

LightParam LIGHT_PARAM_SHADOW_MAX_DISTANCE = 9

陰影分割的最大距離。將這個值增大會讓定向陰影在更遠處可見,代價是整體的陰影細節降低和性能(因為算繪定向陰影時需要包含更多的物體)。

LightParam LIGHT_PARAM_SHADOW_SPLIT_1_OFFSET = 10

第一次拆分所佔據的陰影合集的比例。

LightParam LIGHT_PARAM_SHADOW_SPLIT_2_OFFSET = 11

第二次拆分所佔用的陰影合集的比例。

LightParam LIGHT_PARAM_SHADOW_SPLIT_3_OFFSET = 12

第三次拆分所佔用的陰影合集的比例。第四個拆分佔據了其餘部分。

LightParam LIGHT_PARAM_SHADOW_FADE_START = 13

陰影將開始淡出的陰影最大距離的比例。

LightParam LIGHT_PARAM_SHADOW_NORMAL_BIAS = 14

法線偏置,用於抵消物體法線的陰影搜尋。可以用來修復自陰影的偽影。

LightParam LIGHT_PARAM_SHADOW_BIAS = 15

Bias for the shadow lookup to fix self-shadowing artifacts.

LightParam LIGHT_PARAM_SHADOW_PANCAKE_SIZE = 16

設定定向陰影斑點的大小。 斑點偏移了陰影的相機視錐體的起點,為陰影提供更高的有效深度解析度。但是,較大的斑點尺寸會導致靠近視錐體邊緣的大型物體的陰影出現偽影。減少斑點的大小會有所幫助。將大小設定為 0 會關閉斑點效果。

LightParam LIGHT_PARAM_SHADOW_OPACITY = 17

燈光的陰影不透明度。低於 1.0 的值會使光線透過陰影出現。這可以用於以較低的性能成本偽造全域照明。

LightParam LIGHT_PARAM_SHADOW_BLUR = 18

模糊陰影的邊緣。可用於隱藏低解析度陰影貼圖中的圖元偽影。較高的值會使陰影顯得粗糙,並可能導致其他不需要的偽影。儘量保持接近預設值。

LightParam LIGHT_PARAM_TRANSMITTANCE_BIAS = 19

There is currently no description for this enum. Please help us by contributing one!

LightParam LIGHT_PARAM_INTENSITY = 20

代表燈光強度的常數,SpotLight3DOmniLight3D 的單位為流明,DirectionalLight3D 的單位為勒克斯。僅在 ProjectSettings.rendering/lights_and_shadows/use_physical_light_unitstrue 時使用。

LightParam LIGHT_PARAM_MAX = 21

代表 LightParam 列舉的大小。


enum LightBakeMode: 🔗

LightBakeMode LIGHT_BAKE_DISABLED = 0

烘焙時燈光將被忽略。這是最快的模式,但是在烘焙全域照明時仍會考慮該燈光。該模式通常套用於快速變化的動態燈光,因為全域照明的效果在這些燈光上不太明顯。

LightBakeMode LIGHT_BAKE_STATIC = 1

在靜態烘焙(VoxelGILightmapGI、SDFGI(Environment.sdfgi_enabled))時,考慮了燈光。燈光可以四處移動或修改,但其全域照明不會實時更新。這適用於細微的變化(例如閃爍的手電筒),但通常不適用於大的變化,例如打開和關閉燈光。

LightBakeMode LIGHT_BAKE_DYNAMIC = 2

動態烘焙時考慮燈光(僅 VoxelGI 和 SDFGI(Environment.sdfgi_enabled))。燈光可以四處移動或修改,全域照明會即時更新。燈光的全域照明效果與 LIGHT_BAKE_STATIC 略有不同。性能開銷比 LIGHT_BAKE_STATIC 更大。使用 SDFGI 時,動態燈光的更新速度受 ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights 的影響。


enum LightOmniShadowMode: 🔗

LightOmniShadowMode LIGHT_OMNI_SHADOW_DUAL_PARABOLOID = 0

對全向光使用雙抛物面陰影貼圖。

LightOmniShadowMode LIGHT_OMNI_SHADOW_CUBE = 1

對全向光使用立方體貼圖陰影貼圖。比雙抛物面更慢但品質更好。


enum LightDirectionalShadowMode: 🔗

LightDirectionalShadowMode LIGHT_DIRECTIONAL_SHADOW_ORTHOGONAL = 0

對平行光使用正交陰影投影。

LightDirectionalShadowMode LIGHT_DIRECTIONAL_SHADOW_PARALLEL_2_SPLITS = 1

使用平行光時,使用 2 個分割進行陰影投影。

LightDirectionalShadowMode LIGHT_DIRECTIONAL_SHADOW_PARALLEL_4_SPLITS = 2

使用平行光時,使用 4 個分割進行陰影投影。


enum LightDirectionalSkyMode: 🔗

LightDirectionalSkyMode LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_AND_SKY = 0

在天空算繪和場景照明中都使用 DirectionalLight3D。

LightDirectionalSkyMode LIGHT_DIRECTIONAL_SKY_MODE_LIGHT_ONLY = 1

僅在場景照明中使用 DirectionalLight3D。

LightDirectionalSkyMode LIGHT_DIRECTIONAL_SKY_MODE_SKY_ONLY = 2

僅在天空算繪中使用 DirectionalLight3D。


enum ShadowQuality: 🔗

ShadowQuality SHADOW_QUALITY_HARD = 0

最低的陰影篩選品質(最快)。使用這種品質設定時,軟陰影不可用,這意味著如果 Light3D.light_sizeLight3D.light_angular_distance0.0,則會忽略 Light3D.shadow_blur 屬性。

注意:使用硬陰影篩選時,由 Light3D.light_sizeLight3D.light_angular_distance 執行的可變陰影模糊仍然有效。在這種情況下考慮 Light3D.shadow_blur。但是不會對結果進行模糊處理,而是將模糊量視為半影的最大半徑。

ShadowQuality SHADOW_QUALITY_SOFT_VERY_LOW = 1

非常低的陰影篩選品質(更快)。使用該品質設定時,Light3D.shadow_blur 會自動乘以 0.75 倍以避免引入過多的噪點。該劃分僅適用於 Light3D.light_sizeLight3D.light_angular_distance0.0 的燈光。

ShadowQuality SHADOW_QUALITY_SOFT_LOW = 2

低陰影篩選品質(快速)。

ShadowQuality SHADOW_QUALITY_SOFT_MEDIUM = 3

中低陰影篩選品質(平均)。

ShadowQuality SHADOW_QUALITY_SOFT_HIGH = 4

高低陰影篩選品質(慢)。使用該品質設定時,Light3D.shadow_blur 會自動乘以 1.5 倍以更好地利用高樣本數。這種增加的模糊還提高了動態物件陰影的穩定性。該乘數僅適用於 Light3D.light_sizeLight3D.light_angular_distance0.0 的燈光。

ShadowQuality SHADOW_QUALITY_SOFT_ULTRA = 5

最高的低陰影篩選品質(最慢)。使用該品質設定時,Light3D.shadow_blur 會自動乘以 2 倍以更好地利用高樣本數。這種增加的模糊還提高了動態物件陰影的穩定性。該乘數僅適用於 Light3D.light_sizeLight3D.light_angular_distance0.0 的燈光。

ShadowQuality SHADOW_QUALITY_MAX = 6

代表 ShadowQuality 列舉的大小。


enum ReflectionProbeUpdateMode: 🔗

ReflectionProbeUpdateMode REFLECTION_PROBE_UPDATE_ONCE = 0

反射探查將更新一次反射,然後停止。

ReflectionProbeUpdateMode REFLECTION_PROBE_UPDATE_ALWAYS = 1

反射探查將每影格更新。這種模式對於捕捉移動物體是必要的。


enum ReflectionProbeAmbientMode: 🔗

ReflectionProbeAmbientMode REFLECTION_PROBE_AMBIENT_DISABLED = 0

不要在反射探查的區域內套用任何環境光,區域由探查的大小決定。

ReflectionProbeAmbientMode REFLECTION_PROBE_AMBIENT_ENVIRONMENT = 1

在反射探查的區域內套用自動來源的環境光照,區域由探查的大小決定。

ReflectionProbeAmbientMode REFLECTION_PROBE_AMBIENT_COLOR = 2

在反射探查的區域內套用自訂環境光,區域由探查的大小決定。見 reflection_probe_set_ambient_color()reflection_probe_set_ambient_energy()


enum DecalTexture: 🔗

DecalTexture DECAL_TEXTURE_ALBEDO = 0

裝飾中的反照率紋理(Decal.texture_albedo)。

DecalTexture DECAL_TEXTURE_NORMAL = 1

裝飾中的法線貼圖紋理(Decal.texture_normal)。

DecalTexture DECAL_TEXTURE_ORM = 2

裝飾中的遮蔽/粗糙度/金屬性紋理(Decal.texture_orm)。

DecalTexture DECAL_TEXTURE_EMISSION = 3

裝飾中的自發光紋理(Decal.texture_orm)。

DecalTexture DECAL_TEXTURE_MAX = 4

代表 DecalTexture 列舉的大小。


enum DecalFilter: 🔗

DecalFilter DECAL_FILTER_NEAREST = 0

裝飾的最近鄰篩選(用於圖元風裝飾)。算繪時不使用 mipmap,這意味著較遠處的裝飾看上去會很銳利,但會有顆粒狀的圖案。與使用 mipmap 的性能開銷大致相同。

DecalFilter DECAL_FILTER_LINEAR = 1

裝飾的線性篩選(用於非圖元風裝飾)。算繪時不使用 mipmap,這意味著較遠處的裝飾看上去會很平滑,但會有模糊的效果。與使用 mipmap 的性能開銷大致相同。

DecalFilter DECAL_FILTER_NEAREST_MIPMAPS = 2

裝飾的最近鄰篩選(用於圖元風裝飾)。算繪時使用各向同性的 mipmap,這意味著較遠處的裝飾看上去會很平滑,但會有模糊的效果。與不使用 mipmap 的性能開銷大致相同。

DecalFilter DECAL_FILTER_LINEAR_MIPMAPS = 3

裝飾的線性篩選(用於非圖元風裝飾)。算繪時使用各向同性的 mipmap,這意味著較遠處的裝飾看上去會很平滑,但會有模糊的效果。與不使用 mipmap 的性能開銷大致相同。

DecalFilter DECAL_FILTER_NEAREST_MIPMAPS_ANISOTROPIC = 4

裝飾的最近鄰篩選(用於圖元風裝飾)。算繪時使用各向異性的 mipmap,這意味著裝飾從斜角度觀察會既平滑又銳利。比各向同性的 mipmap 更好看,但也更慢。各向異性的級別由 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level 定義。

DecalFilter DECAL_FILTER_LINEAR_MIPMAPS_ANISOTROPIC = 5

裝飾的線性篩選(用於非圖元風裝飾)。算繪時使用各向異性的 mipmap,這意味著裝飾從斜角度觀察會既平滑又銳利。比各向同性的 mipmap 更好看,但也更慢。各向異性的級別由 ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level 定義。


enum VoxelGIQuality: 🔗

VoxelGIQuality VOXEL_GI_QUALITY_LOW = 0

VoxelGI 較低算繪品質,使用 4 個錐體。

VoxelGIQuality VOXEL_GI_QUALITY_HIGH = 1

VoxelGI 較高算繪品質,使用 6 個錐體。


enum ParticlesMode: 🔗

ParticlesMode PARTICLES_MODE_2D = 0

2D 粒子。

ParticlesMode PARTICLES_MODE_3D = 1

3D 粒子。


enum ParticlesTransformAlign: 🔗

ParticlesTransformAlign PARTICLES_TRANSFORM_ALIGN_DISABLED = 0

Do not align particle transforms relative to the camera or velocity.

ParticlesTransformAlign PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD = 1

Align each particle's Z axis to face the camera.

ParticlesTransformAlign PARTICLES_TRANSFORM_ALIGN_Y_TO_VELOCITY = 2

Align each particle's Y axis to the velocity vector.

ParticlesTransformAlign PARTICLES_TRANSFORM_ALIGN_Z_BILLBOARD_Y_TO_VELOCITY = 3

Align each particle's Z axis to face the camera and Y axis to the velocity vector.

ParticlesTransformAlign PARTICLES_TRANSFORM_ALIGN_LOCAL_BILLBOARD = 4

Billboard each particles around a local axis.


enum ParticlesTransformAlignCustomSrc: 🔗

ParticlesTransformAlignCustomSrc PARTICLES_ALIGN_CHANNEL_FILTER_DISABLED = 0

Do not read from CUSTOM when performing billboarding.

ParticlesTransformAlignCustomSrc PARTICLES_ALIGN_CHANNEL_FILTER_X = 1

Read from CUSTOM.x when performing billboarding and use it as an angle, in radians.

ParticlesTransformAlignCustomSrc PARTICLES_ALIGN_CHANNEL_FILTER_Y = 2

Read from CUSTOM.y when performing billboarding and use it as an angle, in radians.

ParticlesTransformAlignCustomSrc PARTICLES_ALIGN_CHANNEL_FILTER_Z = 3

Read from CUSTOM.z when performing billboarding and use it as an angle, in radians.

ParticlesTransformAlignCustomSrc PARTICLES_ALIGN_CHANNEL_FILTER_W = 4

Read from CUSTOM.w when performing billboarding and use it as an angle, in radians.


enum ParticlesTransformAlignAxis: 🔗

ParticlesTransformAlignAxis PARTICLES_ALIGN_AXIS_X = 0

Use the X axis for local billboarding.

ParticlesTransformAlignAxis PARTICLES_ALIGN_AXIS_Y = 1

Use the Y axis for local billboarding.


enum ParticlesDrawOrder: 🔗

ParticlesDrawOrder PARTICLES_DRAW_ORDER_INDEX = 0

按照粒子陣列中出現的順序繪製粒子。

ParticlesDrawOrder PARTICLES_DRAW_ORDER_LIFETIME = 1

Sort particles based on their lifetime. In other words, the particle with the highest lifetime is drawn at the front.

ParticlesDrawOrder PARTICLES_DRAW_ORDER_REVERSE_LIFETIME = 2

Sort particles based on the inverse of their lifetime. In other words, the particle with the lowest lifetime is drawn at the front.

ParticlesDrawOrder PARTICLES_DRAW_ORDER_VIEW_DEPTH = 3

根據粒子與相機的距離對其進行排序。


enum ParticlesCollisionType: 🔗

ParticlesCollisionType PARTICLES_COLLISION_TYPE_SPHERE_ATTRACT = 0

Sphere attractor type for GPUParticles3D (see GPUParticlesAttractorSphere3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_BOX_ATTRACT = 1

Box attractor type for GPUParticles3D (see GPUParticlesAttractorBox3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_VECTOR_FIELD_ATTRACT = 2

Vector field attractor type for GPUParticles3D (see GPUParticlesAttractorVectorField3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_SPHERE_COLLIDE = 3

Sphere collision type for GPUParticles3D (see GPUParticlesCollisionSphere3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_BOX_COLLIDE = 4

Box collision type for GPUParticles3D (see GPUParticlesCollisionBox3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_SDF_COLLIDE = 5

Signed distance field collision type for GPUParticles3D (see GPUParticlesCollisionSDF3D).

ParticlesCollisionType PARTICLES_COLLISION_TYPE_HEIGHTFIELD_COLLIDE = 6

Heightfield collision type for GPUParticles3D (see GPUParticlesCollisionHeightField3D).


enum ParticlesCollisionHeightfieldResolution: 🔗

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_256 = 0

256×256 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_512 = 1

512×512 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_1024 = 2

1024×1024 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_2048 = 3

2048×2048 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_4096 = 4

4096×4096 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_8192 = 5

8192×8192 heightfield resolution for GPUParticlesCollisionHeightField3D.

ParticlesCollisionHeightfieldResolution PARTICLES_COLLISION_HEIGHTFIELD_RESOLUTION_MAX = 6

代表 ParticlesCollisionHeightfieldResolution 列舉的大小。


enum FogVolumeShape: 🔗

FogVolumeShape FOG_VOLUME_SHAPE_ELLIPSOID = 0

FogVolume 的形狀類似於一個橢球體(拉伸的球體)。

FogVolumeShape FOG_VOLUME_SHAPE_CONE = 1

FogVolume 的形狀像一個向上的圓錐體(在局部座標中)。圓錐體的角度會自動被設置以填充大小。錐體將被調整以適合大小。旋轉 FogVolume 節點以重新定向圓錐體。不支援通過大小進行非均勻縮放(改為縮放 FogVolume 節點)。

FogVolumeShape FOG_VOLUME_SHAPE_CYLINDER = 2

FogVolume 的形狀將像一個直立的圓柱體(在局部座標中)。旋轉 FogVolume 節點以重新定向圓柱體。圓柱體將被調整以適合大小。不支援通過大小進行非均勻縮放(改為縮放 FogVolume 節點)。

FogVolumeShape FOG_VOLUME_SHAPE_BOX = 3

FogVolume 的形狀會像一個盒子。

FogVolumeShape FOG_VOLUME_SHAPE_WORLD = 4

FogVolume 將沒有形狀,將覆蓋整個世界並且不會被剔除。

FogVolumeShape FOG_VOLUME_SHAPE_MAX = 5

代表 FogVolumeShape 列舉的大小。


enum ViewportScaling3DMode: 🔗

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_BILINEAR = 0

對視口的 3D 緩衝區使用雙線性縮放。可以使用 Viewport.scaling_3d_scale 設定縮放量。小於 1.0 的值將導致欠取樣,而大於 1.0 的值將導致超取樣。1.0 的值將禁用縮放。

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_FSR = 1

Use AMD FidelityFX Super Resolution 1.0 upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.scaling_3d_scale. Values less than 1.0 will result in the viewport being upscaled using FSR. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling.

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_FSR2 = 2

Use AMD FidelityFX Super Resolution 2.2 upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.scaling_3d_scale. Values less than 1.0 will result in the viewport being upscaled using FSR2. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 will use FSR2 at native resolution as a TAA solution.

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_METALFX_SPATIAL = 3

Use MetalFX spatial upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.scaling_3d_scale. Values less than 1.0 will result in the viewport being upscaled using MetalFX. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling.

Note: Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_METALFX_TEMPORAL = 4

Use MetalFX temporal upscaling for the viewport's 3D buffer. The amount of scaling can be set using Viewport.scaling_3d_scale. Values less than 1.0 will result in the viewport being upscaled using MetalFX. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 will use MetalFX at native resolution as a TAA solution.

Note: Only supported when the Metal rendering driver is in use, which limits this scaling mode to macOS and iOS.

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_NEAREST = 5

Use nearest-neighbor filtering for the viewport's 3D buffer. This looks crisper than VIEWPORT_SCALING_3D_MODE_BILINEAR and has no additional rendering cost. The amount of scaling can be set using Viewport.scaling_3d_scale. Values greater than 1.0 are not supported and bilinear downsampling will be used instead. A value of 1.0 disables scaling.

Note: When using the Nearest scaling mode, to avoid uneven pixel scaling, it's highly recommended to use a value equal to an integer divisor with a dividend of 1. For example, it's best to use a scale of 0.5 (1/2), 0.3333 (1/3), 0.25 (1/4), 0.2 (1/5), and so on.

ViewportScaling3DMode VIEWPORT_SCALING_3D_MODE_MAX = 6

代表 ViewportScaling3DMode 列舉的大小。


enum ViewportUpdateMode: 🔗

ViewportUpdateMode VIEWPORT_UPDATE_DISABLED = 0

不要更新視口的算繪目標。

ViewportUpdateMode VIEWPORT_UPDATE_ONCE = 1

更新一次視口的算繪目標,然後切換到 VIEWPORT_UPDATE_DISABLED

ViewportUpdateMode VIEWPORT_UPDATE_WHEN_VISIBLE = 2

僅在算繪目標可見時更新視口的算繪目標。這是預設值。

ViewportUpdateMode VIEWPORT_UPDATE_WHEN_PARENT_VISIBLE = 3

僅在其父級可見時更新視口的算繪目標。

ViewportUpdateMode VIEWPORT_UPDATE_ALWAYS = 4

始終更新視口的算繪目標。


enum ViewportClearMode: 🔗

ViewportClearMode VIEWPORT_CLEAR_ALWAYS = 0

繪製前始終清除視口的算繪目標。

ViewportClearMode VIEWPORT_CLEAR_NEVER = 1

永不清除視口的算繪目標。

ViewportClearMode VIEWPORT_CLEAR_ONLY_NEXT_FRAME = 2

在下一影格清除視口的算繪目標,然後切換到 VIEWPORT_CLEAR_NEVER


enum ViewportEnvironmentMode: 🔗

ViewportEnvironmentMode VIEWPORT_ENVIRONMENT_DISABLED = 0

禁用在 2D 畫布上算繪 3D 環境。

ViewportEnvironmentMode VIEWPORT_ENVIRONMENT_ENABLED = 1

啟用在 2D 畫布上算繪 3D 環境。

ViewportEnvironmentMode VIEWPORT_ENVIRONMENT_INHERIT = 2

從父級繼承啟用/禁用值。如果最頂層的父級也被設定為 VIEWPORT_ENVIRONMENT_INHERIT,那麼與 VIEWPORT_ENVIRONMENT_ENABLED 的行為相同。

ViewportEnvironmentMode VIEWPORT_ENVIRONMENT_MAX = 3

代表 ViewportEnvironmentMode 列舉的大小。


enum ViewportSDFOversize: 🔗

ViewportSDFOversize VIEWPORT_SDF_OVERSIZE_100_PERCENT = 0

不使用過大的 2D 帶符號距離場。遮擋器可能在接觸視口邊緣時消失,GPUParticles3D 碰撞也可能比預期更早地停止工作。對 GPU 的要求最低。

ViewportSDFOversize VIEWPORT_SDF_OVERSIZE_120_PERCENT = 1

2D 帶符號距離場在每個方向(上、右、下、左)都覆蓋超出視口大小 20% 的範圍。

ViewportSDFOversize VIEWPORT_SDF_OVERSIZE_150_PERCENT = 2

2D 帶符號距離場在每個方向(上、右、下、左)都覆蓋超出視口大小 50% 的範圍。

ViewportSDFOversize VIEWPORT_SDF_OVERSIZE_200_PERCENT = 3

2D 帶符號距離場在每個方向(上、右、下、左)都覆蓋超出視口大小 100% 的範圍。對 GPU 的要求最高。

ViewportSDFOversize VIEWPORT_SDF_OVERSIZE_MAX = 4

代表 ViewportSDFOversize 列舉的大小。


enum ViewportSDFScale: 🔗

ViewportSDFScale VIEWPORT_SDF_SCALE_100_PERCENT = 0

全解析度 2D 帶符號距離場縮放。對 GPU 的要求最高。

ViewportSDFScale VIEWPORT_SDF_SCALE_50_PERCENT = 1

各軸半解析度 2D 帶符號距離場縮放(視口圖元數的 25%)。

ViewportSDFScale VIEWPORT_SDF_SCALE_25_PERCENT = 2

各軸四分之一解析度 2D 帶符號距離場縮放(視口圖元數的 6.25%)。對 GPU 的要求最低。

ViewportSDFScale VIEWPORT_SDF_SCALE_MAX = 3

代表 ViewportSDFScale 列舉的大小。


enum ViewportMSAA: 🔗

ViewportMSAA VIEWPORT_MSAA_DISABLED = 0

用於 3D 的多重取樣抗鋸齒被禁用。這是預設值,也是最快的設定。

ViewportMSAA VIEWPORT_MSAA_2X = 1

用於 3D 的多重取樣抗鋸齒,使用每個圖元 2 個樣本。這對性能有中等影響。

ViewportMSAA VIEWPORT_MSAA_4X = 2

用於 3D 的多重取樣抗鋸齒,使用每個圖元 4 個樣本。這對性能有較大影響。

ViewportMSAA VIEWPORT_MSAA_8X = 3

用於 3D 的多重取樣抗鋸齒,使用每個圖元 8 個樣本。這對性能有非常大的影響。可能在低端和較舊的硬體上不受支援。

ViewportMSAA VIEWPORT_MSAA_MAX = 4

代表 ViewportMSAA 列舉的大小。


enum ViewportAnisotropicFiltering: 🔗

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_DISABLED = 0

Anisotropic filtering is disabled.

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_2X = 1

Use 2× anisotropic filtering.

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_4X = 2

Use 4× anisotropic filtering. This is the default value.

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_8X = 3

Use 8× anisotropic filtering.

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_16X = 4

Use 16× anisotropic filtering.

ViewportAnisotropicFiltering VIEWPORT_ANISOTROPY_MAX = 5

Represents the size of the ViewportAnisotropicFiltering enum.


enum ViewportScreenSpaceAA: 🔗

ViewportScreenSpaceAA VIEWPORT_SCREEN_SPACE_AA_DISABLED = 0

不要在全屏後處理中執行抗鋸齒。

ViewportScreenSpaceAA VIEWPORT_SCREEN_SPACE_AA_FXAA = 1

使用快速近似抗鋸齒(Fast Approximate Anti-Aliasing)。FXAA 是一種流行的螢幕空間抗鋸齒方法,速度很快,但會讓圖像變模糊,使用較低解析度時尤為顯著。1440p 和 4K 等較高解析度下效果仍然不錯。

ViewportScreenSpaceAA VIEWPORT_SCREEN_SPACE_AA_SMAA = 2

Use subpixel morphological antialiasing. SMAA may produce clearer results than FXAA, but at a slightly higher performance cost.

ViewportScreenSpaceAA VIEWPORT_SCREEN_SPACE_AA_MAX = 3

代表 ViewportScreenSpaceAA 列舉的大小。


enum ViewportOcclusionCullingBuildQuality: 🔗

ViewportOcclusionCullingBuildQuality VIEWPORT_OCCLUSION_BUILD_QUALITY_LOW = 0

較低的遮擋剔除 BVH 建構品質(由 Embree 定義)。CPU 佔用最低,但剔除效率最低。

ViewportOcclusionCullingBuildQuality VIEWPORT_OCCLUSION_BUILD_QUALITY_MEDIUM = 1

中等的遮擋剔除 BVH 建構品質(由 Embree 定義)。

ViewportOcclusionCullingBuildQuality VIEWPORT_OCCLUSION_BUILD_QUALITY_HIGH = 2

較高的遮擋剔除 BVH 建構品質(由 Embree 定義)。CPU 佔用最高,但剔除效率最高。


enum ViewportRenderInfo: 🔗

ViewportRenderInfo VIEWPORT_RENDER_INFO_OBJECTS_IN_FRAME = 0

在單影格中繪製的物件的數量。

ViewportRenderInfo VIEWPORT_RENDER_INFO_PRIMITIVES_IN_FRAME = 1

在單影格中繪製的點、線、三角形的數量。

ViewportRenderInfo VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME = 2

此影格期間的繪製呼叫數。

ViewportRenderInfo VIEWPORT_RENDER_INFO_MAX = 3

代表 ViewportRenderInfo 列舉的大小。


enum ViewportRenderInfoType: 🔗

ViewportRenderInfoType VIEWPORT_RENDER_INFO_TYPE_VISIBLE = 0

可見算繪階段(不含陰影)。

ViewportRenderInfoType VIEWPORT_RENDER_INFO_TYPE_SHADOW = 1

陰影算繪階段。根據開啟了陰影的燈光數以及方向陰影的拆分數,同一個物件可能會算繪多次。

ViewportRenderInfoType VIEWPORT_RENDER_INFO_TYPE_CANVAS = 2

Canvas item rendering. This includes all 2D rendering.

ViewportRenderInfoType VIEWPORT_RENDER_INFO_TYPE_MAX = 3

代表 ViewportRenderInfoType 列舉的大小。


enum ViewportDebugDraw: 🔗

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_DISABLED = 0

除錯繪製被禁用。預設設定。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_UNSHADED = 1

顯示的物件沒有光照資訊。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_LIGHTING = 2

Objects are displayed with only light information.

Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_OVERDRAW = 3

Objects are displayed semi-transparent with additive blending so you can see where they are drawing over top of one another. A higher overdraw (represented by brighter colors) means you are wasting performance on drawing pixels that are being hidden behind others.

Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_WIREFRAME = 4

Debug draw draws objects in wireframe.

Note: set_debug_generate_wireframes() must be called before loading any meshes for wireframes to be visible when using the Compatibility renderer.

Note: In the Compatibility renderer, backfaces are always visible when using wireframe rendering. In the Forward+ and Mobile renderers, wireframes follow the material's backface culling properties instead.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_NORMAL_BUFFER = 5

繪製法線緩衝區而不是常規場景,因此可以看到將由後處理效果使用的每圖元法線。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_VOXEL_GI_ALBEDO = 6

Objects are displayed with only the albedo value from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_VOXEL_GI_LIGHTING = 7

Objects are displayed with only the lighting value from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_VOXEL_GI_EMISSION = 8

Objects are displayed with only the emission color from VoxelGIs. Requires at least one visible VoxelGI node that has been baked to have a visible effect.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SHADOW_ATLAS = 9

Viewport 的左上象限中繪製儲存來自 OmniLight3DSpotLight3D 的陰影的陰影合集。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_DIRECTIONAL_SHADOW_ATLAS = 10

繪製儲存 Viewport 左上象限中 DirectionalLight3D 陰影的陰影合集。

與陰影貼圖級聯相關的相機視錐體切片被疊加以可視化覆蓋範圍。每個切片的顏色與 VIEWPORT_DEBUG_DRAW_PSSM_SPLITS 使用的顏色相符。當混合陰影級聯時,繪製平截頭體切片時會考慮重疊。

最後一個級聯顯示所有平截頭體切片,以說明所有切片的覆蓋範圍。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SCENE_LUMINANCE = 11

Draws the estimated scene luminance. This is a 1×1 texture that is generated when autoexposure is enabled to control the scene's exposure.

Note: Only supported when using the Forward+ or Mobile rendering methods.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SSAO = 12

Draws the screen space ambient occlusion texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have Environment.ssao_enabled set in your WorldEnvironment.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SSIL = 13

Draws the screen space indirect lighting texture instead of the scene so that you can clearly see how it is affecting objects. In order for this display mode to work, you must have Environment.ssil_enabled set in your WorldEnvironment.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_PSSM_SPLITS = 14

Colors each PSSM split for the DirectionalLight3Ds in the scene a different color so you can see where the splits are. In order (from closest to furthest from the camera), they are colored red, green, blue, and yellow.

Note: When using this debug draw mode, custom shaders are ignored since all materials in the scene temporarily use a debug material. This means the result from custom shader functions (such as vertex displacement) won't be visible anymore when using this debug draw mode.

Note: Only supported when using the Forward+ or Mobile rendering methods.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_DECAL_ATLAS = 15

Draws the decal atlas that stores decal textures from Decals.

Note: Only supported when using the Forward+ or Mobile rendering methods.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SDFGI = 16

Draws SDFGI cascade data. This is the data structure that is used to bounce lighting against and create reflections.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_SDFGI_PROBES = 17

Draws SDFGI probe data. This is the data structure that is used to give indirect lighting dynamic objects moving within the scene.

When in the editor, left-clicking a probe will display additional bright dots that show its occlusion information. A white dot means the light is not occluded at all at the dot's position, while a red dot means the light is fully occluded. Intermediate values are possible.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_GI_BUFFER = 18

Draws the global illumination buffer from VoxelGI or SDFGI. Requires VoxelGI (at least one visible baked VoxelGI node) or SDFGI (Environment.sdfgi_enabled) to be enabled to have a visible effect.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_DISABLE_LOD = 19

禁用網格 LOD。所有網格都會使用完整細節繪製,可以用來比較性能。

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_CLUSTER_OMNI_LIGHTS = 20

Draws the OmniLight3D cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_CLUSTER_SPOT_LIGHTS = 21

Draws the SpotLight3D cluster. Clustering determines where lights are positioned in screen-space, which allows the engine to only process these portions of the screen for lighting.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_CLUSTER_DECALS = 22

Draws the Decal cluster. Clustering determines where decals are positioned in screen-space, which allows the engine to only process these portions of the screen for decals.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_CLUSTER_REFLECTION_PROBES = 23

Draws the ReflectionProbe cluster. Clustering determines where reflection probes are positioned in screen-space, which allows the engine to only process these portions of the screen for reflection probes.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_OCCLUDERS = 24

Draws the occlusion culling buffer. This low-resolution occlusion culling buffer is rasterized on the CPU and is used to check whether instances are occluded by other objects.

Note: Only supported when using the Forward+ or Mobile rendering methods.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_MOTION_VECTORS = 25

Draws the motion vectors buffer. This is used by temporal antialiasing to correct for motion that occurs during gameplay.

Note: Only supported when using the Forward+ rendering method.

ViewportDebugDraw VIEWPORT_DEBUG_DRAW_INTERNAL_BUFFER = 26

Internal buffer is drawn instead of regular scene so you can see the per-pixel output that will be used by post-processing effects.

Note: Only supported when using the Forward+ or Mobile rendering methods.


enum ViewportVRSMode: 🔗

ViewportVRSMode VIEWPORT_VRS_DISABLED = 0

可變速率著色已禁用。

ViewportVRSMode VIEWPORT_VRS_TEXTURE = 1

可變速率著色使用紋理。請注意,對於立體視覺,請使用為每個視圖提供紋理的紋理圖集。

ViewportVRSMode VIEWPORT_VRS_XR = 2

Variable rate shading texture is supplied by the primary XRInterface. Note that this may override the update mode.

ViewportVRSMode VIEWPORT_VRS_MAX = 3

代表 ViewportVRSMode 列舉的大小。


enum ViewportVRSUpdateMode: 🔗

ViewportVRSUpdateMode VIEWPORT_VRS_UPDATE_DISABLED = 0

The input texture for variable rate shading will not be processed.

ViewportVRSUpdateMode VIEWPORT_VRS_UPDATE_ONCE = 1

The input texture for variable rate shading will be processed once.

ViewportVRSUpdateMode VIEWPORT_VRS_UPDATE_ALWAYS = 2

The input texture for variable rate shading will be processed each frame.

ViewportVRSUpdateMode VIEWPORT_VRS_UPDATE_MAX = 3

Represents the size of the ViewportVRSUpdateMode enum.


enum SkyMode: 🔗

SkyMode SKY_MODE_AUTOMATIC = 0

根據天空著色器自動選擇合適的處理模式。如果著色器使用 TIMEPOSITION,則會使用 SKY_MODE_REALTIME。如果著色器使用任何 LIGHT_* 變數或任何自訂 uniform,則會使用 SKY_MODE_INCREMENTAL。否則預設為 SKY_MODE_QUALITY

SkyMode SKY_MODE_QUALITY = 1

使用高品質重要性取樣處理輻射度貼圖。得到的結果通常比 SKY_MODE_REALTIME 的品質更高,但需要花費更多的時間來生成。如果你計畫在運作時修改天空,則不應使用。如果你發現反射不夠模糊,出現了火花或者螢火蟲,請嘗試增大 ProjectSettings.rendering/reflections/sky_reflections/ggx_samples

SkyMode SKY_MODE_INCREMENTAL = 2

使用與 SKY_MODE_QUALITY 相同的高品質重要性取樣來處理輻射度貼圖,但更新會佔用若干影格。影格數由 ProjectSettings.rendering/reflections/sky_reflections/roughness_layers 決定。當需要最高品質的輻射度貼圖,但天空更新緩慢時,請使用該選項。

SkyMode SKY_MODE_REALTIME = 3

使用快速篩選演算法處理輻照度貼圖。一般來說,這會導致品質降低,但執行時間會大大加快。如果需要更好的品質,但仍需要每影格更新天空,請考慮開啟 ProjectSettings.rendering/reflections/sky_reflections/fast_filter_high_quality

注意:快速篩選演算法被限制為 256x256 立方體貼圖,因此 sky_set_radiance_size() 必須被設定為 256。否則會列印警告並忽略對輻照度大小的覆蓋。


enum CompositorEffectFlags: 🔗

CompositorEffectFlags COMPOSITOR_EFFECT_FLAG_ACCESS_RESOLVED_COLOR = 1

The rendering effect requires the color buffer to be resolved if MSAA is enabled.

CompositorEffectFlags COMPOSITOR_EFFECT_FLAG_ACCESS_RESOLVED_DEPTH = 2

The rendering effect requires the depth buffer to be resolved if MSAA is enabled.

CompositorEffectFlags COMPOSITOR_EFFECT_FLAG_NEEDS_MOTION_VECTORS = 4

The rendering effect requires motion vectors to be produced.

CompositorEffectFlags COMPOSITOR_EFFECT_FLAG_NEEDS_ROUGHNESS = 8

The rendering effect requires normals and roughness g-buffer to be produced (Forward+ only).

CompositorEffectFlags COMPOSITOR_EFFECT_FLAG_NEEDS_SEPARATE_SPECULAR = 16

The rendering effect requires specular data to be separated out (Forward+ only).


enum CompositorEffectCallbackType: 🔗

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_PRE_OPAQUE = 0

The callback is called before our opaque rendering pass, but after depth prepass (if applicable).

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_POST_OPAQUE = 1

The callback is called after our opaque rendering pass, but before our sky is rendered.

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_POST_SKY = 2

The callback is called after our sky is rendered, but before our back buffers are created (and if enabled, before subsurface scattering and/or screen space reflections).

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_PRE_TRANSPARENT = 3

The callback is called before our transparent rendering pass, but after our sky is rendered and we've created our back buffers.

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_POST_TRANSPARENT = 4

The callback is called after our transparent rendering pass, but before any built-in post-processing effects and output to our render target.

CompositorEffectCallbackType COMPOSITOR_EFFECT_CALLBACK_TYPE_ANY = -1

There is currently no description for this enum. Please help us by contributing one!


enum EnvironmentBG: 🔗

EnvironmentBG ENV_BG_CLEAR_COLOR = 0

用透明的顏色作為背景。

EnvironmentBG ENV_BG_COLOR = 1

使用指定的顏色作為背景。

EnvironmentBG ENV_BG_SKY = 2

使用天空資源作為背景。

EnvironmentBG ENV_BG_CANVAS = 3

使用一個指定的畫布層作為背景。這對在 3D 世界中產生實體一個 2D 場景很有用。

EnvironmentBG ENV_BG_KEEP = 4

不要清除背景,使用上一影格算繪的東西作為背景。

EnvironmentBG ENV_BG_CAMERA_FEED = 5

在背景中顯示相機源。

EnvironmentBG ENV_BG_MAX = 6

代表 EnvironmentBG 列舉的大小。


enum EnvironmentAmbientSource: 🔗

EnvironmentAmbientSource ENV_AMBIENT_SOURCE_BG = 0

從指定為背景的任何來源收集環境光。

EnvironmentAmbientSource ENV_AMBIENT_SOURCE_DISABLED = 1

禁用環境光。

EnvironmentAmbientSource ENV_AMBIENT_SOURCE_COLOR = 2

為環境光指定特定的 Color

EnvironmentAmbientSource ENV_AMBIENT_SOURCE_SKY = 3

無論背景如何,都從 Sky 收集環境光。


enum EnvironmentReflectionSource: 🔗

EnvironmentReflectionSource ENV_REFLECTION_SOURCE_BG = 0

使用背景進行反射。

EnvironmentReflectionSource ENV_REFLECTION_SOURCE_DISABLED = 1

禁用反射。

EnvironmentReflectionSource ENV_REFLECTION_SOURCE_SKY = 2

無論背景如何,都使用 Sky 進行反射。


enum EnvironmentGlowBlendMode: 🔗

EnvironmentGlowBlendMode ENV_GLOW_BLEND_MODE_ADDITIVE = 0

Adds the glow effect to the scene.

EnvironmentGlowBlendMode ENV_GLOW_BLEND_MODE_SCREEN = 1

Adds the glow effect to the scene after modifying the glow influence based on the scene value; dark values will be highly influenced by glow and bright values will not be influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. Environment.tonemap_white is used to determine the maximum scene value where the glow should have no influence. When Environment.tonemap_mode is set to Environment.TONE_MAPPER_LINEAR and Viewport.use_hdr_2d is true, the parent window's Window.get_output_max_linear_value() will be used as the maximum scene value.

EnvironmentGlowBlendMode ENV_GLOW_BLEND_MODE_SOFTLIGHT = 2

Adds the glow effect to the tonemapped image after modifying the glow influence based on the image value; dark values and bright values will not be influenced by glow and mid-range values will be highly influenced by glow. This approach avoids bright values becoming overly bright from the glow effect. The glow will have the largest influence on image values of 0.25 and will have no influence when applied to image values greater than 1.0.

Note: This blend mode does not support HDR output because expects a maximum output value of 1.0. It is recommended to use a different blend mode when rendering to an HDR screen.

EnvironmentGlowBlendMode ENV_GLOW_BLEND_MODE_REPLACE = 3

Replaces all pixels' color by the glow effect. This can be used to simulate a full-screen blur effect by tweaking the glow parameters to match the original image's brightness or to preview glow configuration in the editor.

EnvironmentGlowBlendMode ENV_GLOW_BLEND_MODE_MIX = 4

Mixes the glow image with the scene image. Best used with Environment.glow_bloom to avoid darkening the scene.


enum EnvironmentFogMode: 🔗

EnvironmentFogMode ENV_FOG_MODE_EXPONENTIAL = 0

Use a physically-based fog model defined primarily by fog density.

EnvironmentFogMode ENV_FOG_MODE_DEPTH = 1

Use a simple fog model defined by start and end positions and a custom curve. While not physically accurate, this model can be useful when you need more artistic control.


enum EnvironmentToneMapper: 🔗

EnvironmentToneMapper ENV_TONE_MAPPER_LINEAR = 0

Does not modify color data, resulting in a linear tonemapping curve which unnaturally clips bright values, causing bright lighting to look blown out. The simplest and fastest tonemapper.

EnvironmentToneMapper ENV_TONE_MAPPER_REINHARD = 1

A simple tonemapping curve that rolls off bright values to prevent clipping. This results in an image that can appear dull and low contrast. Slower than ENV_TONE_MAPPER_LINEAR.

Note: When Environment.tonemap_white is left at the default value of 1.0, ENV_TONE_MAPPER_REINHARD produces an identical image to ENV_TONE_MAPPER_LINEAR.

EnvironmentToneMapper ENV_TONE_MAPPER_FILMIC = 2

Uses a film-like tonemapping curve to prevent clipping of bright values and provide better contrast than ENV_TONE_MAPPER_REINHARD. Slightly slower than ENV_TONE_MAPPER_REINHARD.

Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.

EnvironmentToneMapper ENV_TONE_MAPPER_ACES = 3

Uses a high-contrast film-like tonemapping curve and desaturates bright values for a more realistic appearance. Slightly slower than ENV_TONE_MAPPER_FILMIC.

Note: This tonemapping operator is called "ACES Fitted" in Godot 3.x.

Note: This tonemapper does not support HDR output because it produces output in the SDR range. It is recommended to use a different tonemapper when rendering to an HDR screen.

EnvironmentToneMapper ENV_TONE_MAPPER_AGX = 4

Uses an adjustable film-like tonemapping curve and desaturates bright values for a more realistic appearance. Better than other tonemappers at maintaining the hue of colors as they become brighter. The slowest tonemapping option.


enum EnvironmentSSRRoughnessQuality: 🔗

EnvironmentSSRRoughnessQuality ENV_SSR_ROUGHNESS_QUALITY_DISABLED = 0

用於螢幕空間反射的最低品質粗糙度篩選。與光滑(非粗糙)材質相比,粗糙材質不會有更模糊的螢幕空間反射。這是最快的選項。

EnvironmentSSRRoughnessQuality ENV_SSR_ROUGHNESS_QUALITY_LOW = 1

螢幕空間反射的較低品質粗糙度篩檢程式。

EnvironmentSSRRoughnessQuality ENV_SSR_ROUGHNESS_QUALITY_MEDIUM = 2

螢幕空間反射的中等品質粗糙度篩檢程式。

EnvironmentSSRRoughnessQuality ENV_SSR_ROUGHNESS_QUALITY_HIGH = 3

螢幕空間反射的較高品質粗糙度篩檢程式。這是最慢的選項。


enum EnvironmentSSAOQuality: 🔗

EnvironmentSSAOQuality ENV_SSAO_QUALITY_VERY_LOW = 0

最低品質的螢幕空間環境光遮蔽。

EnvironmentSSAOQuality ENV_SSAO_QUALITY_LOW = 1

低品質的螢幕空間環境光遮蔽。

EnvironmentSSAOQuality ENV_SSAO_QUALITY_MEDIUM = 2

中等品質的螢幕空間環境光遮蔽。

EnvironmentSSAOQuality ENV_SSAO_QUALITY_HIGH = 3

高品質的螢幕空間環境光遮蔽。

EnvironmentSSAOQuality ENV_SSAO_QUALITY_ULTRA = 4

最高品質的螢幕空間環境光遮蔽。使用可動態調整的自我調整目標設定,以平滑地平衡性能和視覺品質。


enum EnvironmentSSILQuality: 🔗

EnvironmentSSILQuality ENV_SSIL_QUALITY_VERY_LOW = 0

最低品質的螢幕空間間接光照。

EnvironmentSSILQuality ENV_SSIL_QUALITY_LOW = 1

較低品質的螢幕空間間接光照。

EnvironmentSSILQuality ENV_SSIL_QUALITY_MEDIUM = 2

較高品質的螢幕空間間接光照。

EnvironmentSSILQuality ENV_SSIL_QUALITY_HIGH = 3

較高品質的螢幕空間間接光照。

EnvironmentSSILQuality ENV_SSIL_QUALITY_ULTRA = 4

最高品質的螢幕空間間接光照。使用可動態調整的自我調整目標設定,以平滑地平衡性能和視覺品質。


enum EnvironmentSDFGIYScale: 🔗

EnvironmentSDFGIYScale ENV_SDFGI_Y_SCALE_50_PERCENT = 0

在 Y(垂直)軸上對 SDFGI 使用 50% 的縮放。SDFGI 儲存格將比它們的寬度短兩倍。這允許提供更多的 GI 細節,並減少薄地板和天花板的漏光。這通常是垂直度不高的場景的最佳選擇。

EnvironmentSDFGIYScale ENV_SDFGI_Y_SCALE_75_PERCENT = 1

在 Y(垂直)軸上為 SDFGI 使用 75% 的縮放。這是 50% 和 100% SDFGI Y 縮放之間的平衡。

EnvironmentSDFGIYScale ENV_SDFGI_Y_SCALE_100_PERCENT = 2

在 Y(垂直)軸上為 SDFGI 使用 100% 的縮放。SDFGI 儲存格將與寬度一樣高。這通常是高度垂直場景的最佳選擇。不利之處在於,薄地板和天花板可能會導致漏光更加明顯。


enum EnvironmentSDFGIRayCount: 🔗

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_4 = 0

聚合 SDFGI 時每影格發出 4 條光線。對 GPU 的要求最低,但結果中噪點最多。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_8 = 1

聚合 SDFGI 時每影格發出 8 條光線。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_16 = 2

聚合 SDFGI 時每影格發出 16 條光線。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_32 = 3

聚合 SDFGI 時每影格發出 32 條光線。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_64 = 4

聚合 SDFGI 時每影格發出 64 條光線。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_96 = 5

聚合 SDFGI 時每影格發出 96 條光線。對 GPU 的要求較高。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_128 = 6

聚合 SDFGI 時每影格發出 128 條光線。對 GPU 的要求非常高,但結果中噪點最少。

EnvironmentSDFGIRayCount ENV_SDFGI_RAY_COUNT_MAX = 7

代表 EnvironmentSDFGIRayCount 列舉的大小。


enum EnvironmentSDFGIFramesToConverge: 🔗

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_5_FRAMES = 0

通過 5 影格聚合 SDFGI。回應最快,但光線數量一定時,結果中噪點最多。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_10_FRAMES = 1

讓 SDFGI 通過 10 影格完成聚合。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_15_FRAMES = 2

讓 SDFGI 通過 15 影格完成聚合。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_20_FRAMES = 3

讓 SDFGI 通過 20 影格完成聚合。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_25_FRAMES = 4

讓 SDFGI 通過 25 影格完成聚合。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_IN_30_FRAMES = 5

讓 SDFGI 通過 30 影格完成聚合。回應最慢,但光線數量一定時,結果中噪點最少。

EnvironmentSDFGIFramesToConverge ENV_SDFGI_CONVERGE_MAX = 6

代表 EnvironmentSDFGIFramesToConverge 列舉的大小。


enum EnvironmentSDFGIFramesToUpdateLight: 🔗

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_IN_1_FRAME = 0

通過 1 影格更新 SDFGI 中動態燈光的間接光照。回應最快,但對 GPU 的要求最高。

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_IN_2_FRAMES = 1

通過 2 影格更新 SDFGI 中動態燈光的間接光照。

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_IN_4_FRAMES = 2

通過 4 影格更新 SDFGI 中動態燈光的間接光照。

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_IN_8_FRAMES = 3

通過 8 影格更新 SDFGI 中動態燈光的間接光照。

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_IN_16_FRAMES = 4

通過 16 影格更新 SDFGI 中動態燈光的間接光照。回應最慢,但對 GPU 的要求最低。

EnvironmentSDFGIFramesToUpdateLight ENV_SDFGI_UPDATE_LIGHT_MAX = 5

代表 EnvironmentSDFGIFramesToUpdateLight 列舉的大小。


enum SubSurfaceScatteringQuality: 🔗

SubSurfaceScatteringQuality SUB_SURFACE_SCATTERING_QUALITY_DISABLED = 0

完全禁用次表面散射,即便材質的 BaseMaterial3D.subsurf_scatter_enabledtrue。對 GPU 的要求最低。

SubSurfaceScatteringQuality SUB_SURFACE_SCATTERING_QUALITY_LOW = 1

較低品質的次表面散射。

SubSurfaceScatteringQuality SUB_SURFACE_SCATTERING_QUALITY_MEDIUM = 2

中等品質的次表面散射。

SubSurfaceScatteringQuality SUB_SURFACE_SCATTERING_QUALITY_HIGH = 3

較高品質的次表面散射。對 GPU 的要求最高。


enum DOFBokehShape: 🔗

DOFBokehShape DOF_BOKEH_BOX = 0

使用一個盒式篩選計算 DOF 模糊。最快的選項,但會在模糊圖案中產生明顯的線條。

DOFBokehShape DOF_BOKEH_HEXAGON = 1

使用一個六邊形篩選計算 DOF 模糊。

DOFBokehShape DOF_BOKEH_CIRCLE = 2

使用一個圓形篩選計算 DOF 模糊。最好的品質和最真實的,但最慢的。僅用於可以將大量性能專用於後期處理的區域(例如過場動畫)。


enum DOFBlurQuality: 🔗

DOFBlurQuality DOF_BLUR_QUALITY_VERY_LOW = 0

最低品質的 DOF 模糊。這是最快的設定,但你可能會看到不自然的篩選。

DOFBlurQuality DOF_BLUR_QUALITY_LOW = 1

較低品質的 DOF 模糊。

DOFBlurQuality DOF_BLUR_QUALITY_MEDIUM = 2

中等品質的 DOF 模糊。

DOFBlurQuality DOF_BLUR_QUALITY_HIGH = 3

最高品質的 DOF 模糊。通過採集最多的樣本,產生最平滑的模糊效果,但速度也明顯變慢。


enum InstanceType: 🔗

InstanceType INSTANCE_NONE = 0

實例沒有型別。

InstanceType INSTANCE_MESH = 1

該實例是網格。

InstanceType INSTANCE_MULTIMESH = 2

該實例是一個 multimesh。

InstanceType INSTANCE_PARTICLES = 3

該實例是粒子發射器。

InstanceType INSTANCE_PARTICLES_COLLISION = 4

該實例是 GPUParticles 碰撞形狀。

InstanceType INSTANCE_LIGHT = 5

該實例是燈。

InstanceType INSTANCE_REFLECTION_PROBE = 6

該實例是反射探查。

InstanceType INSTANCE_DECAL = 7

該實例是裝飾。

InstanceType INSTANCE_VOXEL_GI = 8

該實例是 VoxelGI。

InstanceType INSTANCE_LIGHTMAP = 9

該實例是光照貼圖。

InstanceType INSTANCE_OCCLUDER = 10

該實例是遮擋剔除遮擋器。

InstanceType INSTANCE_VISIBLITY_NOTIFIER = 11

該實例是螢幕可見通知器。

InstanceType INSTANCE_FOG_VOLUME = 12

該實例是霧體積。

InstanceType INSTANCE_MAX = 13

代表 InstanceType 列舉的大小。

InstanceType INSTANCE_GEOMETRY_MASK = 14

幾何體實例(網格、多網格、即時和粒子)的旗標的組合。


enum InstanceFlags: 🔗

InstanceFlags INSTANCE_FLAG_USE_BAKED_LIGHT = 0

允許在烘焙照明中使用實例。

InstanceFlags INSTANCE_FLAG_USE_DYNAMIC_GI = 1

允許在動態全域光照中使用該實例。

InstanceFlags INSTANCE_FLAG_DRAW_NEXT_FRAME_IF_VISIBLE = 2

當設定時,手動請求在下一影格繪製幾何圖形。

InstanceFlags INSTANCE_FLAG_IGNORE_OCCLUSION_CULLING = 3

始終繪製,即便實例能夠被遮擋剔除剔除。不影響視錐剔除。

InstanceFlags INSTANCE_FLAG_MAX = 4

代表 InstanceFlags 列舉的大小。


enum ShadowCastingSetting: 🔗

ShadowCastingSetting SHADOW_CASTING_SETTING_OFF = 0

禁用這個實例的陰影。

ShadowCastingSetting SHADOW_CASTING_SETTING_ON = 1

從此實例投下陰影。

ShadowCastingSetting SHADOW_CASTING_SETTING_DOUBLE_SIDED = 2

在算繪物件的陰影時禁用背面剔除。這會稍微慢一些,但可能會產生更正確的陰影。

ShadowCastingSetting SHADOW_CASTING_SETTING_SHADOWS_ONLY = 3

僅算繪物件的陰影。物件本身不會被繪製。


enum VisibilityRangeFadeMode: 🔗

VisibilityRangeFadeMode VISIBILITY_RANGE_FADE_DISABLED = 0

禁用給定實例的可見性範圍淡出。

VisibilityRangeFadeMode VISIBILITY_RANGE_FADE_SELF = 1

當給定實例接近其可見範圍限制時淡出該給定實例。

VisibilityRangeFadeMode VISIBILITY_RANGE_FADE_DEPENDENCIES = 2

當達到其可見性範圍限制時淡入給定實例的依賴項。


enum BakeChannels: 🔗

BakeChannels BAKE_CHANNEL_ALBEDO_ALPHA = 0

bake_render_uv2() 返回的 Image 陣列中 Image 的索引。圖像使用 Image.FORMAT_RGBA8 格式,並在 .rgb 通道中包含反照率顏色,在 .a 通道中包含 Alpha。

BakeChannels BAKE_CHANNEL_NORMAL = 1

bake_render_uv2() 返回的 Image 陣列中 Image 的索引。圖像使用 Image.FORMAT_RGBA8 格式,並在 .rgb 通道中包含該物件的每圖元法線,在 .a 通道中不包含任何內容。每圖元法線被編碼為 normal * 0.5 + 0.5

BakeChannels BAKE_CHANNEL_ORM = 2

bake_render_uv2() 返回的 Image 陣列中 Image 的索引。圖像使用 Image.FORMAT_RGBA8 格式,並在 .r 通道中包含環境光遮擋(僅來自材質和裝飾),在 .g 通道中包含粗糙度,在 .b 通道中包含金屬度,並且中 .a 通道中包含次表面散射量。

BakeChannels BAKE_CHANNEL_EMISSION = 3

bake_render_uv2() 返回的 Image 陣列中 Image 的索引。圖像使用 Image.FORMAT_RGBAH 格式,並在 .rgb 通道中包含自發光顏色,在 .a 通道中不包含任何內容。


enum CanvasTextureChannel: 🔗

CanvasTextureChannel CANVAS_TEXTURE_CHANNEL_DIFFUSE = 0

漫反射畫布紋理(CanvasTexture.diffuse_texture)。

CanvasTextureChannel CANVAS_TEXTURE_CHANNEL_NORMAL = 1

法線貼圖畫布紋理(CanvasTexture.normal_texture)。

CanvasTextureChannel CANVAS_TEXTURE_CHANNEL_SPECULAR = 2

高光貼圖畫布紋理(CanvasTexture.specular_texture)。


enum NinePatchAxisMode: 🔗

NinePatchAxisMode NINE_PATCH_STRETCH = 0

九宮格在需要的地方被拉伸。

NinePatchAxisMode NINE_PATCH_TILE = 1

九宮格在需要的地方填充圖塊。

NinePatchAxisMode NINE_PATCH_TILE_FIT = 2

九宮格在需要的地方填充圖塊,並在需要時將它們拉伸一點。


enum CanvasItemTextureFilter: 🔗

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_DEFAULT = 0

Viewport 使用預設篩選模式。

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_NEAREST = 1

紋理僅取最鄰近像素,近看呈現馬賽克,遠處因未取樣 mipmap 而顯得顆粒。

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_LINEAR = 2

紋理在最鄰近 4 像素間插值,近看平滑,遠處因未取樣 mipmap 仍顆粒。

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS = 3

The texture filter reads from the nearest pixel and blends between the nearest 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true). This makes the texture look pixelated from up close, and smooth from a distance.

Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS = 4

The texture filter blends between the nearest 4 pixels and between the nearest 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true). This makes the texture look smooth from up close, and smooth from a distance.

Use this for non-pixel art textures that may be viewed at a low scale (e.g. due to Camera2D zoom or sprite scaling), as mipmaps are important to smooth out pixels that are smaller than on-screen pixels.

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC = 5

The texture filter reads from the nearest pixel and blends between 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true) based on the angle between the surface and the camera view. This makes the texture look pixelated from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

Note: This texture filter is rarely useful in 2D projects. CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS is usually more appropriate in this case.

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC = 6

The texture filter blends between the nearest 4 pixels and blends between 2 mipmaps (or uses the nearest mipmap if ProjectSettings.rendering/textures/default_filters/use_nearest_mipmap_filter is true) based on the angle between the surface and the camera view. This makes the texture look smooth from up close, and smooth from a distance. Anisotropic filtering improves texture quality on surfaces that are almost in line with the camera, but is slightly slower. The anisotropic filtering level can be changed by adjusting ProjectSettings.rendering/textures/default_filters/anisotropic_filtering_level.

Note: This texture filter is rarely useful in 2D projects. CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS is usually more appropriate in this case.

CanvasItemTextureFilter CANVAS_ITEM_TEXTURE_FILTER_MAX = 7

CanvasItemTextureFilter 列舉的最大值。


enum CanvasItemTextureRepeat: 🔗

CanvasItemTextureRepeat CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT = 0

Viewport 使用預設重複模式。

CanvasItemTextureRepeat CANVAS_ITEM_TEXTURE_REPEAT_DISABLED = 1

禁用紋理重複。相反,當讀取 0-1 範圍之外的 UV 時,該值將被鉗制在紋理的邊緣,從而導致紋理的邊界看起來被拉長。

CanvasItemTextureRepeat CANVAS_ITEM_TEXTURE_REPEAT_ENABLED = 2

當 UV 超出 0–1 時允許紋理重複。如果使用線性過濾模式,取樣器跨越紋理邊界時可能在邊緣產生偽影。

CanvasItemTextureRepeat CANVAS_ITEM_TEXTURE_REPEAT_MIRROR = 3

重複時翻轉該紋理,使邊緣對齊而不是突然改變。

CanvasItemTextureRepeat CANVAS_ITEM_TEXTURE_REPEAT_MAX = 4

CanvasItemTextureRepeat 列舉的最大值。


enum CanvasGroupMode: 🔗

CanvasGroupMode CANVAS_GROUP_MODE_DISABLED = 0

子級繪製在父級之上,不會被裁剪。

CanvasGroupMode CANVAS_GROUP_MODE_CLIP_ONLY = 1

父級僅用於裁剪目的。子級被裁剪到父級的可見區域,不繪製父級。

CanvasGroupMode CANVAS_GROUP_MODE_CLIP_AND_DRAW = 2

父級用於裁剪子級,但在將子級剪裁到其可見區域之前,父級也像往常一樣繪製在子級下方。

CanvasGroupMode CANVAS_GROUP_MODE_TRANSPARENT = 3

There is currently no description for this enum. Please help us by contributing one!


enum CanvasLightMode: 🔗

CanvasLightMode CANVAS_LIGHT_MODE_POINT = 0

2D 點光(見 PointLight2D)。

CanvasLightMode CANVAS_LIGHT_MODE_DIRECTIONAL = 1

2D 方向(日月)光(見 DirectionalLight2D)。


enum CanvasLightBlendMode: 🔗

CanvasLightBlendMode CANVAS_LIGHT_BLEND_MODE_ADD = 0

向畫布新增淺色。

CanvasLightBlendMode CANVAS_LIGHT_BLEND_MODE_SUB = 1

從畫布中減去淺色。

CanvasLightBlendMode CANVAS_LIGHT_BLEND_MODE_MIX = 2

燈光根據透明度增加顏色。


enum CanvasLightShadowFilter: 🔗

CanvasLightShadowFilter CANVAS_LIGHT_FILTER_NONE = 0

不要對畫布上的光影套用濾鏡。

CanvasLightShadowFilter CANVAS_LIGHT_FILTER_PCF5 = 1

使用 PCF5 篩選法來篩選畫布的光影。

CanvasLightShadowFilter CANVAS_LIGHT_FILTER_PCF13 = 2

使用 PCF13 篩選法來篩選畫布的光影。

CanvasLightShadowFilter CANVAS_LIGHT_FILTER_MAX = 3

CanvasLightShadowFilter 列舉的最大值。


enum CanvasOccluderPolygonCullMode: 🔗

CanvasOccluderPolygonCullMode CANVAS_OCCLUDER_POLYGON_CULL_DISABLED = 0

禁用畫布遮擋物的剔除。

CanvasOccluderPolygonCullMode CANVAS_OCCLUDER_POLYGON_CULL_CLOCKWISE = 1

畫布遮擋器的剔除是順時針的。

CanvasOccluderPolygonCullMode CANVAS_OCCLUDER_POLYGON_CULL_COUNTER_CLOCKWISE = 2

畫布遮擋物的剔除是逆時針的。


enum GlobalShaderParameterType: 🔗

GlobalShaderParameterType GLOBAL_VAR_TYPE_BOOL = 0

布林型全域著色器參數(global uniform bool ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_BVEC2 = 1

二維布林向量全域著色器參數(global uniform bvec2 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_BVEC3 = 2

三維布林向量全域著色器參數(global uniform bvec3 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_BVEC4 = 3

四維布林向量全域著色器參數(global uniform bvec4 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_INT = 4

整數全域著色器參數(global uniform int ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_IVEC2 = 5

二維整數向量全域著色器參數(global uniform ivec2 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_IVEC3 = 6

三維整數向量全域著色器參數(global uniform ivec3 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_IVEC4 = 7

四維整數向量全域著色器參數(global uniform ivec4 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_RECT2I = 8

二維整數矩形全域著色器參數(global uniform ivec4 ...)。等價於著色器程式碼中的 GLOBAL_VAR_TYPE_IVEC4,但在編輯器 UI 中以 Rect2i 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_UINT = 9

不帶正負號的整數全域著色器參數(global uniform uint ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_UVEC2 = 10

二維不帶正負號的整數向量全域著色器參數(global uniform uvec2 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_UVEC3 = 11

三維不帶正負號的整數向量全域著色器參數(global uniform uvec3 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_UVEC4 = 12

四維不帶正負號的整數向量全域著色器參數(global uniform uvec4 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_FLOAT = 13

單精確度浮點數全域著色器參數(global uniform float ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_VEC2 = 14

二維單精確度浮點數向量全域著色器參數(global uniform vec2 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_VEC3 = 15

三維單精確度浮點數向量全域著色器參數(global uniform vec3 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_VEC4 = 16

四維單精確度浮點數向量全域著色器參數(global uniform vec4 ...)。

GlobalShaderParameterType GLOBAL_VAR_TYPE_COLOR = 17

顏色全域著色器參數(global uniform vec4 ...)。等價於著色器程式碼中的 GLOBAL_VAR_TYPE_VEC4,但在編輯器 UI 中以 Color 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_RECT2 = 18

二維浮點數矩形全域著色器參數(global uniform vec4 ...)。等價於著色器程式碼中的 GLOBAL_VAR_TYPE_VEC4,但在編輯器 UI 中以 Rect2 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_MAT2 = 19

2×2 矩陣全域著色器參數(global uniform mat2 ...)。編輯器 UI 中以 PackedInt32Array 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_MAT3 = 20

3×3 矩陣全域著色器參數(global uniform mat3 ...)。編輯器 UI 中以 Basis 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_MAT4 = 21

4×4 矩陣全域著色器參數(global uniform mat4 ...)。編輯器 UI 中以 Projection 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_TRANSFORM_2D = 22

二維變換全域著色器參數(global uniform mat2x3 ...)。編輯器 UI 中以 Transform2D 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_TRANSFORM = 23

三維變換全域著色器參數(global uniform mat3x4 ...)。編輯器 UI 中以 Transform3D 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_SAMPLER2D = 24

2D 取樣器全域著色器參數(global uniform sampler2D ...)。編輯器 UI 中以 Texture2D 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_SAMPLER2DARRAY = 25

2D 取樣器陣列全域著色器參數(global uniform sampler2DArray ...)。編輯器 UI 中以 Texture2DArray 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_SAMPLER3D = 26

3D 取樣器全域著色器參數(global uniform sampler3D ...)。編輯器 UI 中以 Texture3D 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_SAMPLERCUBE = 27

立方體貼圖全域著色器參數(global uniform samplerCube ...)。編輯器 UI 中以 Cubemap 的形式暴露。

GlobalShaderParameterType GLOBAL_VAR_TYPE_SAMPLEREXT = 28

External sampler global shader parameter (global uniform samplerExternalOES ...). Exposed as an ExternalTexture in the editor UI.

GlobalShaderParameterType GLOBAL_VAR_TYPE_MAX = 29

代表 GlobalShaderParameterType 列舉的大小。


enum RenderingInfo: 🔗

RenderingInfo RENDERING_INFO_TOTAL_OBJECTS_IN_FRAME = 0

在目前 3D 場景中算繪的物件數。會根據相機的位置和旋轉的不同而不同。

RenderingInfo RENDERING_INFO_TOTAL_PRIMITIVES_IN_FRAME = 1

在目前 3D 場景中算繪的點、線、三角的數量。會根據相機的位置和旋轉的不同而不同。

RenderingInfo RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME = 2

在目前 3D 場景中算繪執行的繪製呼叫的數量。會根據相機的位置和旋轉的不同而不同。

RenderingInfo RENDERING_INFO_TEXTURE_MEM_USED = 3

紋理記憶體的使用量(單位為位元組)。

RenderingInfo RENDERING_INFO_BUFFER_MEM_USED = 4

緩衝記憶體的使用量(單位為位元組)。包括頂點資料、uniform 緩衝以及內部使用的各種不同緩衝型別。

RenderingInfo RENDERING_INFO_VIDEO_MEM_USED = 5

Video memory used (in bytes). When using the Forward+ or Mobile renderers, this is always greater than the sum of RENDERING_INFO_TEXTURE_MEM_USED and RENDERING_INFO_BUFFER_MEM_USED, since there is miscellaneous data not accounted for by those two metrics. When using the Compatibility renderer, this is equal to the sum of RENDERING_INFO_TEXTURE_MEM_USED and RENDERING_INFO_BUFFER_MEM_USED.

RenderingInfo RENDERING_INFO_PIPELINE_COMPILATIONS_CANVAS = 6

Number of pipeline compilations that were triggered by the 2D canvas renderer.

RenderingInfo RENDERING_INFO_PIPELINE_COMPILATIONS_MESH = 7

Number of pipeline compilations that were triggered by loading meshes. These compilations will show up as longer loading times the first time a user runs the game and the pipeline is required.

RenderingInfo RENDERING_INFO_PIPELINE_COMPILATIONS_SURFACE = 8

Number of pipeline compilations that were triggered by building the surface cache before rendering the scene. These compilations will show up as a stutter when loading a scene the first time a user runs the game and the pipeline is required.

RenderingInfo RENDERING_INFO_PIPELINE_COMPILATIONS_DRAW = 9

Number of pipeline compilations that were triggered while drawing the scene. These compilations will show up as stutters during gameplay the first time a user runs the game and the pipeline is required.

RenderingInfo RENDERING_INFO_PIPELINE_COMPILATIONS_SPECIALIZATION = 10

Number of pipeline compilations that were triggered to optimize the current scene. These compilations are done in the background and should not cause any stutters whatsoever.


enum PipelineSource: 🔗

PipelineSource PIPELINE_SOURCE_CANVAS = 0

Pipeline compilation that was triggered by the 2D canvas renderer.

PipelineSource PIPELINE_SOURCE_MESH = 1

Pipeline compilation that was triggered by loading a mesh.

PipelineSource PIPELINE_SOURCE_SURFACE = 2

Pipeline compilation that was triggered by building the surface cache before rendering the scene.

PipelineSource PIPELINE_SOURCE_DRAW = 3

Pipeline compilation that was triggered while drawing the scene.

PipelineSource PIPELINE_SOURCE_SPECIALIZATION = 4

Pipeline compilation that was triggered to optimize the current scene.

PipelineSource PIPELINE_SOURCE_MAX = 5

Represents the size of the PipelineSource enum.


enum SplashStretchMode: 🔗

SplashStretchMode SPLASH_STRETCH_MODE_DISABLED = 0

No stretching is applied.

SplashStretchMode SPLASH_STRETCH_MODE_KEEP = 1

Stretches image to fullscreen while preserving aspect ratio.

SplashStretchMode SPLASH_STRETCH_MODE_KEEP_WIDTH = 2

Stretches the height of the image based on the width of the screen.

SplashStretchMode SPLASH_STRETCH_MODE_KEEP_HEIGHT = 3

Stretches the width of the image based on the height of the screen.

SplashStretchMode SPLASH_STRETCH_MODE_COVER = 4

Stretches the image to cover the entire screen while preserving aspect ratio.

SplashStretchMode SPLASH_STRETCH_MODE_IGNORE = 5

Stretches the image to cover the entire screen but doesn't preserve aspect ratio.


enum Features: 🔗

Features FEATURE_SHADERS = 0

已棄用: This constant has not been used since Godot 3.0.

Features FEATURE_MULTITHREADED = 1

已棄用: This constant has not been used since Godot 3.0.


常數

NO_INDEX_ARRAY = -1 🔗

標記一個錯誤,表明索引陣列為空。

ARRAY_WEIGHTS_SIZE = 4 🔗

每個頂點的權重/骨骼數。

CANVAS_ITEM_Z_MIN = -4096 🔗

畫布專案的最小 Z 層。

CANVAS_ITEM_Z_MAX = 4096 🔗

帆布專案的最大 Z 層。

CANVAS_LAYER_MIN = -2147483648 🔗

The minimum canvas layer.

CANVAS_LAYER_MAX = 2147483647 🔗

The maximum canvas layer.

MAX_GLOW_LEVELS = 7 🔗

輝光後期處理效果使用的最大輝光級別數。

MAX_CURSORS = 8 🔗

已棄用: This constant is not used by the engine.

MAX_2D_DIRECTIONAL_LIGHTS = 8 🔗

2D 中同一時間能夠算繪的最大方向光的數量。

MAX_MESH_SURFACES = 256 🔗

The maximum number of surfaces a mesh can have.

MATERIAL_RENDER_PRIORITY_MIN = -128 🔗

所有材質的最小算繪優先順序。

MATERIAL_RENDER_PRIORITY_MAX = 127 🔗

所有材質的最大算繪優先順序。

ARRAY_CUSTOM_COUNT = 4 🔗

可用自訂資料陣列的數量(ARRAY_CUSTOM0ARRAY_CUSTOM1ARRAY_CUSTOM2ARRAY_CUSTOM3)。

PARTICLES_EMIT_FLAG_POSITION = 1 🔗

粒子在指定位置開始。

PARTICLES_EMIT_FLAG_ROTATION_SCALE = 2 🔗

粒子以指定的旋轉和縮放開始。

PARTICLES_EMIT_FLAG_VELOCITY = 4 🔗

粒子從指定的速度向量開始,該向量定義了發射方向和速度。

PARTICLES_EMIT_FLAG_COLOR = 8 🔗

粒子以指定的顏色開始。

PARTICLES_EMIT_FLAG_CUSTOM = 16 🔗

粒子以指定的 CUSTOM 資料開始。


屬性說明

bool render_loop_enabled 🔗

  • void set_render_loop_enabled(value: bool)

  • bool is_render_loop_enabled()

如果為 false,則完全禁用算繪,但引擎邏輯仍在處理中。即使禁用算繪,你也可以呼叫 force_draw() 來繪製影格。


方法說明

RID area_light_create() 🔗

Creates a new area light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most light_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

To place in a scene, attach this area light to an instance using instance_set_base() using the returned RID.

Note: The equivalent node is AreaLight3D.


Array[Image] bake_render_uv2(base: RID, material_overrides: Array[RID], image_size: Vector2i) 🔗

使用可選的 material_overrides,將 base 參數中傳遞的 Mesh 的材質資料,烘焙為一組大小為 image_sizeImage。返回包含 BakeChannels 中指定的材質屬性的 Image 陣列。


void call_on_render_thread(callable: Callable) 🔗

As the RenderingServer actual logic may run on a separate thread, accessing its internals from the main (or any other) thread will result in errors. To make it easier to run code that can safely access the rendering internals (such as RenderingDevice and similar RD classes), push a callable via this function so it will be executed on the render thread.


RID camera_attributes_create() 🔗

建立相機屬性物件並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 camera_attributes_ RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 CameraAttributes


void camera_attributes_set_auto_exposure(camera_attributes: RID, enable: bool, min_sensitivity: float, max_sensitivity: float, speed: float, scale: float) 🔗

設定用於自動曝光效果的參數。這些參數與 CameraAttributesCameraAttributesPractical 中的對應參數具有相同的含義。


void camera_attributes_set_dof_blur(camera_attributes: RID, far_enable: bool, far_distance: float, far_transition: float, near_enable: bool, near_distance: float, near_transition: float, amount: float) 🔗

設定用於 DOF 模糊效果的參數。這些參數與 CameraAttributesPractical 中的對應參數具有相同的含義。


void camera_attributes_set_dof_blur_bokeh_shape(shape: DOFBokehShape) 🔗

Sets the shape of the DOF bokeh pattern to shape. Different shapes may be used to achieve artistic effect, or to meet performance targets.


void camera_attributes_set_dof_blur_quality(quality: DOFBlurQuality, use_jitter: bool) 🔗

Sets the quality level of the DOF blur effect to quality. use_jitter can be used to jitter samples taken during the blur pass to hide artifacts at the cost of looking more fuzzy.


void camera_attributes_set_exposure(camera_attributes: RID, multiplier: float, normalization: float) 🔗

Sets the exposure values that will be used by the renderers. The normalization amount is used to bake a given Exposure Value (EV) into rendering calculations to reduce the dynamic range of the scene.

The normalization factor can be calculated from exposure value (EV100) as follows:

func get_exposure_normalization(ev100: float):
    return 1.0 / (pow(2.0, ev100) * 1.2)

The exposure value can be calculated from aperture (in f-stops), shutter speed (in seconds), and sensitivity (in ISO) as follows:

func get_exposure(aperture: float, shutter_speed: float, sensitivity: float):
    return log((aperture * aperture) / shutter_speed * (100.0 / sensitivity)) / log(2)

RID camera_create() 🔗

建立 3D 相機並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 camera_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 Camera3D


void camera_set_camera_attributes(camera: RID, effects: RID) 🔗

將使用 camera_attributes_create() 建立的 camera_attributes 設定給給定的相機。


void camera_set_compositor(camera: RID, compositor: RID) 🔗

Sets the compositor used by this camera. Equivalent to Camera3D.compositor.


void camera_set_cull_mask(camera: RID, layers: int) 🔗

設定與該相機關聯的剔除遮罩。剔除遮罩描述了該相機算繪了哪些 3D 圖層。相當於 Camera3D.cull_mask


void camera_set_environment(camera: RID, env: RID) 🔗

設定該相機使用的環境。相當於 Camera3D.environment


void camera_set_frustum(camera: RID, size: float, offset: Vector2, z_near: float, z_far: float) 🔗

將相機設定為使用視錐投影。該模式允許調整 offset 參數以建立“傾斜視錐”效果。


void camera_set_orthogonal(camera: RID, size: float, z_near: float, z_far: float) 🔗

將相機設定為使用正交投影,也稱為正射投影。物體在螢幕上保持相同的尺寸,無論它們有多遠。


void camera_set_perspective(camera: RID, fovy_degrees: float, z_near: float, z_far: float) 🔗

將相機設定為使用透視投影。螢幕上的物體在遠處時變得更小。


void camera_set_transform(camera: RID, transform: Transform3D) 🔗

設定相機的 Transform3D


void camera_set_use_vertical_aspect(camera: RID, enable: bool) 🔗

如果為 true,則保留水平長寬比,相當於 Camera3D.KEEP_WIDTH。如果為 false,則保留垂直長寬比,相當於 Camera3D.KEEP_HEIGHT


RID canvas_create() 🔗

建立畫布並返回分配的 RID。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

沒有與畫布等價的 ResourceNode


void canvas_item_add_animation_slice(item: RID, animation_length: float, slice_begin: float, slice_end: float, offset: float = 0.0) 🔗

後續的繪製命令將被忽略,除非它們位於指定的動畫切片內。這是實作在背景上迴圈而不是不斷重繪的動畫的更快方法。


void canvas_item_add_circle(item: RID, pos: Vector2, radius: float, color: Color, antialiased: bool = false) 🔗

item RID 指向的 CanvasItem 上繪製一個圓圈。另見 CanvasItem.draw_circle()


void canvas_item_add_clip_ignore(item: RID, ignore: bool) 🔗

If ignore is true, ignore clipping on items drawn with this canvas item until this is called again with ignore set to false.


void canvas_item_add_ellipse(item: RID, pos: Vector2, major: float, minor: float, color: Color, antialiased: bool = false) 🔗

Draws an ellipse with semi-major axis major and semi-minor axis minor on the CanvasItem pointed to by the item RID. See also CanvasItem.draw_ellipse().


void canvas_item_add_lcd_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color) 🔗

另見 CanvasItem.draw_lcd_texture_rect_region()


void canvas_item_add_line(item: RID, from: Vector2, to: Vector2, color: Color, width: float = -1.0, antialiased: bool = false) 🔗

item RID 指向的 CanvasItem 上畫一條線。另見 CanvasItem.draw_line()


void canvas_item_add_mesh(item: RID, mesh: RID, transform: Transform2D = Transform2D(1, 0, 0, 1, 0, 0), modulate: Color = Color(1, 1, 1, 1), texture: RID = RID()) 🔗

使用給定的 transformmodulate 顏色、和 texture 繪製使用 mesh_create() 建立的網格。這由 MeshInstance2D 內部使用。


void canvas_item_add_msdf_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), outline_size: int = 0, px_range: float = 1.0, scale: float = 1.0) 🔗

另見 CanvasItem.draw_msdf_texture_rect_region()


void canvas_item_add_multiline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) 🔗

item RID 指向的 CanvasItem 上,繪製一個 2D 多線。另見 CanvasItem.draw_multiline()CanvasItem.draw_multiline_colors()


void canvas_item_add_multimesh(item: RID, mesh: RID, texture: RID = RID()) 🔗

item RID 指向的 CanvasItem 上,繪製一個 2D MultiMesh。另見 CanvasItem.draw_multimesh()


void canvas_item_add_nine_patch(item: RID, rect: Rect2, source: Rect2, texture: RID, topleft: Vector2, bottomright: Vector2, x_axis_mode: NinePatchAxisMode = 0, y_axis_mode: NinePatchAxisMode = 0, draw_center: bool = true, modulate: Color = Color(1, 1, 1, 1)) 🔗

item RID 指向的 CanvasItem 上,繪製一個九宮格矩形。


void canvas_item_add_particles(item: RID, particles: RID, texture: RID) 🔗

item RID 指向的 CanvasItem 上繪製粒子。


void canvas_item_add_polygon(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), texture: RID = RID()) 🔗

Draws a 2D polygon on the CanvasItem pointed to by the item RID. If you need more flexibility (such as being able to use bones), use canvas_item_add_triangle_array() instead. See also CanvasItem.draw_polygon().

Note: If you frequently redraw the same polygon with a large number of vertices, consider pre-calculating the triangulation with Geometry2D.triangulate_polygon() and using CanvasItem.draw_mesh(), CanvasItem.draw_multimesh(), or canvas_item_add_triangle_array().


void canvas_item_add_polyline(item: RID, points: PackedVector2Array, colors: PackedColorArray, width: float = -1.0, antialiased: bool = false) 🔗

item RID 指向的 CanvasItem 上,繪製一個 2D 折線。另見 CanvasItem.draw_polyline()CanvasItem.draw_polyline_colors()


void canvas_item_add_primitive(item: RID, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array, texture: RID) 🔗

item RID 指向的 CanvasItem 上繪製一個 2D 圖元。另見 CanvasItem.draw_primitive()


void canvas_item_add_rect(item: RID, rect: Rect2, color: Color, antialiased: bool = false) 🔗

item RID 指向的 CanvasItem 上繪製一個矩形。另見 CanvasItem.draw_rect()


void canvas_item_add_set_transform(item: RID, transform: Transform2D) 🔗

設定將被用於變換後續畫布項命令的 Transform2D


void canvas_item_add_texture_rect(item: RID, rect: Rect2, texture: RID, tile: bool = false, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false) 🔗

item RID 指向的 CanvasItem 上繪製一個有紋理的 2D 矩形。另見 CanvasItem.draw_texture_rect()Texture2D.draw_rect()


void canvas_item_add_texture_rect_region(item: RID, rect: Rect2, texture: RID, src_rect: Rect2, modulate: Color = Color(1, 1, 1, 1), transpose: bool = false, clip_uv: bool = true) 🔗

item RID 指向的 CanvasItem 上繪製一個有紋理 2D 矩形的特定區域。另見 CanvasItem.draw_texture_rect_region()Texture2D.draw_rect_region()


void canvas_item_add_triangle_array(item: RID, indices: PackedInt32Array, points: PackedVector2Array, colors: PackedColorArray, uvs: PackedVector2Array = PackedVector2Array(), bones: PackedInt32Array = PackedInt32Array(), weights: PackedFloat32Array = PackedFloat32Array(), texture: RID = RID(), count: int = -1) 🔗

Draws a triangle array on the CanvasItem pointed to by the item RID. This is internally used by Line2D and StyleBoxFlat for rendering. canvas_item_add_triangle_array() is highly flexible, but more complex to use than canvas_item_add_polygon().

Note: If count is set to a non-negative value, only the first count * 3 indices (corresponding to count triangles) will be drawn. Otherwise, all indices are drawn.


void canvas_item_attach_skeleton(item: RID, skeleton: RID) 🔗

Attaches a skeleton to the CanvasItem. Removes the previous skeleton.


void canvas_item_clear(item: RID) 🔗

清空 CanvasItem 並刪除其中的所有命令。


RID canvas_item_create() 🔗

新建 CanvasItem 實例並返回其 RID。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_item_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 CanvasItem


Variant canvas_item_get_instance_shader_parameter(instance: RID, parameter: StringName) const 🔗

Returns the value of the per-instance shader uniform from the specified canvas item instance. Equivalent to CanvasItem.get_instance_shader_parameter().


Variant canvas_item_get_instance_shader_parameter_default_value(instance: RID, parameter: StringName) const 🔗

Returns the default value of the per-instance shader uniform from the specified canvas item instance. Equivalent to CanvasItem.get_instance_shader_parameter().


Array[Dictionary] canvas_item_get_instance_shader_parameter_list(instance: RID) const 🔗

Returns a dictionary of per-instance shader uniform names of the per-instance shader uniform from the specified canvas item instance.

The returned dictionary is in PropertyInfo format, with the keys name, class_name, type, hint, hint_string, and usage.


void canvas_item_reset_physics_interpolation(item: RID) 🔗

Prevents physics interpolation for the current physics tick.

This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.


void canvas_item_set_canvas_group_mode(item: RID, mode: CanvasGroupMode, clear_margin: float = 5.0, fit_empty: bool = false, fit_margin: float = 0.0, blur_mipmaps: bool = false) 🔗

設定對畫布項進行 2D 算繪時使用的畫布群組模式,畫布項由 item RID 指定。要使用更快速但局限性更大的裁剪,請改用 canvas_item_set_clip()

注意:等價的節點功能可以在 CanvasGroupCanvasItem.clip_children 中找到。


void canvas_item_set_clip(item: RID, clip: bool) 🔗

如果 cliptrue,則畫布項不會在其矩形座標之外繪製內容,畫布項由 item RID 指定。這種裁剪很快,但只能用於軸對齊的矩形。也就是說裁剪矩形會忽略旋轉。更高階的裁剪形狀請改用 canvas_item_set_canvas_group_mode()

注意:等價的節點功能可以在 Label.clip_textRichTextLabel(始終啟用)等處找到。


void canvas_item_set_copy_to_backbuffer(item: RID, enabled: bool, rect: Rect2) 🔗

設定 CanvasItem 以將矩形複製到背景緩衝區。


void canvas_item_set_custom_rect(item: RID, use_custom_rect: bool, rect: Rect2 = Rect2(0, 0, 0, 0)) 🔗

如果 use_custom_recttrue,則將畫布項 item 的自訂可見性框設定為 rect(用於剔除)。設定自訂可見性框能夠在繪製大量 2D 實例時降低 CPU 負載。如果 use_custom_rectfalse,則會根據畫布項的繪製命令自動計算可見性框。


void canvas_item_set_default_texture_filter(item: RID, filter: CanvasItemTextureFilter) 🔗

設定 RID 為 item 的畫布項的預設紋理篩選模式。等價於 CanvasItem.texture_filter


void canvas_item_set_default_texture_repeat(item: RID, repeat: CanvasItemTextureRepeat) 🔗

設定 RID 為 item 的畫布項的預設紋理重複模式。等價於 CanvasItem.texture_repeat


void canvas_item_set_distance_field_mode(item: RID, enabled: bool) 🔗

如果 enabledtrue,則為 RID 為 item 的畫布項啟用多通道帶符號距離場算繪模式。旨在用於字形算繪,或針對使用 msdfgen 生成的圖像。


void canvas_item_set_draw_behind_parent(item: RID, enabled: bool) 🔗

如果 enabledtrue,則為 RID 為 item 的畫布項繪製在父級之後。等價於 CanvasItem.show_behind_parent


void canvas_item_set_draw_index(item: RID, index: int) 🔗

設定 CanvasItem 的索引。


void canvas_item_set_instance_shader_parameter(instance: RID, parameter: StringName, value: Variant) 🔗

Sets the per-instance shader uniform on the specified canvas item instance. Equivalent to CanvasItem.set_instance_shader_parameter().


void canvas_item_set_interpolated(item: RID, interpolated: bool) 🔗

If interpolated is true, turns on physics interpolation for the canvas item.


void canvas_item_set_light_mask(item: RID, mask: int) 🔗

設定 RID 為 item 的畫布項的燈光遮罩 mask。等價於 CanvasItem.light_mask


void canvas_item_set_material(item: RID, material: RID) 🔗

設定 RID 為 item 的畫布項的新材質 material。等價於 CanvasItem.material


void canvas_item_set_modulate(item: RID, color: Color) 🔗

將 RID 為 item 的畫布項的顏色與其相乘,子項也受影響。另見 canvas_item_set_self_modulate()。等價於 CanvasItem.modulate


void canvas_item_set_parent(item: RID, parent: RID) 🔗

CanvasItem 設定父級 CanvasItem。該專案會從父級繼承變換、調變、可見性,和場景樹中的 CanvasItem 節點一樣。


void canvas_item_set_self_modulate(item: RID, color: Color) 🔗

將 RID 為 item 的畫布項的顏色與其相乘,子項不受影響。另見 canvas_item_set_modulate()。等價於 CanvasItem.self_modulate


void canvas_item_set_sort_children_by_y(item: RID, enabled: bool) 🔗

如果 enabledtrue,則會在繪製 Y 位置最低的子節點之後再繪製 Y 位置較高的子節點。Y 排序僅影響繼承自該畫布項的子級,不影響畫布項自身,該畫布項由 item RID 指定。等價於 CanvasItem.y_sort_enabled


void canvas_item_set_transform(item: RID, transform: Transform2D) 🔗

將 RID 為 item 的畫布項的變換設定為 transform。會影響該畫布項繪製的位置和方法。子級畫布項的變換會與父級變換相乘。等價於 Node2D.transform


void canvas_item_set_use_parent_material(item: RID, enabled: bool) 🔗

設定 CanvasItem 是否使用其父級的材質。


void canvas_item_set_visibility_layer(item: RID, visibility_layer: int) 🔗

設定與這個 CanvasItem 關聯的算繪可見性層。只有算繪遮罩與此配對的 Viewport 節點才會算繪這個 CanvasItem


void canvas_item_set_visibility_notifier(item: RID, enable: bool, area: Rect2, enter_callable: Callable, exit_callable: Callable) 🔗

將給定的 CanvasItem 設定為可見性通知器。area 定義可見性檢查的區域。CanvasItem 進入螢幕時會呼叫 enter_callableCanvasItem 退出螢幕時會呼叫 exit_callable。如果 enablefalse,則該專案將不再作為通知器。

這個方法可用於手動模仿 VisibleOnScreenNotifier2D


void canvas_item_set_visible(item: RID, visible: bool) 🔗

設定 CanvasItem 的可見性。


void canvas_item_set_z_as_relative_to_parent(item: RID, enabled: bool) 🔗

如果啟用此選項,則父項的 Z 索引將新增到子項的 Z 索引中。


void canvas_item_set_z_index(item: RID, z_index: int) 🔗

設定 CanvasItem 的 Z 索引,即它的繪製順序(首先繪製數值較低的索引)。


void canvas_item_transform_physics_interpolation(item: RID, transform: Transform2D) 🔗

Transforms both the current and previous stored transform for a canvas item.

This allows transforming a canvas item without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.


void canvas_light_attach_to_canvas(light: RID, canvas: RID) 🔗

將畫布燈連接到畫布上,並將其從以前的畫布中取出。


RID canvas_light_create() 🔗

建立畫布燈光並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_light_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 Light2D


void canvas_light_occluder_attach_to_canvas(occluder: RID, canvas: RID) 🔗

將光遮擋物新增到畫布上,並將其從之前的畫布中移除。


RID canvas_light_occluder_create() 🔗

建立光線遮擋器並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_light_occluder_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 LightOccluder2D


void canvas_light_occluder_reset_physics_interpolation(occluder: RID) 🔗

Prevents physics interpolation for the current physics tick.

This is useful when moving an occluder to a new location, to give an instantaneous change rather than interpolation from the previous location.


void canvas_light_occluder_set_as_sdf_collision(occluder: RID, enable: bool) 🔗

Enables or disables using the light occluder as a signed distance field for 2D particle collision.


void canvas_light_occluder_set_enabled(occluder: RID, enabled: bool) 🔗

啟用或禁用遮光器。


void canvas_light_occluder_set_interpolated(occluder: RID, interpolated: bool) 🔗

If interpolated is true, turns on physics interpolation for the light occluder.


void canvas_light_occluder_set_light_mask(occluder: RID, mask: int) 🔗

光線遮罩。詳情請參閱 LightOccluder2D


void canvas_light_occluder_set_polygon(occluder: RID, polygon: RID) 🔗

設定光遮擋物的多邊形。


void canvas_light_occluder_set_transform(occluder: RID, transform: Transform2D) 🔗

設定光遮擋物的 Transform2D


void canvas_light_occluder_transform_physics_interpolation(occluder: RID, transform: Transform2D) 🔗

Transforms both the current and previous stored transform for a light occluder.

This allows transforming an occluder without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.


void canvas_light_reset_physics_interpolation(light: RID) 🔗

Prevents physics interpolation for the current physics tick.

This is useful when moving a canvas item to a new location, to give an instantaneous change rather than interpolation from the previous location.


void canvas_light_set_blend_mode(light: RID, mode: CanvasLightBlendMode) 🔗

Sets the blend mode for the given canvas light to mode. Equivalent to Light2D.blend_mode.


void canvas_light_set_color(light: RID, color: Color) 🔗

設定燈光的顏色。


void canvas_light_set_enabled(light: RID, enabled: bool) 🔗

啟用或禁用畫布燈。


void canvas_light_set_energy(light: RID, energy: float) 🔗

設定畫布燈的能量。


void canvas_light_set_height(light: RID, height: float) 🔗

設定畫布燈的高度。


void canvas_light_set_interpolated(light: RID, interpolated: bool) 🔗

If interpolated is true, turns on physics interpolation for the canvas light.


void canvas_light_set_item_cull_mask(light: RID, mask: int) 🔗

光線遮罩。詳情請參閱 LightOccluder2D


void canvas_light_set_item_shadow_cull_mask(light: RID, mask: int) 🔗

用於確定此畫布燈光陰影影響哪些圖層的二進位蒙版。有關光遮罩的更多資訊,請參閱 LightOccluder2D


void canvas_light_set_layer_range(light: RID, min_layer: int, max_layer: int) 🔗

使用此燈光算繪的圖層範圍。


void canvas_light_set_mode(light: RID, mode: CanvasLightMode) 🔗

Sets the mode of the canvas light.


void canvas_light_set_shadow_color(light: RID, color: Color) 🔗

設定畫布燈的陰影顏色。


void canvas_light_set_shadow_enabled(light: RID, enabled: bool) 🔗

啟用或禁用畫布燈的陰影。


void canvas_light_set_shadow_filter(light: RID, filter: CanvasLightShadowFilter) 🔗

Sets the canvas light's shadow's filter.


void canvas_light_set_shadow_smooth(light: RID, smooth: float) 🔗

使陰影變得平滑。數值越低越光滑。


void canvas_light_set_texture(light: RID, texture: RID) 🔗

設定 PointLight2D 所使用的紋理。相當於 PointLight2D.texture


void canvas_light_set_texture_offset(light: RID, offset: Vector2) 🔗

設定 PointLight2D 紋理的偏移量。相當於 PointLight2D.offset


void canvas_light_set_texture_scale(light: RID, scale: float) 🔗

設定 PointLight2D 紋理的縮放係數。相當於 PointLight2D.texture_scale


void canvas_light_set_transform(light: RID, transform: Transform2D) 🔗

設定畫布燈的 Transform2D


void canvas_light_set_z_range(light: RID, min_z: int, max_z: int) 🔗

設定將受此光影響的對象的 Z 範圍。相當於 Light2D.range_z_minLight2D.range_z_max


void canvas_light_transform_physics_interpolation(light: RID, transform: Transform2D) 🔗

Transforms both the current and previous stored transform for a canvas light.

This allows transforming a light without creating a "glitch" in the interpolation, which is particularly useful for large worlds utilizing a shifting origin.


RID canvas_occluder_polygon_create() 🔗

新建光線遮擋多邊形並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_occluder_polygon_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 OccluderPolygon2D


void canvas_occluder_polygon_set_cull_mode(occluder_polygon: RID, mode: CanvasOccluderPolygonCullMode) 🔗

Sets an occluder polygon's cull mode.


void canvas_occluder_polygon_set_shape(occluder_polygon: RID, shape: PackedVector2Array, closed: bool) 🔗

設定遮擋多邊形的形狀。


void canvas_set_disable_scale(disable: bool) 🔗

If disable is true, makes 2D rendering ignore the canvas scale defined for each canvas layer. This affects CanvasLayers with the CanvasLayer.follow_viewport_enabled property set to true.

In the editor, this is set to true by default, and set to false when View > Preview Canvas Scale is enabled at the top of the 2D editor viewport.

Note: Setting this to true does not impact the behavior of CanvasLayer.scale, Node2D.scale, or Control.scale.


void canvas_set_item_mirroring(canvas: RID, item: RID, mirroring: Vector2) 🔗

A copy of the canvas item will be drawn with a local offset of the mirroring.

Note: This is equivalent to calling canvas_set_item_repeat() like canvas_set_item_repeat(item, mirroring, 1), with an additional check ensuring canvas is a parent of item.


void canvas_set_item_repeat(item: RID, repeat_size: Vector2, repeat_times: int) 🔗

A copy of the canvas item will be drawn with a local offset of the repeat_size by the number of times of the repeat_times. As the repeat_times increases, the copies will spread away from the origin texture.


void canvas_set_modulate(canvas: RID, color: Color) 🔗

調變給定畫布中的所有顏色。


void canvas_set_shadow_texture_size(size: int) 🔗

設定 Light2D 陰影算繪時使用的 ProjectSettings.rendering/2d/shadow_atlas/size(單位為圖元)。該值會向上取整到最接近的 2 的冪。


RID canvas_texture_create() 🔗

建立畫布紋理並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 canvas_texture_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。另見 texture_2d_create()

注意:等價資源為 CanvasTexture,應該僅用於 2D 算繪,不用於 3D。


void canvas_texture_set_channel(canvas_texture: RID, channel: CanvasTextureChannel, texture: RID) 🔗

為畫布紋理設定 channel 通道的紋理 texture,該畫布紋理由 RID canvas_texture 指定。等價於 CanvasTexture.diffuse_textureCanvasTexture.normal_textureCanvasTexture.specular_texture


void canvas_texture_set_shading_parameters(canvas_texture: RID, base_color: Color, shininess: float) 🔗

為畫布紋理設定 base_colorshininess,該畫布紋理由 RID canvas_texture 指定。等價於 CanvasTexture.specular_colorCanvasTexture.specular_shininess


void canvas_texture_set_texture_filter(canvas_texture: RID, filter: CanvasItemTextureFilter) 🔗

為畫布紋理設定紋理篩選模式 filter,該畫布紋理由 RID canvas_texture 指定。


void canvas_texture_set_texture_repeat(canvas_texture: RID, repeat: CanvasItemTextureRepeat) 🔗

為畫布紋理設定紋理重複模式 repeat,該畫布紋理由 RID canvas_texture 指定。


RID compositor_create() 🔗

Creates a new compositor and adds it to the RenderingServer. It can be accessed with the RID that is returned.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.


RID compositor_effect_create() 🔗

Creates a new rendering effect and adds it to the RenderingServer. It can be accessed with the RID that is returned.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.


void compositor_effect_set_callback(effect: RID, callback_type: CompositorEffectCallbackType, callback: Callable) 🔗

Sets the callback type (callback_type) and callback method(callback) for this rendering effect.


void compositor_effect_set_enabled(effect: RID, enabled: bool) 🔗

Enables/disables this rendering effect.


void compositor_effect_set_flag(effect: RID, flag: CompositorEffectFlags, set: bool) 🔗

Sets the flag (flag) for this rendering effect to true or false (set).


void compositor_set_compositor_effects(compositor: RID, effects: Array[RID]) 🔗

Sets the compositor effects for the specified compositor RID. effects should be an array containing RIDs created with compositor_effect_create().


RenderingDevice create_local_rendering_device() const 🔗

Creates a RenderingDevice that can be used to do draw and compute operations on a separate thread. Cannot draw to the screen nor share data with the global RenderingDevice.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns null.


Rect2 debug_canvas_item_get_rect(item: RID) 🔗

Returns the bounding rectangle for a canvas item in local space, as calculated by the renderer. This bound is used internally for culling.

Warning: This function is intended for debugging in the editor, and will pass through and return a zero Rect2 in exported projects.


RID decal_create() 🔗

建立裝飾並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 decal_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個裝飾放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:等價節點為 Decal


void decal_set_albedo_mix(decal: RID, albedo_mix: float) 🔗

為裝飾設定 albedo_mix,該裝飾由 RID decal 指定。等價於 Decal.albedo_mix


void decal_set_cull_mask(decal: RID, mask: int) 🔗

為裝飾設定剔除遮罩 mask,該裝飾由 RID decal 指定。等價於 Decal.cull_mask


void decal_set_distance_fade(decal: RID, enabled: bool, begin: float, length: float) 🔗

為裝飾設定距離淡出參數,該裝飾由 RID decal 指定。等價於 Decal.distance_fade_enabledDecal.distance_fade_beginDecal.distance_fade_length


void decal_set_emission_energy(decal: RID, energy: float) 🔗

為裝飾設定自發光能量 energy,該裝飾由 RID decal 指定。等價於 Decal.emission_energy


void decal_set_fade(decal: RID, above: float, below: float) 🔗

為裝飾設定上側淡出(above)和下側淡出(below),該裝飾由 RID decal 指定。等價於 Decal.upper_fadeDecal.lower_fade


void decal_set_modulate(decal: RID, color: Color) 🔗

將裝飾的顏色乘數設定為 color,該裝飾由 RID decal 指定。等價於 Decal.modulate


void decal_set_normal_fade(decal: RID, fade: float) 🔗

設定 RID 為 decal 的裝飾的法線淡出 fade。等價於 Decal.normal_fade


void decal_set_size(decal: RID, size: Vector3) 🔗

設定 RID 為 decal 的裝飾的大小 size。等價於 Decal.size


void decal_set_texture(decal: RID, type: DecalTexture, texture: RID) 🔗

設定指定裝飾中給定紋理型別插槽 type 的紋理 texture。等價於 Decal.set_texture()


void decals_set_filter(filter: DecalFilter) 🔗

設定算繪裝飾時所使用的紋理篩選模式 filter。這個參數是全域的,無法針對某個裝飾單獨設定。


RID directional_light_create() 🔗

建立平行光並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在大多數 light_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個平行光放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:等價節點為 DirectionalLight3D


void directional_shadow_atlas_set_size(size: int, is_16bits: bool) 🔗

設定 3D 方向燈光的陰影大小 size。另見 ProjectSettings.rendering/lights_and_shadows/directional_shadow/size。這個參數是全域的,無法針對某個視口單獨設定。


void directional_soft_shadow_filter_set_quality(quality: ShadowQuality) 🔗

設定 3D 方向燈光的陰影篩選品質 quality。另見 ProjectSettings.rendering/lights_and_shadows/directional_shadow/soft_shadow_filter_quality。這個參數是全域的,無法針對某個視口單獨設定。


Image environment_bake_panorama(environment: RID, bake_irradiance: bool, size: Vector2i) 🔗

Generates and returns an Image containing the radiance map for the specified environment RID's sky. This supports built-in sky material and custom sky shaders. If bake_irradiance is true, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also sky_bake_panorama().

Note: The image is saved using linear encoding without any tonemapping performed, which means it will look too dark if viewed directly in an image editor.

Note: size should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than Sky.radiance_size, as it won't increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map.


RID environment_create() 🔗

建立環境並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 environment_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 Environment


void environment_glow_set_use_bicubic_upscale(enable: bool) 🔗

If enable is true, enables bicubic upscaling for glow which improves quality at the cost of performance. Equivalent to ProjectSettings.rendering/environment/glow/upscale_mode.

Note: This setting is only effective when using the Forward+ or Mobile rendering methods, as Compatibility uses a different glow implementation.


void environment_set_adjustment(env: RID, enable: bool, brightness: float, contrast: float, saturation: float, use_1d_color_correction: bool, color_correction: RID) 🔗

設定用於“調整”後期處理效果的數值。詳見 Environment


void environment_set_ambient_light(env: RID, color: Color, ambient: EnvironmentAmbientSource = 0, energy: float = 1.0, sky_contribution: float = 0.0, reflection_source: EnvironmentReflectionSource = 0) 🔗

設定用於環境光算繪的數值。詳見 Environment


void environment_set_background(env: RID, bg: EnvironmentBG) 🔗

設定環境的背景模式。等價於 Environment.background_mode


void environment_set_bg_color(env: RID, color: Color) 🔗

場景中清屏區域的顏色。僅在使用 ENV_BG_COLOR 背景模式時有效。


void environment_set_bg_energy(env: RID, multiplier: float, exposure_value: float) 🔗

設定背景顏色的強度。


void environment_set_camera_id(env: RID, id: int) 🔗

Sets the camera ID to be used as environment background.


void environment_set_canvas_max_layer(env: RID, max_layer: int) 🔗

如果使用畫布背景模式,設定要使用的最大層數。


void environment_set_fog(env: RID, enable: bool, light_color: Color, light_energy: float, sun_scatter: float, density: float, height: float, height_density: float, aerial_perspective: float, sky_affect: float, fog_mode: EnvironmentFogMode = 0) 🔗

為指定的環境 RID 配置霧。詳見 Environment 中的 fog_* 屬性。


void environment_set_fog_depth(env: RID, curve: float, begin: float, end: float) 🔗

Configures fog depth for the specified environment RID. Only has an effect when the fog mode of the environment is ENV_FOG_MODE_DEPTH. See fog_depth_* properties in Environment for more information.


void environment_set_glow(env: RID, enable: bool, levels: PackedFloat32Array, intensity: float, strength: float, mix: float, bloom_threshold: float, blend_mode: EnvironmentGlowBlendMode, hdr_bleed_threshold: float, hdr_bleed_scale: float, hdr_luminance_cap: float, glow_map_strength: float, glow_map: RID) 🔗

為指定的環境 RID 配置輝光。詳見 Environment 中的 glow_* 屬性。


void environment_set_sdfgi(env: RID, enable: bool, cascades: int, min_cell_size: float, y_scale: EnvironmentSDFGIYScale, use_occlusion: bool, bounce_feedback: float, read_sky: bool, energy: float, normal_bias: float, probe_bias: float) 🔗

為指定的環境 RID 配置帶符號距離場全域光照。詳見 Environment 中的 sdfgi_* 屬性。


void environment_set_sdfgi_frames_to_converge(frames: EnvironmentSDFGIFramesToConverge) 🔗

設定用於聚合帶符號距離場全域光照的影格數。等價於 ProjectSettings.rendering/global_illumination/sdfgi/frames_to_converge


void environment_set_sdfgi_frames_to_update_light(frames: EnvironmentSDFGIFramesToUpdateLight) 🔗

設定計算帶符號距離場全域光照時動態燈光間接光照的更新速度。等價於 ProjectSettings.rendering/global_illumination/sdfgi/frames_to_update_lights


void environment_set_sdfgi_ray_count(ray_count: EnvironmentSDFGIRayCount) 🔗

設定計算帶符號距離場全域光照時每影格射出的光線數。等價於 ProjectSettings.rendering/global_illumination/sdfgi/probe_ray_count


void environment_set_sky(env: RID, sky: RID) 🔗

設定當使用 BGMode 天空時被用作環境背景的 Sky。相當於 Environment.sky


void environment_set_sky_custom_fov(env: RID, scale: float) 🔗

為背景 Sky 設定自訂視野。相當於 Environment.sky_custom_fov


void environment_set_sky_orientation(env: RID, orientation: Basis) 🔗

設定被表示為 Basis 的背景 Sky 的旋轉。相當於 Environment.sky_rotation,其中旋轉向量用於建構該 Basis


void environment_set_ssao(env: RID, enable: bool, radius: float, intensity: float, power: float, detail: float, horizon: float, sharpness: float, light_affect: float, ao_channel_affect: float) 🔗

設定螢幕空間環境光遮蔽(SSAO)後期處理效果所使用的變數。詳情見 Environment


void environment_set_ssao_quality(quality: EnvironmentSSAOQuality, half_size: bool, adaptive_target: float, blur_passes: int, fadeout_from: float, fadeout_to: float) 🔗

設定螢幕空間環境光遮蔽(SSAO)後期處理效果的品質級別。詳情見 Environment


void environment_set_ssil_quality(quality: EnvironmentSSILQuality, half_size: bool, adaptive_target: float, blur_passes: int, fadeout_from: float, fadeout_to: float) 🔗

設定螢幕空間間接照明(SSIL)後期處理效果的品質級別。詳情見 Environment


void environment_set_ssr(env: RID, enable: bool, max_steps: int, fade_in: float, fade_out: float, depth_tolerance: float) 🔗

設定螢幕空間反射(SSR)後期處理效果所使用的變數。詳情見 Environment


void environment_set_ssr_half_size(half_size: bool) 🔗

Sets whether screen-space reflections will be rendered at full or half size. Half size is faster, but may look pixelated or cause flickering.


void environment_set_ssr_roughness_quality(quality: EnvironmentSSRRoughnessQuality) 🔗

已棄用: This option no longer does anything.


void environment_set_tonemap(env: RID, tone_mapper: EnvironmentToneMapper, exposure: float, white: float) 🔗

設定“色調對應”後期處理效果所使用的變數。詳情見 Environment


void environment_set_tonemap_agx_contrast(env: RID, agx_contrast: float) 🔗

See Environment.tonemap_agx_contrast for more details.


void environment_set_volumetric_fog(env: RID, enable: bool, density: float, albedo: Color, emission: Color, emission_energy: float, anisotropy: float, length: float, detail_spread: float, gi_inject: float, temporal_reprojection: bool, temporal_reprojection_amount: float, ambient_inject: float, sky_affect: float) 🔗

設定體積霧後期處理效果所使用的變數。詳情見 Environment


void environment_set_volumetric_fog_filter_active(active: bool) 🔗

啟用體積霧散射緩衝區的篩選。這會產生更平滑的體積,並且幾乎沒有欠取樣偽影。


void environment_set_volumetric_fog_volume_size(size: int, depth: int) 🔗

設定體積霧的片段體素緩衝區解析度。size 會被螢幕的縱橫比修改,用於設定緩衝區的寬度和高度。depth 則用於設定緩衝區的深度。


RID fog_volume_create() 🔗

新建霧體積並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 fog_volume_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 FogVolume


void fog_volume_set_material(fog_volume: RID, material: RID) 🔗

設定該霧體積的 Material。可以是 FogMaterial,也可以是自訂的 ShaderMaterial


void fog_volume_set_shape(fog_volume: RID, shape: FogVolumeShape) 🔗

將霧體積的形狀設定為 FOG_VOLUME_SHAPE_ELLIPSOIDFOG_VOLUME_SHAPE_CONEFOG_VOLUME_SHAPE_CYLINDERFOG_VOLUME_SHAPE_BOXFOG_VOLUME_SHAPE_WORLD


void fog_volume_set_size(fog_volume: RID, size: Vector3) 🔗

設定形狀為 FOG_VOLUME_SHAPE_ELLIPSOIDFOG_VOLUME_SHAPE_CONEFOG_VOLUME_SHAPE_CYLINDERFOG_VOLUME_SHAPE_BOX 時,霧體積的大小。


void force_draw(swap_buffers: bool = true, frame_step: float = 0.0) 🔗

Forces redrawing of all viewports at once. Must be called from the main thread.


void force_sync() 🔗

強制在 CPU 和 GPU 之間進行同步,某些情況下是必須的。請只在需要時呼叫,因為 CPU-GPU 同步對性能有影響。


void free_rid(rid: RID) 🔗

嘗試釋放 RenderingServer 中的某個物件。為了避免記憶體洩漏,應該在使用完物件後調用,因為直接使用 RenderingServer 時不會自動進行記憶體管理。


String get_current_rendering_driver_name() const 🔗

Returns the name of the current rendering driver. This can be vulkan, d3d12, metal, opengl3, opengl3_es, or opengl3_angle. See also get_current_rendering_method().

When ProjectSettings.rendering/renderer/rendering_method is forward_plus or mobile, the rendering driver is determined by ProjectSettings.rendering/rendering_device/driver.

When ProjectSettings.rendering/renderer/rendering_method is gl_compatibility, the rendering driver is determined by ProjectSettings.rendering/gl_compatibility/driver.

The rendering driver is also determined by the --rendering-driver command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.


String get_current_rendering_method() const 🔗

Returns the name of the current rendering method. This can be forward_plus, mobile, or gl_compatibility. See also get_current_rendering_driver_name().

The rendering method is determined by ProjectSettings.rendering/renderer/rendering_method, the --rendering-method command line argument that overrides this project setting, or an automatic fallback that is applied depending on the hardware.


Color get_default_clear_color() 🔗

返回預設清屏顏色,會在沒有選擇特定的清屏顏色時使用。另見 set_default_clear_color()


float get_frame_setup_time_cpu() const 🔗

返回在 CPU 上設定算繪所消耗的時間,單位為毫秒。這個值是所有視口共用的,不需要在查詢的視口上啟用 viewport_set_measure_render_time()。另見 viewport_get_measured_render_time_cpu()


RenderingDevice get_rendering_device() const 🔗

Returns the global RenderingDevice.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns null.


int get_rendering_info(info: RenderingInfo) 🔗

Returns a statistic about the rendering engine which can be used for performance profiling. See also viewport_get_render_info(), which returns information specific to a viewport.

Note: Only 3D rendering is currently taken into account by some of these values, such as the number of draw calls.

Note: Rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, get_rendering_info() returns 0. To print rendering information in _ready() successfully, use the following:

func _ready():
    for _i in 2:
        await get_tree().process_frame

    print(RenderingServer.get_rendering_info(RENDERING_INFO_TOTAL_DRAW_CALLS_IN_FRAME))

Array[Dictionary] get_shader_parameter_list(shader: RID) const 🔗

返回著色器的參數。


RID get_test_cube() 🔗

返回測試立方體的 RID。首次呼叫 get_test_cube() 時會建立並返回該網格,然後為後續呼叫快取。另見 make_sphere_mesh()


RID get_test_texture() 🔗

Returns the RID of a 256×256 texture with a testing pattern on it (in Image.FORMAT_RGB8 format). This texture will be created and returned on the first call to get_test_texture(), then it will be cached for subsequent calls. See also get_white_texture().

Example: Get the test texture and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

String get_video_adapter_api_version() const 🔗

返回目前使用的圖形視訊卡的版本(例如,Vulkan 為“1.2.189”,OpenGL 為“3.3.0 NVIDIA 510.60.02”)。該版本可能與硬體支援的實際最新版本不同,因為 Godot 可能並不總是要求最新版本。另見 OS.get_video_adapter_driver_info()

注意:當運作無頭或伺服器可執行檔時,該函式返回一個空字串。


String get_video_adapter_name() const 🔗

傳回視訊適配器的名稱(例如「GeForce GTX 1080/PCIe/SSE2」)。

注意: 執行無頭或伺服器二進位檔案時,此函式傳回空字串。

注意: 在網路平台上,某些瀏覽器(例如 Firefox)可能會報告不同的固定 GPU 名稱,例如「GeForce GTX 980」(無論使用者的實際 GPU 型號為何)。這樣做是為了使指紋辨識更加困難。


DeviceType get_video_adapter_type() const 🔗

Returns the type of the video adapter. Since dedicated graphics cards from a given generation will usually be significantly faster than integrated graphics made in the same generation, the device type can be used as a basis for automatic graphics settings adjustment. However, this is not always true, so make sure to provide users with a way to manually override graphics settings.

Note: When using the OpenGL rendering driver or when running in headless mode, this function always returns RenderingDevice.DEVICE_TYPE_OTHER.


String get_video_adapter_vendor() const 🔗

返回視訊卡的供應商(例如 "NVIDIA Corporation")。

注意:當運作精簡或伺服器可執行檔時,該函式返回一個空字串。


RID get_white_texture() 🔗

Returns the ID of a 4×4 white texture (in Image.FORMAT_RGB8 format). This texture will be created and returned on the first call to get_white_texture(), then it will be cached for subsequent calls. See also get_test_texture().

Example: Get the white texture and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_white_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

void gi_set_use_half_resolution(half_resolution: bool) 🔗

如果 half_resolutiontrue,則每個軸上都會使用一半的分辨率算繪 VoxelGI 和 SDFGI(Environment.sdfgi_enabled)緩衝區(例如視口大小為 1920×1080 時使用 960×540)。啟用 VoxelGI 或 SDFGI 時,這樣做能夠顯著提升性能,但代價是多邊形邊緣可能產生顯示問題。視口解析度越高,越不容易注意到品質的損失。LightmapGI 的算繪不受這個設定的影響。等價於 ProjectSettings.rendering/global_illumination/gi/use_half_resolution


void global_shader_parameter_add(name: StringName, type: GlobalShaderParameterType, default_value: Variant) 🔗

新建全域著色器 uniform。

注意:全域著色器參數名稱是大小寫敏感的。


Variant global_shader_parameter_get(name: StringName) const 🔗

返回名稱為 name 的全域著色器 uniform 的值。

注意:global_shader_parameter_get() 存在較大的性能損耗,因為算繪執行緒需要與呼叫執行緒同步,這個過程比較慢。為了避免卡頓,請勿在遊戲過程中使用這個方法。如果你需要在設定後在腳本中讀取,請考慮建立一個自動載入,在設定全域參數的同時保存一份你需要查詢的值。


Array[StringName] global_shader_parameter_get_list() const 🔗

返回全域著色器 uniform 名稱的列表。

注意:global_shader_parameter_get() 存在較大的性能損耗,因為算繪執行緒需要與呼叫執行緒同步,這個過程比較慢。為了避免卡頓,請勿在遊戲過程中使用這個方法。如果你需要在設定後在腳本中讀取,請考慮建立一個自動載入,在設定全域參數的同時保存一份你需要查詢的值。


GlobalShaderParameterType global_shader_parameter_get_type(name: StringName) const 🔗

返回與名稱為 name 的全域著色器 uniform 相關聯的型別。

注意:global_shader_parameter_get() 存在較大的性能損耗,因為算繪執行緒需要與呼叫執行緒同步,這個過程比較慢。為了避免卡頓,請勿在遊戲過程中使用這個方法。如果你需要在設定後在腳本中讀取,請考慮建立一個自動載入,在設定全域參數的同時保存一份你需要查詢的值。


void global_shader_parameter_remove(name: StringName) 🔗

移除名稱為 name 的全域著色器 Uniform。


void global_shader_parameter_set(name: StringName, value: Variant) 🔗

將名稱為 name 的全域著色器 Uniform 設定為 value


void global_shader_parameter_set_override(name: StringName, value: Variant) 🔗

使用 value 覆蓋名稱為 name 的全域著色器 Uniform。等價於 ShaderGlobalsOverride 節點。


bool has_changed() const 🔗

如果對 RenderingServer 的資料進行了更改,則返回 true。如果發生這種情況,通常會呼叫 force_draw()


bool has_feature(feature: Features) const 🔗

已棄用: This method has not been used since Godot 3.0.

This method does nothing and always returns false.


bool has_os_feature(feature: String) const 🔗

如果作業系統支援某個功能 feature,則返回 true。功能可以是 s3tcetcetc2


void instance_attach_object_instance_id(instance: RID, id: int) 🔗

將唯一的物件 ID 附加到實例上。必須將物件 ID 附加到實例上,以便通過 instances_cull_aabb()instances_cull_convex()instances_cull_ray() 進行正確的篩除。


void instance_attach_skeleton(instance: RID, skeleton: RID) 🔗

將骨架附加到實例。並從實例中移除之前骨架。


RID instance_create() 🔗

建立可視實例並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 instance_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

實例可以將 3D 物件放置到場景中。粒子、網格、反射探查、裝飾等物件都需要使用 instance_set_base() 與實例關聯,才能顯示在場景中。

注意:等價節點為 VisualInstance3D


RID instance_create2(base: RID, scenario: RID) 🔗

建立可視實例並將其新增到 RenderingServer、設定基礎和場景。可以通過返回的 RID 進行存取。這個 RID 會在大多數 instance_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。這是使用 instance_create() 並手動設定基礎和場景的快捷方式。


Variant instance_geometry_get_shader_parameter(instance: RID, parameter: StringName) const 🔗

返回指定 3D 幾何體實例的單實例著色器 uniform 的值。等價於 GeometryInstance3D.get_instance_shader_parameter()

注意:單實例著色器參數的名稱是大小寫敏感的。


Variant instance_geometry_get_shader_parameter_default_value(instance: RID, parameter: StringName) const 🔗

返回指定 3D 幾何體實例的單實例著色器 uniform 的預設值。等價於 GeometryInstance3D.get_instance_shader_parameter()


Array[Dictionary] instance_geometry_get_shader_parameter_list(instance: RID) const 🔗

返回指定 3D 幾何體實例的單實例著色器名稱字典。返回的字典使用 PropertyInfo 格式,包含 nameclass_nametypehinthint_string 以及 usage 等鍵。等價於 GeometryInstance3D.get_instance_shader_parameter()


void instance_geometry_set_cast_shadows_setting(instance: RID, shadow_casting_setting: ShadowCastingSetting) 🔗

Sets the shadow casting setting. Equivalent to GeometryInstance3D.cast_shadow.


void instance_geometry_set_flag(instance: RID, flag: InstanceFlags, enabled: bool) 🔗

Sets the flag for a given instance to enabled.


void instance_geometry_set_lightmap(instance: RID, lightmap: RID, lightmap_uv_scale: Rect2, lightmap_slice: int) 🔗

為指定的 3D 幾何體實例設定要使用的光照貼圖 GI 實例。必須同時指定該實例的光照貼圖 UV 縮放(等價於 GeometryInstance3D.gi_lightmap_scale)和光照貼圖合集切片。


void instance_geometry_set_lod_bias(instance: RID, lod_bias: float) 🔗

為指定的 3D 幾何體實例設定要使用的細節級別偏置。值越高,距離較遠時的細節也會越高。等價於 GeometryInstance3D.lod_bias


void instance_geometry_set_material_overlay(instance: RID, material: RID) 🔗

設定一個材質,該材質將在與該實例關聯的網格的活動材質之上,為所有表面算繪。相當於GeometryInstance3D.material_overlay


void instance_geometry_set_material_override(instance: RID, material: RID) 🔗

設定一種材質,該材質將覆蓋與此實例關聯的網格上的所有表面的材質。相當於 GeometryInstance3D.material_override


void instance_geometry_set_shader_parameter(instance: RID, parameter: StringName, value: Variant) 🔗

設定指定的 3D 幾何體實例的單實例著色器 uniform。等價於 GeometryInstance3D.set_instance_shader_parameter()


void instance_geometry_set_transparency(instance: RID, transparency: float) 🔗

設定給定幾何體實例的透明度。相當於 GeometryInstance3D.transparency

透明度為 0.0 時完全不透明,為 1.0 時則完全透明。如果值比 0.0 大,則會強制讓幾何體的材質經過透明管線,算繪起來相對較慢,可能由於錯誤的透明排序而產生算繪問題。不過,與使用透明材質不同,將 transparency 設定為比 0.0 大的值不會禁用陰影的算繪。

在空間著色器中,內建 ALPHA 的預設值為 1.0 - transparency

注意:transparency 會被鉗制在 0.01.0 的範圍內,所以這個屬性無法讓透明材質比原來更不透明。


void instance_geometry_set_visibility_range(instance: RID, min: float, max: float, min_margin: float, max_margin: float, fade_mode: VisibilityRangeFadeMode) 🔗

設定給定幾何實例的可見性範圍值。相當於 GeometryInstance3D.visibility_range_begin 和相關屬性。


void instance_set_base(instance: RID, base: RID) 🔗

設定實例的基礎。基礎可以是在 RenderingServer 中建立的任何可以顯示的 3D 物件。例如,任何光源型別、網格、多重網格、粒子系統、反射探查、裝飾、光照貼圖、體素 GI 和可見性通知器都可以設定為實例的基礎,以便在場景中顯示。


void instance_set_blend_shape_weight(instance: RID, shape: int, weight: float) 🔗

設定與該實例相關的特定混合形狀的權重。


void instance_set_custom_aabb(instance: RID, aabb: AABB) 🔗

設定將物件從視錐中剔除時使用的自訂 AABB。相當於設定 GeometryInstance3D.custom_aabb


void instance_set_extra_visibility_margin(instance: RID, margin: float) 🔗

設定將對象從視錐中剔除時為 AABB 增加的邊距大小。這樣就可以避免剔除落在視錐外的對象。相當於 GeometryInstance3D.extra_cull_margin


void instance_set_ignore_culling(instance: RID, enabled: bool) 🔗

If true, ignores all culling on the specified 3D geometry instance, including frustum culling, occlusion culling, and layer culling. This is not the same as GeometryInstance3D.ignore_occlusion_culling, which only ignores occlusion culling but leaves frustum and layer culling intact.


void instance_set_layer_mask(instance: RID, mask: int) 🔗

設定這個實例要繪製到的算繪層。相當於 VisualInstance3D.layers


void instance_set_pivot_data(instance: RID, sorting_offset: float, use_aabb_center: bool) 🔗

設定排序偏移量,並在使用包圍框還是實例原點進行深度排序之間進行切換。


void instance_set_scenario(instance: RID, scenario: RID) 🔗

設定實例所在的場景。場景是物件將在其中顯示的 3D 世界。


void instance_set_surface_override_material(instance: RID, surface: int, material: RID) 🔗

設定指定表面的覆蓋材質。相當於 MeshInstance3D.set_surface_override_material()


void instance_set_transform(instance: RID, transform: Transform3D) 🔗

Sets the world space transform of the instance. Equivalent to Node3D.global_transform.


void instance_set_visibility_parent(instance: RID, parent: RID) 🔗

設定給定實例的可見性父級。相當於 Node3D.visibility_parent


void instance_set_visible(instance: RID, visible: bool) 🔗

設定是否繪製實例。相當於 Node3D.visible


void instance_teleport(instance: RID) 🔗

Resets motion vectors and other interpolated values. Use this after teleporting a mesh from one position to another to avoid ghosting artifacts.


PackedInt64Array instances_cull_aabb(aabb: AABB, scenario: RID = RID()) const 🔗

返回與提供的 AABB 相交的物件 ID 的陣列。僅考慮繼承自 VisualInstance3D 的 3D 節點,例如 MeshInstance3DDirectionalLight3D。可使用 @GlobalScope.instance_from_id() 來獲取實際節點。必須提供一個場景 RID,且它在要查詢的 World3D 中可用。這會強制更新所有已被佇列以等待更新的資源。

警告:該函式主要供編輯器使用。對於遊戲中的用例,最好是物理碰撞。


PackedInt64Array instances_cull_convex(convex: Array[Plane], scenario: RID = RID()) const 🔗

返回與提供的凸形相交的物件 ID 的陣列。僅考慮繼承自 VisualInstance3D 的 3D 節點,例如 MeshInstance3DDirectionalLight3D。可使用 @GlobalScope.instance_from_id() 以獲取實際節點。必須提供場景 RID,且它在要查詢的 World3D 中可用。這會強制更新所有已被佇列以等待更新的資源。

警告:該函式主要供編輯器使用。對於遊戲中的用例,最好是物理碰撞。


PackedInt64Array instances_cull_ray(from: Vector3, to: Vector3, scenario: RID = RID()) const 🔗

返回與提供的 3D 射線相交的物件 ID 的陣列。僅考慮繼承自 VisualInstance3D 的 3D 節點,例如 MeshInstance3DDirectionalLight3D。可使用 @GlobalScope.instance_from_id() 以獲取實際節點。必須提供場景 RID,且它在你要查詢的 World3D 中可用。這會強制更新所有已被佇列以等待更新的資源。

警告:該函式主要供編輯器使用。對於遊戲中的用例,最好是物理碰撞。


bool is_on_render_thread() 🔗

Returns true if our code is currently executing on the rendering thread.


void light_area_set_normalize_energy(light: RID, enable: bool) 🔗

Defines whether the energy of an AreaLight3D is normalized (divided) by its area. If set to true, changing the size does not affect the total energy output. Equivalent to AreaLight3D.area_normalize_energy.


void light_area_set_size(light: RID, size: Vector2) 🔗

Sets the extents (width and height) in meters for this area light. Equivalent to AreaLight3D.area_size.


void light_directional_set_blend_splits(light: RID, enable: bool) 🔗

如果為 true,則該平行光將在陰影貼圖分割之間混合,從而在它們之間產生更平滑的過渡。相當於 DirectionalLight3D.directional_shadow_blend_splits


void light_directional_set_shadow_mode(light: RID, mode: LightDirectionalShadowMode) 🔗

Sets the shadow mode for this directional light. Equivalent to DirectionalLight3D.directional_shadow_mode.


void light_directional_set_sky_mode(light: RID, mode: LightDirectionalSkyMode) 🔗

如果為 true,則該燈光將不會被用於除天空著色器之外的任何內容。將其用於影響天空著色器的燈光,可能希望隱藏這些燈光以免影響場景的其餘部分。例如,當天空著色器中的太陽落在地平線以下時,可能希望啟用該功能。


void light_omni_set_shadow_mode(light: RID, mode: LightOmniShadowMode) 🔗

設定是使用雙抛物面還是立方體貼圖作為陰影貼圖。雙抛物面速度更快,但可能會出現偽影。相當於 OmniLight3D.omni_shadow_mode


void light_projectors_set_filter(filter: LightProjectorFilter) 🔗

設定算繪光線投射器時使用的紋理篩選模式。這個參數是全域的,不能單獨針對某個燈光進行設定。


void light_set_bake_mode(light: RID, bake_mode: LightBakeMode) 🔗

設定指定 3D 燈光所使用的烘焙模式。相當於 Light3D.light_bake_mode


void light_set_color(light: RID, color: Color) 🔗

設定燈光的顏色。相當於 Light3D.light_color


void light_set_cull_mask(light: RID, mask: int) 🔗

設定該 3D 燈光的剔除遮罩。燈光僅影響選定層中的物件。相當於 Light3D.light_cull_mask


void light_set_distance_fade(decal: RID, enabled: bool, begin: float, shadow: float, length: float) 🔗

設定該 3D 燈光的淡入淡出距離。這充當了一種多細節層次(LOD)的形式,可用於提高性能。相當於 Light3D.distance_fade_enabledLight3D.distance_fade_beginLight3D.distance_fade_shadowLight3D.distance_fade_length


void light_set_max_sdfgi_cascade(light: RID, cascade: int) 🔗

設定算繪 3D 燈光間接光照時的 SDFGI 最大級聯數。較高的值能夠讓遠離相機的燈光在 SDFGI 中算繪。


void light_set_negative(light: RID, enable: bool) 🔗

如果為 true,則該 3D 燈光會扣除光照而不是增加。等價於 Light3D.light_negative


void light_set_param(light: RID, param: LightParam, value: float) 🔗

Sets the specified 3D light parameter. Equivalent to Light3D.set_param().


void light_set_projector(light: RID, texture: RID) 🔗

設定指定 3D 燈光使用的投射器紋理。等價於 Light3D.light_projector


void light_set_reverse_cull_face_mode(light: RID, enabled: bool) 🔗

如果為 true,則反轉網格的背面剔除。當有一個背後有燈光的平面網格時,這會很有用。如果需要在網格的兩側投射陰影,請使用 instance_geometry_set_cast_shadows_setting(),將網格設定為使用雙面陰影。相當於 Light3D.shadow_reverse_cull_face


void light_set_shadow(light: RID, enabled: bool) 🔗

如果為 true,則燈光會投射陰影。相當於 Light3D.shadow_enabled


void light_set_shadow_caster_mask(light: RID, mask: int) 🔗

Sets the shadow caster mask for this 3D light. Shadows will only be cast using objects in the selected layers. Equivalent to Light3D.shadow_caster_mask.


RID lightmap_create() 🔗

新建全域光照的光照貼圖並將其新增到 RenderingServer。可以通過返回的 RID 進行訪問。這個 RID 會在所有 lightmap_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:與其等價的資源為 LightmapGI


PackedInt32Array lightmap_get_probe_capture_bsp_tree(lightmap: RID) const 🔗

Returns the BSP tree data used for accelerating probe lookups. The BSP data is structured as a series of six signed 32-bit values per BSP node in this order: float plane_x, float plane_y, float plane_z, float plane_distance, int32_t over, int32_t under. An empty leaf is denoted by the value -2147483648 (the minimum 32-bit signed integer). See also lightmap_set_probe_capture_data().


PackedVector3Array lightmap_get_probe_capture_points(lightmap: RID) const 🔗

Returns the local space positions of each lightmap probe capture point. Keep in mind the lightmap instance may have a non-zero transform, which will affect the position of the probe capture points. See also lightmap_set_probe_capture_data().


PackedColorArray lightmap_get_probe_capture_sh(lightmap: RID) const 🔗

Returns the L0, L1, and L2 spherical harmonics data for each lightmap probe capture point. This is specified as 9 Color values per probe, which means the size of the returned data is always 9 times the number of probe points. See also lightmap_set_probe_capture_data().


PackedInt32Array lightmap_get_probe_capture_tetrahedra(lightmap: RID) const 🔗

Returns the tetrahedralization data used for interpolating between lightmap probe capture points. Each tetrahedron is specified as a series of 4 numbers, each being an index into the probe capture points array returned by lightmap_get_probe_capture_points(). See also lightmap_set_probe_capture_data().


void lightmap_set_baked_exposure_normalization(lightmap: RID, baked_exposure: float) 🔗

用於通知算繪器在烘焙光照貼圖時使用的曝光正規化值。該值將在運作時被使用和被調制,以確保即使場景範圍的曝光正規化值在運作時發生變化,光照貼圖也能保持一致的曝光水平。有關詳細資訊,請參閱 camera_attributes_set_exposure()


void lightmap_set_probe_bounds(lightmap: RID, bounds: AABB) 🔗

Sets the bounds that this lightmap instance should visually affect, both in terms of static lightmap baking and probe-based global illumination.


void lightmap_set_probe_capture_data(lightmap: RID, points: PackedVector3Array, point_sh: PackedColorArray, tetrahedra: PackedInt32Array, bsp_tree: PackedInt32Array) 🔗

Sets the probe capture data for the given lightmap instance. See lightmap_get_probe_capture_points(), lightmap_get_probe_capture_sh(), lightmap_get_probe_capture_tetrahedra(), and lightmap_get_probe_capture_bsp_tree() for the expected data formats.


void lightmap_set_probe_capture_update_speed(speed: float) 🔗

The framerate-independent update speed when representing dynamic object lighting from LightmapProbes. Higher values make dynamic object lighting update faster. Higher values can prevent fast-moving objects from having "outdated" indirect lighting displayed on them, at the cost of possible flickering when an object moves from a bright area to a shaded area. See also ProjectSettings.rendering/lightmapping/probe_capture/update_speed.


void lightmap_set_probe_interior(lightmap: RID, interior: bool) 🔗

Sets whether the lightmap instance should be considered as interior (when interior is true). If the lightmap is marked as interior, environment lighting is ignored when baking lightmaps.


void lightmap_set_textures(lightmap: RID, light: RID, uses_sh: bool) 🔗

將給定光照貼圖 lightmap GI 實例的紋理設定為 light RID 所指向的紋理陣列。如果烘焙光照貼圖紋理時的 LightmapGI.directionaltrue,則 uses_sh 也必須為 true


void lightmaps_set_bicubic_filter(enable: bool) 🔗

Toggles whether a bicubic filter should be used when lightmaps are sampled. This smoothens their appearance at a performance cost.


RID make_sphere_mesh(latitudes: int, longitudes: int, radius: float) 🔗

返回球體網格,具有給定數量的水平細分、垂直細分、半徑。另見 get_test_cube()


RID material_create() 🔗

建立空材質並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 material_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:與其等價的資源為 Material


Variant material_get_param(material: RID, parameter: StringName) const 🔗

返回特定材質的參數值。


void material_set_next_pass(material: RID, next_material: RID) 🔗

設定物件的下一個材質。


void material_set_param(material: RID, parameter: StringName, value: Variant) 🔗

設定材質的參數。


void material_set_render_priority(material: RID, priority: int) 🔗

設定材質的算繪優先順序。


void material_set_shader(shader_material: RID, shader: RID) 🔗

設定著色器材質的著色器。


void material_set_use_debanding(enable: bool) 🔗

When using the Mobile renderer, material_set_use_debanding() can be used to enable or disable the debanding feature of 3D materials (BaseMaterial3D and ShaderMaterial).

material_set_use_debanding() has no effect when using the Compatibility or Forward+ renderer. In Forward+, Viewport debanding can be used instead.

See also ProjectSettings.rendering/anti_aliasing/quality/use_debanding and viewport_set_use_debanding().


void mesh_add_surface(mesh: RID, surface: Dictionary) 🔗

Creates a new surface on the given mesh. Equivalent to mesh_add_surface_from_arrays(), but takes a single Dictionary argument instead of separate arguments. The dictionary must follow this structure:

{
    # Required:
    "primitive": RenderingServer.PrimitiveType,
    "format": RenderingServer.ArrayFormat,
    "vertex_data": PackedByteArray,
    "vertex_count": int,
    "aabb": AABB,

    # Optional:
    "attribute_data": PackedByteArray,
    "skin_data": PackedByteArray,
    "index_data": PackedByteArray,
    "index_count": int, # Required if `index_data` is specified.
    "uv_scale": Vector4,
    "lods": [
        # Both values are required for each LOD level.
        {
            "edge_length": float,
            "index_data": PackedByteArray,
        },
    ],
    "bone_aabbs": Array[AABB],
    "blend_shape_data": PackedByteArray,
    "material": Material,
}

See also mesh_get_surface(), which returns data in the same structure defined above.


void mesh_add_surface_from_arrays(mesh: RID, primitive: PrimitiveType, arrays: Array, blend_shapes: Array = [], lods: Dictionary = {}, compress_format: BitField[ArrayFormat] = 0) 🔗

Creates a new surface on the given mesh. mesh_get_surface_count() will become the surface index for this new surface.

Surfaces are created to be rendered using a primitive, which may be any of the values defined in PrimitiveType.

The arrays argument is an array of arrays. Each of the Mesh.ARRAY_MAX elements contains an array with some of the mesh data for this surface as described by the corresponding member of ArrayType or null if it is not used by the surface. For example, arrays[0] is the array of vertices. That first vertex sub-array is always required; the others are optional. Adding an index array puts this surface into "index mode" where the vertex and other arrays become the sources of data and the index array defines the vertex order. All sub-arrays must have the same length as the vertex array (or be an exact multiple of the vertex array's length, when multiple elements of a sub-array correspond to a single vertex) or be empty, except for Mesh.ARRAY_INDEX if it is used.

The blend_shapes argument is an array of vertex data for each blend shape. Each element is an array of the same structure as arrays, but Mesh.ARRAY_VERTEX, Mesh.ARRAY_NORMAL, and Mesh.ARRAY_TANGENT are set if and only if they are set in arrays and all other entries are null.

The lods argument is a dictionary with float keys and PackedInt32Array values. Each entry in the dictionary represents an LOD level of the surface, where the value is the Mesh.ARRAY_INDEX array to use for the LOD level and the key is roughly proportional to the distance at which the LOD stats being used. I.e., increasing the key of an LOD also increases the distance that the objects has to be from the camera before the LOD is used.

The compress_format argument is the bitwise OR of, as required: One value of ArrayFormat left shifted by ARRAY_FORMAT_CUSTOMn_SHIFT for each custom channel in use, ARRAY_FLAG_USE_DYNAMIC_UPDATE, ARRAY_FLAG_USE_8_BONE_WEIGHTS, or ARRAY_FLAG_USES_EMPTY_VERTEX_ARRAY.

See ArrayMesh.add_surface_from_arrays() and ImporterMesh.add_surface() for higher-level equivalents of this method.

Note: When using indices, it is recommended to only use points, lines, or triangles.


void mesh_clear(mesh: RID) 🔗

移除網格中的所有表面。


RID mesh_create() 🔗

新建網格並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 mesh_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個網格放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:與其等價的資源為 Mesh


RID mesh_create_from_surfaces(surfaces: Array[Dictionary], blend_shape_count: int = 0) 🔗

Creates a new mesh with predefined surfaces for it and adds the mesh to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all mesh_* RenderingServer functions. This method is more efficient for creating meshes with multiple surfaces compared to creating an empty mesh with mesh_create() and adding surfaces one by one with mesh_add_surface().

Each element in the surfaces array must follow the same structure as described in mesh_add_surface(). The blend_shape_count parameter must match the blend shape data defined in all surfaces.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

To place in a scene, attach this mesh to an instance using instance_set_base() using the returned RID.

Note: The equivalent resource is Mesh.


int mesh_get_blend_shape_count(mesh: RID) const 🔗

返回一個網格的混合形狀數量。


BlendShapeMode mesh_get_blend_shape_mode(mesh: RID) const 🔗

返回網格的混合形狀模式。


AABB mesh_get_custom_aabb(mesh: RID) const 🔗

返回網格的自訂 AABB。


Dictionary mesh_get_surface(mesh: RID, surface: int) 🔗

Returns a mesh's surface as a dictionary following the same structure as described in mesh_add_surface().


int mesh_get_surface_count(mesh: RID) const 🔗

返回網格的面數。


void mesh_set_blend_shape_mode(mesh: RID, mode: BlendShapeMode) 🔗

設定網格的混合形狀模式。


void mesh_set_custom_aabb(mesh: RID, aabb: AABB) 🔗

設定網格的自訂 AABB。


void mesh_set_shadow_mesh(mesh: RID, shadow_mesh: RID) 🔗

Sets an optional second mesh which can be used for rendering shadows and the depth prepass. Can be used to increase performance by supplying a mesh with fused vertices and only vertex position data (without normals, UVs, colors, etc.).

Note: This mesh must have exactly the same vertex positions as the source mesh (including the source mesh's LODs, if present). If vertex positions differ, then the mesh will not draw correctly.


Array mesh_surface_get_arrays(mesh: RID, surface: int) const 🔗

返回網格表面的緩衝區陣列。


Array[Array] mesh_surface_get_blend_shape_arrays(mesh: RID, surface: int) const 🔗

返回網格表面的混合形狀陣列。


int mesh_surface_get_format_attribute_stride(format: BitField[ArrayFormat], vertex_count: int) const 🔗

Returns the stride of the attribute buffer for a mesh with given format.


int mesh_surface_get_format_index_stride(format: BitField[ArrayFormat], vertex_count: int) const 🔗

Returns the stride of the index buffer for a mesh with the given format.


int mesh_surface_get_format_normal_tangent_stride(format: BitField[ArrayFormat], vertex_count: int) const 🔗

Returns the stride of the combined normals and tangents for a mesh with given format. Note importantly that, while normals and tangents are in the vertex buffer with vertices, they are only interleaved with each other and so have a different stride than vertex positions.


int mesh_surface_get_format_offset(format: BitField[ArrayFormat], vertex_count: int, array_index: int) const 🔗

Returns the offset of a given attribute by array_index in the start of its respective buffer.


int mesh_surface_get_format_skin_stride(format: BitField[ArrayFormat], vertex_count: int) const 🔗

Returns the stride of the skin buffer for a mesh with given format.


int mesh_surface_get_format_vertex_stride(format: BitField[ArrayFormat], vertex_count: int) const 🔗

Returns the stride of the vertex positions for a mesh with given format. Note importantly that vertex positions are stored consecutively and are not interleaved with the other attributes in the vertex buffer (normals and tangents).


RID mesh_surface_get_material(mesh: RID, surface: int) const 🔗

返回網格表面的材質。


void mesh_surface_remove(mesh: RID, surface: int) 🔗

從 Mesh 中移除指定索引的曲面,並將較高索引的曲面依序下移一位。


void mesh_surface_set_material(mesh: RID, surface: int, material: RID) 🔗

設定網格表面的材質。


void mesh_surface_update_attribute_region(mesh: RID, surface: int, offset: int, data: PackedByteArray) 🔗

Updates the attribute buffer of the mesh surface with the given data. The expected data per attribute is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with mesh_surface_get_format_attribute_stride() instead.

The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each attribute.

A PackedVector3Array of attribute locations can be converted into a PackedByteArray using PackedVector3Array.to_byte_array() for use in data.


void mesh_surface_update_index_region(mesh: RID, surface: int, offset: int, data: PackedByteArray) 🔗

Updates the index buffer of the mesh surface with the given data. The expected data are 16 or 32-bit unsigned integers, which can be determined with mesh_surface_get_format_index_stride().


void mesh_surface_update_skin_region(mesh: RID, surface: int, offset: int, data: PackedByteArray) 🔗

Updates the skin buffer of the mesh surface with the given data. The expected data per skin is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with mesh_surface_get_format_skin_stride() instead.

The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each skin.

A PackedVector3Array of skin locations can be converted into a PackedByteArray using PackedVector3Array.to_byte_array() for use in data.


void mesh_surface_update_vertex_region(mesh: RID, surface: int, offset: int, data: PackedByteArray) 🔗

Updates the vertex buffer of the mesh surface with the given data. The expected data per vertex is 8 or 12 bytes (4 bytes per float, 2 floats per Vector2, and 3 floats per Vector3) depending on if the mesh is using Vector2 or Vector3 vertices. This value can be determined with mesh_surface_get_format_vertex_stride() instead.

The starting point of the updates can be changed with offset. The value of offset should be a multiple of 12 bytes in most cases to align to each vertex.

A PackedVector3Array of vertex locations can be converted into a PackedByteArray using PackedVector3Array.to_byte_array() for use in data.


void multimesh_allocate_data(multimesh: RID, instances: int, transform_format: MultimeshTransformFormat, color_format: bool = false, custom_data_format: bool = false, use_indirect: bool = false) 🔗

Sets up the multimesh using the specified data. The number of instances is set by instances. The format of the instance transforms is set by transform_format, which should be set according to whether the multimesh is meant to be rendered in 2D or 3D. If color_format is true, each instance will have a color associated with it. If custom_data_format is true, each instance will have a custom data vector associated with it. If use_indirect is true, an indirect command buffer will be created for this multimesh, allowing the instance count to be modified directly on the GPU. See also multimesh_get_command_buffer_rd_rid().


RID multimesh_create() 🔗

新建多網格並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 multimesh_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個多網格放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:與其等價的資源為 MultiMesh


AABB multimesh_get_aabb(multimesh: RID) const 🔗

計算並返回軸對齊的邊界框,該邊界框將所有的實例都包含在 multimesh 中。


PackedFloat32Array multimesh_get_buffer(multimesh: RID) const 🔗

Returns the MultiMesh data (such as instance transforms, colors, etc.). See multimesh_set_buffer() for details on the returned data.

Note: If the buffer is in the engine's internal cache, it will have to be fetched from GPU memory and possibly decompressed. This means multimesh_get_buffer() is potentially a slow operation and should be avoided whenever possible.


RID multimesh_get_buffer_rd_rid(multimesh: RID) const 🔗

Returns the RenderingDevice RID handle of the MultiMesh, which can be used as any other buffer on the Rendering Device.


RID multimesh_get_command_buffer_rd_rid(multimesh: RID) const 🔗

Returns the RenderingDevice RID handle of the MultiMesh command buffer. This RID is only valid if use_indirect is set to true when allocating data through multimesh_allocate_data(). It can be used to directly modify the instance count via buffer.

The data structure is dependent on both how many surfaces the mesh contains and whether it is indexed or not, the buffer has 5 integers in it, with the last unused if the mesh is not indexed.

Each of the values in the buffer correspond to these options:

Indexed:
  0 - indexCount;
  1 - instanceCount;
  2 - firstIndex;
  3 - vertexOffset;
  4 - firstInstance;
Non-indexed:
  0 - vertexCount;
  1 - instanceCount;
  2 - firstVertex;
  3 - firstInstance;
  4 - unused;

AABB multimesh_get_custom_aabb(multimesh: RID) const 🔗

Returns the custom AABB defined for this MultiMesh resource.


int multimesh_get_instance_count(multimesh: RID) const 🔗

返回分配給這個 multimesh 的實例的數量。


RID multimesh_get_mesh(multimesh: RID) const 🔗

返回用於繪製此 multimesh 的 RID。


int multimesh_get_visible_instances(multimesh: RID) const 🔗

返回此 multimesh 的可見實例數。


Color multimesh_instance_get_color(multimesh: RID, index: int) const 🔗

返回指定實例將被調變的顏色。


Color multimesh_instance_get_custom_data(multimesh: RID, index: int) const 🔗

返回與指定實例相關的自訂資料。


Transform3D multimesh_instance_get_transform(multimesh: RID, index: int) const 🔗

返回指定實例的 Transform3D


Transform2D multimesh_instance_get_transform_2d(multimesh: RID, index: int) const 🔗

返回指定實例的 Transform2D。只在 multimesh 設定為使用 2D 變換時使用。


void multimesh_instance_reset_physics_interpolation(multimesh: RID, index: int) 🔗

Prevents physics interpolation for the specified instance during the current physics tick.

This is useful when moving an instance to a new location, to give an instantaneous change rather than interpolation from the previous location.


void multimesh_instance_set_color(multimesh: RID, index: int, color: Color) 🔗

設定這個實例的調變顏色。相當於 MultiMesh.set_instance_color()


void multimesh_instance_set_custom_data(multimesh: RID, index: int, custom_data: Color) 🔗

為這個實例設定自訂資料。自訂資料以 Color 的形式傳遞,但在著色器中會被解釋為 vec4。相當於 MultiMesh.set_instance_custom_data()


void multimesh_instance_set_transform(multimesh: RID, index: int, transform: Transform3D) 🔗

為此實例設定 Transform3D。相當於 MultiMesh.set_instance_transform()


void multimesh_instance_set_transform_2d(multimesh: RID, index: int, transform: Transform2D) 🔗

為此實例設定 Transform2D。用於在 2D 中使用 multimesh 時。相當於 MultiMesh.set_instance_transform_2d()


void multimesh_instances_reset_physics_interpolation(multimesh: RID) 🔗

Prevents physics interpolation for all instances during the current physics tick.

This is useful when moving all instances to new locations, to give instantaneous changes rather than interpolation from the previous locations.


void multimesh_set_buffer(multimesh: RID, buffer: PackedFloat32Array) 🔗

Set the entire data to use for drawing the multimesh at once to buffer (such as instance transforms and colors). buffer's size must match the number of instances multiplied by the per-instance data size (which depends on the enabled MultiMesh fields). Otherwise, an error message is printed and nothing is rendered. See also multimesh_get_buffer().

The per-instance data size and expected data order is:

2D:
  - Position: 8 floats (8 floats for Transform2D)
  - Position + Vertex color: 12 floats (8 floats for Transform2D, 4 floats for Color)
  - Position + Custom data: 12 floats (8 floats for Transform2D, 4 floats of custom data)
  - Position + Vertex color + Custom data: 16 floats (8 floats for Transform2D, 4 floats for Color, 4 floats of custom data)
3D:
  - Position: 12 floats (12 floats for Transform3D)
  - Position + Vertex color: 16 floats (12 floats for Transform3D, 4 floats for Color)
  - Position + Custom data: 16 floats (12 floats for Transform3D, 4 floats of custom data)
  - Position + Vertex color + Custom data: 20 floats (12 floats for Transform3D, 4 floats for Color, 4 floats of custom data)

Instance transforms are in row-major order. Specifically:

  • For Transform2D the float-order is: (x.x, y.x, padding_float, origin.x, x.y, y.y, padding_float, origin.y).

  • For Transform3D the float-order is: (basis.x.x, basis.y.x, basis.z.x, origin.x, basis.x.y, basis.y.y, basis.z.y, origin.y, basis.x.z, basis.y.z, basis.z.z, origin.z).


void multimesh_set_buffer_interpolated(multimesh: RID, buffer: PackedFloat32Array, buffer_previous: PackedFloat32Array) 🔗

Alternative version of multimesh_set_buffer() for use with physics interpolation.

Takes both an array of current data and an array of data for the previous physics tick.


void multimesh_set_custom_aabb(multimesh: RID, aabb: AABB) 🔗

Sets the custom AABB for this MultiMesh resource.


void multimesh_set_mesh(multimesh: RID, mesh: RID) 🔗

設定 Multimesh 所要繪製的網格。相當於 MultiMesh.mesh


void multimesh_set_physics_interpolated(multimesh: RID, interpolated: bool) 🔗

Turns on and off physics interpolation for this MultiMesh resource.


void multimesh_set_physics_interpolation_quality(multimesh: RID, quality: MultimeshPhysicsInterpolationQuality) 🔗

Sets the physics interpolation quality for the MultiMesh.

A value of MULTIMESH_INTERP_QUALITY_FAST gives fast but low quality interpolation, a value of MULTIMESH_INTERP_QUALITY_HIGH gives slower but higher quality interpolation.


void multimesh_set_visible_instances(multimesh: RID, visible: int) 🔗

設定在給定時間內可見的實例的數量。如果是 -1,所有被分配的實例都會被畫出來。相當於 MultiMesh.visible_instance_count


RID occluder_create() 🔗

建立遮擋器實例並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 occluder_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:與其等價的資源為 Occluder3D(請勿與 OccluderInstance3D 節點混淆)。


void occluder_set_mesh(occluder: RID, vertices: PackedVector3Array, indices: PackedInt32Array) 🔗

設定給定遮擋器 RID 的網格資料,控制執行遮擋剔除時的形狀。


RID omni_light_create() 🔗

建立一個新的全向燈並將其新增到 RenderingServer。可以使用返回的 RID 存取它。該 RID 可用於大多數 light_* RenderingServer 函式。

一旦使用 RID 完成操作後,需要使用 RenderingServer 的方法 free_rid() 來釋放該 RID。

要放置在場景中,請使用 instance_set_base() 使用該返回的 RID 將該全向燈附加到一個實例。

注意:等價節點為 OmniLight3D


RID particles_collision_create() 🔗

新建 3D GPU 粒子碰撞或吸引器並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 particles_collision_* RenderingServer 函式中使用。

注意:等價節點為 GPUParticlesCollision3DGPUParticlesAttractor3D


void particles_collision_height_field_update(particles_collision: RID) 🔗

請求對 3D GPU 粒子碰撞高度圖進行更新。3D GPU 粒子碰撞高度圖可能會自動呼叫這個函式,取決於 GPUParticlesCollisionHeightField3D.update_mode


void particles_collision_set_attractor_attenuation(particles_collision: RID, curve: float) 🔗

為 RID 為 particles_collision 的 3D GPU 粒子吸引器設定衰減曲線 curve。僅用於吸引器,對碰撞體不適用。等價於 GPUParticlesAttractor3D.attenuation


void particles_collision_set_attractor_directionality(particles_collision: RID, amount: float) 🔗

設定 3D GPU 粒子吸引器的方向量 amount,吸引器由 RID particles_collision 指定。僅用於吸引器,不適用於碰撞體。等價於 GPUParticlesAttractor3D.directionality


void particles_collision_set_attractor_strength(particles_collision: RID, strength: float) 🔗

設定 3D GPU 粒子吸引器的強度 strength,吸引器由 RID particles_collision 指定。僅用於吸引器,不適用於碰撞體。等價於 GPUParticlesAttractor3D.strength


void particles_collision_set_box_extents(particles_collision: RID, extents: Vector3) 🔗

設定 3D GPU 粒子吸引器的範圍 extents,吸引器由 RID particles_collision 指定。根據 particles_collision 型別的不同,等價於 GPUParticlesCollisionBox3D.sizeGPUParticlesCollisionSDF3D.sizeGPUParticlesCollisionHeightField3D.sizeGPUParticlesAttractorBox3D.sizeGPUParticlesAttractorVectorField3D.size


void particles_collision_set_collision_type(particles_collision: RID, type: ParticlesCollisionType) 🔗

設定 3D GPU 粒子碰撞或吸引器的形狀型別 type,碰撞或吸引器由 RID particles_collision 指定。


void particles_collision_set_cull_mask(particles_collision: RID, mask: int) 🔗

設定 3D GPU 粒子碰撞或吸引器的剔除遮罩 mask,碰撞或吸引器由 RID particles_collision 指定。根據 particles_collision 型別的不同,等價於 GPUParticlesCollision3D.cull_maskGPUParticlesAttractor3D.cull_mask


void particles_collision_set_field_texture(particles_collision: RID, texture: RID) 🔗

設定 3D GPU 粒子碰撞的帶符號距離場紋理 texture,碰撞由 RID particles_collision 指定。根據 particles_collision 型別的不同,等價於 GPUParticlesCollisionSDF3D.textureGPUParticlesAttractorVectorField3D.texture


void particles_collision_set_height_field_mask(particles_collision: RID, mask: int) 🔗

Sets the heightfield mask for the 3D GPU particles heightfield collision specified by the particles_collision RID. Equivalent to GPUParticlesCollisionHeightField3D.heightfield_mask.


void particles_collision_set_height_field_resolution(particles_collision: RID, resolution: ParticlesCollisionHeightfieldResolution) 🔗

設定 3D GPU 粒子高度圖碰撞的高度圖解析度 resolution,碰撞由 RID particles_collision 指定。等價於 GPUParticlesCollisionHeightField3D.resolution


void particles_collision_set_sphere_radius(particles_collision: RID, radius: float) 🔗

設定 3D GPU 粒子球體碰撞或吸引器的半徑 radius,碰撞或吸引器由 RID particles_collision 指定。根據 particles_collision 型別的不同,等價於 GPUParticlesCollisionSphere3D.radiusGPUParticlesAttractorSphere3D.radius


RID particles_create() 🔗

建立基於 GPU 的粒子系統並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 particles_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個粒子系統放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:等價節點為 GPUParticles2DGPUParticles3D

注意:所有 particles_* 方法都僅適用於基於 GPU 的粒子,不適用於基於 CPU 的粒子。RenderingServer 中沒有 CPUParticles2DCPUParticles3D 的等價函式,因為這兩個節點底層使用的是 MultiMeshInstance2DMultiMeshInstance3D(見 multimesh_* 方法)。


void particles_emit(particles: RID, transform: Transform3D, velocity: Vector3, color: Color, custom: Color, emit_flags: int) 🔗

particles 實例中手動發射粒子。


AABB particles_get_current_aabb(particles: RID) 🔗

計算並返回包含所有粒子的軸對齊邊界框。相當於 GPUParticles3D.capture_aabb()


bool particles_get_emitting(particles: RID) 🔗

如果目前粒子被設定發射,則返回 true


bool particles_is_inactive(particles: RID) 🔗

如果粒子沒有發射並且粒子設定為非活動狀態,則返回 true


void particles_request_process(particles: RID) 🔗

將粒子系統新增到需要更新的粒子系統列表中。更新將在下一影格或下一次呼叫 instances_cull_aabb()instances_cull_convex()instances_cull_ray() 時進行。


void particles_request_process_time(particles: RID, process_time: float, process_time_residual: float = 0.0) 🔗

Requests the particles to process for extra process time during a single frame.

process_time defines the time that the particles will process while emitting is on. process_time_residual defines the time that particles will process with emitting turned off for the simulation. When combined with the particles' speed scale set to 0.0, this is useful to be able to seek a particle system timeline.


void particles_restart(particles: RID) 🔗

下次更新時重設粒子。相當於 GPUParticles3D.restart()


void particles_set_amount(particles: RID, amount: int) 🔗

設定要繪製的粒子的數量,並為其分配記憶體。相當於 GPUParticles3D.amount


void particles_set_amount_ratio(particles: RID, ratio: float) 🔗

Sets the amount ratio for particles to be emitted. Equivalent to GPUParticles3D.amount_ratio.


void particles_set_collision_base_size(particles: RID, size: float) 🔗

Sets the base size for particle collision. Equivalent to GPUParticles3D.collision_base_size.


void particles_set_custom_aabb(particles: RID, aabb: AABB) 🔗

設定粒子系統的自訂軸對齊邊界框。相當於 GPUParticles3D.visibility_aabb


void particles_set_draw_order(particles: RID, order: ParticlesDrawOrder) 🔗

Sets the draw order of the particles. Equivalent to GPUParticles3D.draw_order.


void particles_set_draw_pass_mesh(particles: RID, pass: int, mesh: RID) 🔗

設定用於指定繪製階段的網格。相當於 GPUParticles3D.draw_pass_1GPUParticles3D.draw_pass_2GPUParticles3D.draw_pass_3、和 GPUParticles3D.draw_pass_4


void particles_set_draw_passes(particles: RID, count: int) 🔗

設定要使用的繪製階段的數量。相當於 GPUParticles3D.draw_passes


void particles_set_emission_transform(particles: RID, transform: Transform3D) 🔗

設定粒子首次發射時使用的 Transform3D


void particles_set_emitter_velocity(particles: RID, velocity: Vector3) 🔗

Sets the velocity of a particle node, that will be used by ParticleProcessMaterial.inherit_velocity_ratio.


void particles_set_emitting(particles: RID, emitting: bool) 🔗

If true, particles will emit over time. Setting to false does not reset the particles, but only stops their emission. Equivalent to GPUParticles3D.emitting.


void particles_set_explosiveness_ratio(particles: RID, ratio: float) 🔗

設定爆發比例。相當於 GPUParticles3D.explosiveness


void particles_set_fixed_fps(particles: RID, fps: int) 🔗

設定粒子系統算繪的固定影格率。相當於 GPUParticles3D.fixed_fps


void particles_set_fractional_delta(particles: RID, enable: bool) 🔗

如果為 true,則使用分數差異量來平滑粒子的運動。相當於 GPUParticles3D.fract_delta


void particles_set_interp_to_end(particles: RID, factor: float) 🔗

Sets the value that informs a ParticleProcessMaterial to rush all particles towards the end of their lifetime.


void particles_set_interpolate(particles: RID, enable: bool) 🔗

Sets whether particles should use interpolation between fixed steps. Equivalent to GPUParticles3D.interpolate.


void particles_set_lifetime(particles: RID, lifetime: float) 🔗

設定系統中每個粒子的生命週期。相當於 GPUParticles3D.lifetime


void particles_set_mode(particles: RID, mode: ParticlesMode) 🔗

設定由 RID particles 指定的 GPU 粒子是否應該根據 mode 在 2D 或 3D 中算繪。


void particles_set_one_shot(particles: RID, one_shot: bool) 🔗

如果為 true,則粒子將發射一次然後停止。相當於 GPUParticles3D.one_shot


void particles_set_pre_process_time(particles: RID, time: float) 🔗

設定粒子動畫的預處理時間。這樣可以讓動畫延遲到粒子開始發射之後再開始。相當於 GPUParticles3D.preprocess


void particles_set_process_material(particles: RID, material: RID) 🔗

設定用於處理粒子的材質。

注意:這不是用來繪製材質的材質。相當於 GPUParticles3D.process_material


void particles_set_randomness_ratio(particles: RID, ratio: float) 🔗

設定發射隨機性比例。會隨機化該粒子在其相位內的發射。相當於 GPUParticles3D.randomness


void particles_set_speed_scale(particles: RID, scale: float) 🔗

設定粒子系統的速度縮放。相當於 GPUParticles3D.speed_scale


void particles_set_subemitter(particles: RID, subemitter_particles: RID) 🔗

Sets the subemitter particles for the particle system. Equivalent to GPUParticles3D.sub_emitter.


void particles_set_trail_bind_poses(particles: RID, bind_poses: Array[Transform3D]) 🔗

Sets the trail bind poses for the particle system. This specified as an array of Transform3Ds representing the bind pose for each draw pass. See GPUParticles3D.draw_skin, Skin.get_bind_count(), and Skin.get_bind_pose(). Set the value for each draw pass to Transform3D.IDENTITY to use the default behavior, which is what built-in trails use (RibbonTrailMesh and TubeTrailMesh).


void particles_set_trails(particles: RID, enable: bool, length_sec: float) 🔗

如果 enabletrue,則會為 particles 啟用尾跡,長度為 length_sec 秒。等價於 GPUParticles3D.trail_enabledGPUParticles3D.trail_lifetime


void particles_set_transform_align(particles: RID, align: ParticlesTransformAlign) 🔗

Sets the transform alignment for the particle system. Equivalent to GPUParticles3D.transform_align.


void particles_set_transform_align_axis(particles: RID, rotation_axis: ParticlesTransformAlignAxis) 🔗

Sets which axis to use for transform alignment.


void particles_set_transform_align_channel_filter(particles: RID, channel_filter: ParticlesTransformAlignCustomSrc) 🔗

When using Z-Billboarding, which CUSTOM channel to read from.


void particles_set_use_local_coordinates(particles: RID, enable: bool) 🔗

如果為 true,則粒子使用局部座標。如果為 false 則使用全域座標。相當於 GPUParticles3D.local_coords


void positional_soft_shadow_filter_set_quality(quality: ShadowQuality) 🔗

設定 3D 全向燈和聚光燈陰影的篩選品質。另見 ProjectSettings.rendering/lights_and_shadows/positional_shadow/soft_shadow_filter_quality。這個參數是全域的,無法針對單個視口設定。


RID reflection_probe_create() 🔗

建立反射探查並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 reflection_probe_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個反射探查放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。

注意:等價節點為 ReflectionProbe


void reflection_probe_set_ambient_color(probe: RID, color: Color) 🔗

設定反射探查的自訂環境光顏色。等價於 ReflectionProbe.ambient_color


void reflection_probe_set_ambient_energy(probe: RID, energy: float) 🔗

設定反射探查的自訂環境光能量。等價於 ReflectionProbe.ambient_color_energy


void reflection_probe_set_ambient_mode(probe: RID, mode: ReflectionProbeAmbientMode) 🔗

設定反射探查的環境光模式。等價於 ReflectionProbe.ambient_mode


void reflection_probe_set_as_interior(probe: RID, enable: bool) 🔗

如果為 true,則反射將忽略天空的貢獻。相當於 ReflectionProbe.interior


void reflection_probe_set_blend_distance(probe: RID, blend_distance: float) 🔗

Sets the distance in meters over which a probe blends into the scene.


void reflection_probe_set_cull_mask(probe: RID, layers: int) 🔗

Sets the render cull mask for this reflection probe. Only instances with a matching layer will be reflected by this probe. Equivalent to ReflectionProbe.cull_mask.


void reflection_probe_set_enable_box_projection(probe: RID, enable: bool) 🔗

如果為 true,則使用箱體投影。這可以使反射在某些情況下看起來更正確。相當於 ReflectionProbe.box_projection


void reflection_probe_set_enable_shadows(probe: RID, enable: bool) 🔗

如果為 true,計算反射探查中的陰影。這會使得反射的計算速度慢得多。相當於 ReflectionProbe.enable_shadows


void reflection_probe_set_intensity(probe: RID, intensity: float) 🔗

設定反射探查的強度。強度調節反射的強度。相當於 ReflectionProbe.intensity


void reflection_probe_set_max_distance(probe: RID, distance: float) 🔗

設定物體在被刪除前與探查的最大距離。相當於 ReflectionProbe.max_distance


void reflection_probe_set_mesh_lod_threshold(probe: RID, pixels: float) 🔗

設定算繪反射探查時所使用的網格細節級別。值越高,生成了 LOD 變體的網格所使用的版本細節就越低,能夠提升性能。等價於 ReflectionProbe.mesh_lod_threshold


void reflection_probe_set_origin_offset(probe: RID, offset: Vector3) 🔗

設定當此反射探查處於框專案模式時要使用的源偏移。相當於 ReflectionProbe.origin_offset


void reflection_probe_set_reflection_mask(probe: RID, layers: int) 🔗

Sets the render reflection mask for this reflection probe. Only instances with a matching layer will have reflections applied from this probe. Equivalent to ReflectionProbe.reflection_mask.


void reflection_probe_set_resolution(probe: RID, resolution: int) 🔗

已棄用: This method has not done anything since Godot 3.

Deprecated. This method does nothing.


void reflection_probe_set_size(probe: RID, size: Vector3) 🔗

設定反射探查將捕獲的區域的大小。相當於 ReflectionProbe.size


void reflection_probe_set_update_mode(probe: RID, mode: ReflectionProbeUpdateMode) 🔗

Sets how often the reflection probe updates. Can either be once or every frame.


void request_frame_drawn_callback(callable: Callable) 🔗

安排對給定可呼叫體的回呼函式,會在一影格繪製完成後回呼函式。


RID scenario_create() 🔗

建立場景並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 scenario_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

場景是所有可視實例存在的 3D 世界。


void scenario_set_camera_attributes(scenario: RID, effects: RID) 🔗

設定該場景會使用的相機屬性(effects)。另見 CameraAttributes


void scenario_set_compositor(scenario: RID, compositor: RID) 🔗

Sets the compositor (compositor) that will be used with this scenario. See also Compositor.


void scenario_set_environment(scenario: RID, environment: RID) 🔗

設定該場景會使用的環境。另見 Environment


void scenario_set_fallback_environment(scenario: RID, environment: RID) 🔗

設定此方案所使用的後備環境。如果沒有設定環境,則使用後備環境。這被編輯器用來提供一個預設環境。


void screen_space_roughness_limiter_set_active(enable: bool, amount: float, limit: float) 🔗

設定螢幕空間粗糙度限制參數,例如是否應該啟用以及閾值等。等價於 ProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/enabledProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/amountProjectSettings.rendering/anti_aliasing/screen_space_roughness_limiter/limit


void set_boot_image(image: Image, color: Color, scale: bool, use_filter: bool = true) 🔗

已棄用: Use set_boot_image_with_stretch() instead.

Sets a boot image. The color defines the background color. The value of scale indicates if the image will be scaled to fit the screen size. If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.


void set_boot_image_with_stretch(image: Image, color: Color, stretch_mode: SplashStretchMode, use_filter: bool = true) 🔗

Sets a boot image. The color defines the background color. The value of stretch_mode indicates how the image will be stretched (see SplashStretchMode for possible values). If use_filter is true, the image will be scaled with linear interpolation. If use_filter is false, the image will be scaled with nearest-neighbor interpolation.


void set_debug_generate_wireframes(generate: bool) 🔗

If generate is true, generates debug wireframes for all meshes that are loaded when using the Compatibility renderer. By default, the engine does not generate debug wireframes at runtime, since they slow down loading of assets and take up VRAM.

Note: You must call this method before loading any meshes when using the Compatibility renderer. Otherwise, wireframes will not be used.


void set_default_clear_color(color: Color) 🔗

設定預設清屏顏色,會在尚未選擇特定的清屏顏色時使用。另見 get_default_clear_color()


RID shader_create() 🔗

建立空的著色器並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 shader_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 Shader


String shader_get_code(shader: RID) const 🔗

以字串形式返回著色器的原始程式碼。


RID shader_get_default_texture_parameter(shader: RID, name: StringName, index: int = 0) const 🔗

返回著色器中的預設紋理,根據名稱搜索。

注意:如果使用了取樣器陣列,請使用 index 存取指定的紋理。


Variant shader_get_parameter_default(shader: RID, name: StringName) const 🔗

返回指定著色器 Uniform 的預設值。通常是著色器原始程式碼中編寫的值。


void shader_set_code(shader: RID, code: String) 🔗

設定著色器的原始程式碼(更改後會出發重新編譯)。


void shader_set_default_texture_parameter(shader: RID, name: StringName, texture: RID, index: int = 0) 🔗

設定著色器的預設紋理。覆蓋給定名稱的紋理。

注意:使用取樣器陣列時,使用 index 存取指定的紋理。


void shader_set_path_hint(shader: RID, path: String) 🔗

設定指定著色器路徑提示。一般應該與 Shader 資源的 Resource.resource_path 相配對。


void skeleton_allocate_data(skeleton: RID, bones: int, is_2d_skeleton: bool = false) 🔗

Allocates data for this skeleton using the number of bones specified in bones. If is_2d_skeleton is true, the skeleton will be treated as a 2D skeleton instead of a 3D skeleton. See also skeleton_get_bone_count().


Transform3D skeleton_bone_get_transform(skeleton: RID, bone: int) const 🔗

返回該骨架中指定骨骼的 Transform3D


Transform2D skeleton_bone_get_transform_2d(skeleton: RID, bone: int) const 🔗

返回該骨架中指定骨骼的 Transform2D


void skeleton_bone_set_transform(skeleton: RID, bone: int, transform: Transform3D) 🔗

設定該骨架中指定骨骼的 Transform3D


void skeleton_bone_set_transform_2d(skeleton: RID, bone: int, transform: Transform2D) 🔗

設定該骨架中指定骨骼的 Transform2D


RID skeleton_create() 🔗

建立骨架並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 skeleton_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。


int skeleton_get_bone_count(skeleton: RID) const 🔗

Returns the number of bones allocated for this skeleton. See also skeleton_allocate_data().


void skeleton_set_base_transform_2d(skeleton: RID, base_transform: Transform2D) 🔗

Sets the base Transform2D to use for the specified skeleton.


Image sky_bake_panorama(sky: RID, energy: float, bake_irradiance: bool, size: Vector2i) 🔗

Generates and returns an Image containing the radiance map for the specified sky RID. This supports built-in sky material and custom sky shaders. If bake_irradiance is true, the irradiance map is saved instead of the radiance map. The radiance map is used to render reflected light, while the irradiance map is used to render ambient light. See also environment_bake_panorama().

Note: The image is saved using linear encoding without any tonemapping performed, which means it will look too dark if viewed directly in an image editor. energy values above 1.0 can be used to brighten the resulting image.

Note: size should be a 2:1 aspect ratio for the generated panorama to have square pixels. For radiance maps, there is no point in using a height greater than Sky.radiance_size, as it won't increase detail. Irradiance maps only contain low-frequency data, so there is usually no point in going past a size of 128×64 pixels when saving an irradiance map.


RID sky_create() 🔗

建立空的天空並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 sky_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。


void sky_set_material(sky: RID, material: RID) 🔗

設定天空用於算繪背景和反射貼圖的材質。


void sky_set_mode(sky: RID, mode: SkyMode) 🔗

設定 RID 為 sky 的天空的處理模式 mode。等價於 Sky.process_mode


void sky_set_radiance_size(sky: RID, radiance_size: int) 🔗

設定 RID 為 sky 的天空的輻照大小 radiance_size(單位為像素)。等價於 Sky.radiance_size


RID spot_light_create() 🔗

建立聚光燈並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在大多數 light_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

如果要將這個聚光燈放置到場景中,請使用返回的 RID 呼叫 instance_set_base(),將其附加至某個實例上。


void sub_surface_scattering_set_quality(quality: SubSurfaceScatteringQuality) 🔗

設定算繪啟用了次表面散射的材質時使用的 ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_quality


void sub_surface_scattering_set_scale(scale: float, depth_scale: float) 🔗

設定算繪啟用了次表面散射的材質時使用的 ProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_scaleProjectSettings.rendering/environment/subsurface_scattering/subsurface_scattering_depth_scale


RID texture_2d_create(image: Image) 🔗

建立二維紋理並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 texture_2d_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 Texture2D

注意:請勿與 RenderingDevice.texture_create() 混淆,後者建立的是圖形 API 自己的紋理型別,並非 Godot 專屬的 Texture2D 資源。


Image texture_2d_get(texture: RID) const 🔗

Returns an Image instance from the given texture RID.

Example: Get the test texture from get_test_texture() and apply it to a Sprite2D node:

var texture_rid = RenderingServer.get_test_texture()
var texture = ImageTexture.create_from_image(RenderingServer.texture_2d_get(texture_rid))
$Sprite2D.texture = texture

Image texture_2d_layer_get(texture: RID, layer: int) const 🔗

返回給定 texture RIDlayer 中的 Image 實例。


RID texture_2d_layered_create(layers: Array[Image], layered_type: TextureLayeredType) 🔗

建立二維多層紋理並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 texture_2d_layered_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 TextureLayered


RID texture_2d_layered_placeholder_create(layered_type: TextureLayeredType) 🔗

建立二維多層紋理的預留位置並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 texture_2d_layered_* RenderingServer 函數中使用,但使用時什麼都不會發生。另見 texture_2d_placeholder_create()

注意:等價資源為 PlaceholderTextureLayered


RID texture_2d_placeholder_create() 🔗

Creates a placeholder for a 2-dimensional layered texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_2d_layered_* RenderingServer functions, although it does nothing when used. See also texture_2d_layered_placeholder_create().

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

Note: The equivalent resource is PlaceholderTexture2D.


void texture_2d_update(texture: RID, image: Image, layer: int) 🔗

使用 image 中的資料更新由紋理 RID texture 指定的紋理。layer 也必須指定,更新單層紋理(Texture2D)時應為 0

注意:image 的寬度、高度、格式都必須和目前 texture 的資料相同。否則會輸出錯誤,不會修改原始紋理。如果你需要使用不同的寬度、高度或格式,請改用 texture_replace()


RID texture_3d_create(format: Format, width: int, height: int, depth: int, mipmaps: bool, data: Array[Image]) 🔗

注意:等價的資源是 Texture3D


Array[Image] texture_3d_get(texture: RID) const 🔗

Image 陣列的形式返回指定紋理 RID 的 3D 紋理資料。


RID texture_3d_placeholder_create() 🔗

建立三維紋理的預留位置並將其新增到 RenderingServer。可以通過返回的 RID 進行訪問。這個 RID 會在所有 texture_3d_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價資源為 PlaceholderTexture3D


void texture_3d_update(texture: RID, data: Array[Image]) 🔗

使用 data 中的資料更新由紋理 RID texture 指定的紋理。必須同時更新所有紋理層。

注意:texture 的寬度、高度、格式都必須和目前紋理資料相同。否則會輸出錯誤,不會修改原始紋理。如果你需要使用不同的寬度、高度或格式,請改用 texture_replace()


RID texture_create_from_native_handle(type: TextureType, format: Format, native_handle: int, width: int, height: int, depth: int, layers: int = 1, layered_type: TextureLayeredType = 0) 🔗

Creates a texture based on a native handle that was created outside of Godot's renderer.

Note: If using only the rendering device renderer, it's recommend to use RenderingDevice.texture_create_from_extension() together with texture_rd_create(), rather than this method. This way, the texture's format and usage can be controlled more effectively.


void texture_drawable_blit_rect(textures: Array[RID], rect: Rect2i, material: RID, modulate: Color, source_textures: Array[RID], to_mipmap: int = 0) 🔗

Draws to rect on up to 4 given Drawable textures, using a TextureBlit Shader from material. modulate and up to 4 source_textures are uniforms for the Shader to process with. to_mipmap can specify to perform this draw to a lower mipmap level.

Note: All textures must be the same size and format.


RID texture_drawable_create(width: int, height: int, format: TextureDrawableFormat, color: Color = Color(1, 1, 1, 1), with_mipmaps: bool = false) 🔗

Creates a 2-dimensional texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all texture_drawable* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

Note: The equivalent resource is DrawableTexture2D.


void texture_drawable_generate_mipmaps(texture: RID) 🔗

Calculates new MipMaps for the given Drawable texture.


RID texture_drawable_get_default_material() const 🔗

Returns a ShaderMaterial with the default texture_blit Shader.


Format texture_get_format(texture: RID) const 🔗

Returns the format for the texture.


int texture_get_native_handle(texture: RID, srgb: bool = false) const 🔗

Returns the internal graphics handle for this texture object. For use when communicating with third-party APIs mostly with GDExtension.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.

Note: This function returns a uint64_t which internally maps to a GLuint (OpenGL) or VkImage (Vulkan).


String texture_get_path(texture: RID) const 🔗

Returns the resource path (starting with res:// or uid://) for the specified texture RID. Returns an empty String if the resource is built-in. See also texture_set_path().


RID texture_get_rd_texture(texture: RID, srgb: bool = false) const 🔗

Returns a texture RID that can be used with RenderingDevice.

srgb should be true when the texture uses nonlinear sRGB encoding and false when the texture uses linear encoding.


RID texture_proxy_create(base: RID) 🔗

已棄用: ProxyTexture was removed in Godot 4.

This method does nothing and always returns an invalid RID.


void texture_proxy_update(texture: RID, proxy_to: RID) 🔗

已棄用: ProxyTexture was removed in Godot 4.

This method does nothing.


RID texture_rd_create(rd_texture: RID, layer_type: TextureLayeredType = 0) 🔗

Creates a new texture object based on a texture created directly on the RenderingDevice. If the texture contains layers, layer_type is used to define the layer type.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

Note: The RenderingServer's free_rid() won't free the underlying rd_texture, you will want to free the rd_texture using RenderingDevice.free_rid().


void texture_replace(texture: RID, by_texture: RID) 🔗

texture 的紋理資料替換為由紋理 RID by_texture 指定的紋理,不會改變 texture 的 RID。


void texture_set_force_redraw_if_visible(texture: RID, enable: bool) 🔗

Sets whether the texture RID should force redrawing when it's visible on screen when OS.low_processor_usage_mode is true. This is used by AnimatedTexture to force redrawing.


void texture_set_path(texture: RID, path: String) 🔗

Sets the resource path for this texture RID. See also texture_get_path().

Note: This is purely a hint and does not cause the texture to be automatically saved when set to a res:// path.


void texture_set_size_override(texture: RID, width: int, height: int) 🔗

Sets the size at which the texture should be displayed in 2D, ignoring its original size. This does not rescale the texture data itself, only how it is drawn in 2D. Set width and height to 0 to disable the size override.


void viewport_attach_camera(viewport: RID, camera: RID) 🔗

設定視圖的相機。


void viewport_attach_canvas(viewport: RID, canvas: RID) 🔗

設定視口的畫布。


void viewport_attach_to_screen(viewport: RID, rect: Rect2 = Rect2(0, 0, 0, 0), screen: int = 0) 🔗

Copies the viewport to a region of the screen specified by rect. If viewport_set_render_direct_to_screen() is true, then the 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():
    RenderingServer.viewport_attach_to_screen(get_viewport().get_viewport_rid(), Rect2())
    RenderingServer.viewport_attach_to_screen($Viewport.get_viewport_rid(), 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 further optimization, see viewport_set_render_direct_to_screen().


RID viewport_create() 🔗

建立空的視口並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 viewport_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 Viewport


float viewport_get_measured_render_time_cpu(viewport: RID) const 🔗

返回算繪上一影格所消耗的 CPU 時間,單位為毫秒。只包含算繪相關操作所消耗的時間;讀數中不含腳本的 _process 函式及其他引擎子系統。要獲取算繪場景所消耗 CPU 時間的完整讀數,請將每影格繪製的所有視口的算繪時間以及 get_frame_setup_time_cpu() 相加。與 Engine.get_frames_per_second() 不同,即便影格率受到垂直同步或 Engine.max_fps 的限制,這個方法也會精確反映 CPU 利用率。另見 viewport_get_measured_render_time_gpu()

注意:需要使用 viewport_set_measure_render_time() 啟用 viewport 的測量。否則這個方法會返回 0.0


float viewport_get_measured_render_time_gpu(viewport: RID) const 🔗

Returns the GPU time taken to render the last frame in milliseconds. To get a complete readout of GPU time spent to render the scene, sum the render times of all viewports that are drawn every frame. Unlike Engine.get_frames_per_second(), this method accurately reflects GPU utilization even if framerate is capped via V-Sync or Engine.max_fps. See also viewport_get_measured_render_time_cpu().

Note: Requires measurements to be enabled on the specified viewport using viewport_set_measure_render_time(). Otherwise, this method returns 0.0.

Note: When GPU utilization is low enough during a certain period of time, GPUs will decrease their power state (which in turn decreases core and memory clock speeds). This can cause the reported GPU time to increase if GPU utilization is kept low enough by a framerate cap (compared to what it would be at the GPU's highest power state). Keep this in mind when benchmarking using viewport_get_measured_render_time_gpu(). This behavior can be overridden in the graphics driver settings at the cost of higher power usage.


int viewport_get_render_info(viewport: RID, type: ViewportRenderInfoType, info: ViewportRenderInfo) 🔗

Returns a statistic about the rendering engine which can be used for performance profiling. This is separated into render pass types, each of them having the same infos you can query (different passes will return different values).

See also get_rendering_info(), which returns global information across all viewports.

Note: Viewport rendering information is not available until at least 2 frames have been rendered by the engine. If rendering information is not available, viewport_get_render_info() returns 0. To print rendering information in _ready() successfully, use the following:

func _ready():
    for _i in 2:
        await get_tree().process_frame

    print(
            RenderingServer.viewport_get_render_info(get_viewport().get_viewport_rid(),
            RenderingServer.VIEWPORT_RENDER_INFO_TYPE_VISIBLE,
            RenderingServer.VIEWPORT_RENDER_INFO_DRAW_CALLS_IN_FRAME)
    )

RID viewport_get_render_target(viewport: RID) const 🔗

返回該視口的算繪目標。


RID viewport_get_texture(viewport: RID) const 🔗

返回視口的最後算繪影格。


ViewportUpdateMode viewport_get_update_mode(viewport: RID) const 🔗

Returns the viewport's update mode.

Warning: Calling this from any thread other than the rendering thread will be detrimental to performance.


void viewport_remove_canvas(viewport: RID, canvas: RID) 🔗

Detaches a viewport from a canvas.


void viewport_set_active(viewport: RID, active: bool) 🔗

如果為 true,則將視口設定為活動狀態,否則將其設定為非活動狀態。


void viewport_set_anisotropic_filtering_level(viewport: RID, anisotropic_filtering_level: ViewportAnisotropicFiltering) 🔗

Sets the maximum number of samples to take when using anisotropic filtering on textures (as a power of two). A higher sample count will result in sharper textures at oblique angles, but is more expensive to compute. A value of 0 forcibly disables anisotropic filtering, even on materials where it is enabled.

The anisotropic filtering level also affects decals and light projectors if they are configured to use anisotropic filtering. See ProjectSettings.rendering/textures/decals/filter and ProjectSettings.rendering/textures/light_projectors/filter.

Note: In 3D, for this setting to have an effect, set BaseMaterial3D.texture_filter to BaseMaterial3D.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC or BaseMaterial3D.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC on materials.

Note: In 2D, for this setting to have an effect, set CanvasItem.texture_filter to CanvasItem.TEXTURE_FILTER_LINEAR_WITH_MIPMAPS_ANISOTROPIC or CanvasItem.TEXTURE_FILTER_NEAREST_WITH_MIPMAPS_ANISOTROPIC on the CanvasItem node displaying the texture (or in CanvasTexture). However, anisotropic filtering is rarely useful in 2D, so only enable it for textures in 2D if it makes a meaningful visual difference.


void viewport_set_canvas_cull_mask(viewport: RID, canvas_cull_mask: int) 🔗

設定與此 Viewport 關聯的算繪遮罩。算繪可見層與之配對的 CanvasItem 節點才會被此 Viewport 算繪。


void viewport_set_canvas_stacking(viewport: RID, canvas: RID, layer: int, sublayer: int) 🔗

Sets the stacking order for a viewport's canvas.

layer is the actual canvas layer, while sublayer specifies the stacking order of the canvas among those in the same layer.

Note: layer should be between CANVAS_LAYER_MIN and CANVAS_LAYER_MAX (inclusive). Any other value will wrap around.


void viewport_set_canvas_transform(viewport: RID, canvas: RID, offset: Transform2D) 🔗

設定視口畫布的變換。


void viewport_set_clear_mode(viewport: RID, clear_mode: ViewportClearMode) 🔗

Sets the clear mode of a viewport.


void viewport_set_debug_draw(viewport: RID, draw: ViewportDebugDraw) 🔗

Sets the debug draw mode of a viewport.


void viewport_set_default_canvas_item_texture_filter(viewport: RID, filter: CanvasItemTextureFilter) 🔗

Sets the default texture filtering mode for the specified viewport RID.


void viewport_set_default_canvas_item_texture_repeat(viewport: RID, repeat: CanvasItemTextureRepeat) 🔗

Sets the default texture repeat mode for the specified viewport RID.


void viewport_set_disable_2d(viewport: RID, disable: bool) 🔗

如果為 true,則不算繪視口的畫布(即 2D 和 GUI 元素)。


void viewport_set_disable_3d(viewport: RID, disable: bool) 🔗

如果為 true,則不算繪視口的 3D 元素。


void viewport_set_environment_mode(viewport: RID, mode: ViewportEnvironmentMode) 🔗

設定視口的環境模式,該模式允許啟用或禁用 2D 畫布上的 3D 環境算繪。禁用時,2D 將不受環境影響。啟用時,如果環境背景模式為 ENV_BG_CANVAS,則 2D 會受到環境的影響。預設行為是從視口的父級繼承設定。如果最頂層的父級也被設定為 VIEWPORT_ENVIRONMENT_INHERIT,則該行為將與設定為 VIEWPORT_ENVIRONMENT_ENABLED 時相同。


void viewport_set_fsr_sharpness(viewport: RID, sharpness: float) 🔗

決定使用 FSR 放大模式時放大圖像的清晰度。每個整數的銳度減半。值從 0.0(最銳利)到 2.0。高於 2.0 的值不會產生明顯的差異。


void viewport_set_global_canvas_transform(viewport: RID, transform: Transform2D) 🔗

設定視口的全域變換矩陣。


void viewport_set_measure_render_time(viewport: RID, enable: bool) 🔗

為給定的 viewport RID(使用 Viewport.get_viewport_rid() 獲取)設定是否測量。啟用後,使用給定的 viewportviewport_get_measured_render_time_cpu()viewport_get_measured_render_time_gpu() 進行查詢返回的就是大於 0.0 的值。


void viewport_set_msaa_2d(viewport: RID, msaa: ViewportMSAA) 🔗

Sets the multisample antialiasing mode for 2D/Canvas on the specified viewport RID. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/msaa_2d or Viewport.msaa_2d.


void viewport_set_msaa_3d(viewport: RID, msaa: ViewportMSAA) 🔗

Sets the multisample antialiasing mode for 3D on the specified viewport RID. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/msaa_3d or Viewport.msaa_3d.


void viewport_set_occlusion_culling_build_quality(quality: ViewportOcclusionCullingBuildQuality) 🔗

設定遮擋剔除的 ProjectSettings.rendering/occlusion_culling/bvh_build_quality。這個參數是全域的,無法針對特定視口設定。


void viewport_set_occlusion_rays_per_thread(rays_per_thread: int) 🔗

設定遮擋剔除的 ProjectSettings.rendering/occlusion_culling/occlusion_rays_per_thread。這個參數是全域的,無法針對特定視口設定。


void viewport_set_parent_viewport(viewport: RID, parent_viewport: RID) 🔗

將該視口的父項設定為 parent_viewport RID 指定的視口。


void viewport_set_positional_shadow_atlas_quadrant_subdivision(viewport: RID, quadrant: int, subdivision: int) 🔗

設定全向燈和聚光燈陰影的指定陰影合集象限 quadrant 的細分次數。另見 Viewport.set_positional_shadow_atlas_quadrant_subdiv()


void viewport_set_positional_shadow_atlas_size(viewport: RID, size: int, use_16_bits: bool = false) 🔗

設定陰影合集圖像的大小(用於全向燈和聚光燈),大小由 size 指定,生效的視口由 viewport RID 指定。該值將向上四捨五入到最接近的 2 次冪。如果 use_16_bitstrue,則會使用 16 位的全向燈/聚光燈陰影深度貼圖。啟用後,陰影的精度會降低,可能造成陰影失真,但能夠在部分裝置上提升性能。

注意:如果設定為 0,將根本看不到任何陰影。可以通過降低 CPU 和 GPU 負載來顯著提升在低端系統上的性能(因為繪製不帶陰影的場景需要的繪製呼叫更少)。


void viewport_set_render_direct_to_screen(viewport: RID, enabled: bool) 🔗

如果為 true,則將視口的內容直接算繪到螢幕。這允許一個低級別的優化,可以跳過將視口繪製到根視口。雖然這種優化可以顯著提高速度(尤其是在舊裝置上),但它是以可用性為代價的。啟用後,無法從視口或 screen_texture 讀取。而且還會失去某些視窗設定的好處,例如各種拉伸模式。另一個需要注意的後果是,在 2D 中,算繪是以視窗座標進行的,所以如果有一個兩倍於視窗大小的視口,並且設定了這個屬性,那麼只會繪製適合視窗的部分, 無法自動縮放,即使遊戲場景明顯大於視窗大小。


void viewport_set_scaling_3d_mode(viewport: RID, scaling_3d_mode: ViewportScaling3DMode) 🔗

設定 3D 解析度縮放模式。雙線性縮放使用不同的解析度算繪,能夠對視口進行欠取樣或超取樣。FidelityFX 超解析度 1.0,縮寫為 FSR,是一種放大技術,通過使用空間感知放大演算法以快速畫面播放速率生成高品質圖像。FSR 比雙線性的開銷略大,但產生的圖像質量明顯更高。應盡可能使用 FSR。


void viewport_set_scaling_3d_scale(viewport: RID, scale: float) 🔗

根據視圖大小,縮放 3D 算繪緩衝區,使用 ViewportScaling3DMode 中指定的圖像篩檢程式,將輸出圖像縮放到完整視圖大小。低於 1.0 的值,可用於加速 3D 算繪,但會以品質為代價(欠取樣)。大於 1.0 的值,僅對雙線性模式有效,可用於以較高的性能成本(超級取樣),提高 3D 算繪品質。另請參閱 ViewportMSAA 以瞭解多重取樣抗鋸齒,這要便宜得多,但只會平滑多邊形的邊緣。

在使用 FSR 放大時,AMD 建議將以下值,作為預設選項公開給使用者:“超品質:0.77”、“品質:0.67”、“平衡:0.59”、“性能:0.5”,而不是公開整個比例。


void viewport_set_scenario(viewport: RID, scenario: RID) 🔗

設定視口的場景。該場景包含環境、反射合集等資訊。


void viewport_set_screen_space_aa(viewport: RID, mode: ViewportScreenSpaceAA) 🔗

Sets the viewport's screen-space antialiasing mode. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/screen_space_aa or Viewport.screen_space_aa.


void viewport_set_sdf_oversize_and_scale(viewport: RID, oversize: ViewportSDFOversize, scale: ViewportSDFScale) 🔗

設定視口的 2D 帶符號距離場的 ProjectSettings.rendering/2d/sdf/oversizeProjectSettings.rendering/2d/sdf/scale。在 CanvasItem 著色器中對帶符號距離場進行取樣時會用到,GPUParticles2D 碰撞時也會用到。3D 算繪時的 SDFGI 不會使用。


void viewport_set_size(viewport: RID, width: int, height: int, view_count: int = 1) 🔗

Sets the viewport's width and height in pixels. Optionally the view_count can be set to increase the number of view layers for stereo rendering.


void viewport_set_snap_2d_transforms_to_pixel(viewport: RID, enabled: bool) 🔗

如果為 true,則畫布項的變換(即原點的位置)會在算繪時吸附到整像素。這樣外觀看上去就會更銳利,但會影響移動的平滑程度,尤其是在啟用了 Camera2D 平滑的情況下。等價於 ProjectSettings.rendering/2d/snap/snap_2d_transforms_to_pixel


void viewport_set_snap_2d_vertices_to_pixel(viewport: RID, enabled: bool) 🔗

如果為 true,則畫布項的頂點(即多邊形的點)會在算繪時吸附到整像素。這樣外觀看上去就會更銳利,但會影響移動的平滑程度,尤其是在啟用了 Camera2D 平滑的情況下。等價於 ProjectSettings.rendering/2d/snap/snap_2d_vertices_to_pixel


void viewport_set_texture_mipmap_bias(viewport: RID, mipmap_bias: float) 🔗

Affects the final texture sharpness by reading from a lower or higher mipmap (also called "texture LOD bias"). Negative values make mipmapped textures sharper but grainier when viewed at a distance, while positive values make mipmapped textures blurrier (even when up close). To get sharper textures at a distance without introducing too much graininess, set this between -0.75 and 0.0. Enabling temporal antialiasing (ProjectSettings.rendering/anti_aliasing/quality/use_taa) can help reduce the graininess visible when using negative mipmap bias.

Note: When the 3D scaling mode is set to FSR 1.0, this value is used to adjust the automatic mipmap bias which is calculated internally based on the scale factor. The formula for this is -log2(1.0 / scale) + mipmap_bias.

Note: This method is only supported in the Forward+ and Mobile renderers, not Compatibility. In Compatibility, this method is always treated as if mipmap_bias was set to 0.0.


void viewport_set_transparent_background(viewport: RID, enabled: bool) 🔗

如果為 true,視口將其背景算繪為透明。


void viewport_set_update_mode(viewport: RID, update_mode: ViewportUpdateMode) 🔗

Sets when the viewport should be updated.


void viewport_set_use_debanding(viewport: RID, enable: bool) 🔗

Equivalent to Viewport.use_debanding. See also ProjectSettings.rendering/anti_aliasing/quality/use_debanding.


void viewport_set_use_hdr_2d(viewport: RID, enabled: bool) 🔗

If true, 2D rendering will use a high dynamic range (HDR) RGBA16 format framebuffer. Additionally, 2D rendering will be performed on linear values and will be converted using the appropriate transfer function immediately before blitting to the screen (if the Viewport is attached to the screen).

Practically speaking, this means that the end result of the Viewport will not be clamped to the 0-1 range and can be used in 3D rendering without color encoding adjustments. This allows 2D rendering to take advantage of effects requiring high dynamic range (e.g. 2D glow) as well as substantially improves the appearance of effects requiring highly detailed gradients. This setting has the same effect as Viewport.use_hdr_2d.


void viewport_set_use_occlusion_culling(viewport: RID, enable: bool) 🔗

如果為 true,則在指定的視口上啟用遮擋剔除。等價於 ProjectSettings.rendering/occlusion_culling/use_occlusion_culling


void viewport_set_use_taa(viewport: RID, enable: bool) 🔗

If true, use temporal antialiasing. Equivalent to ProjectSettings.rendering/anti_aliasing/quality/use_taa or Viewport.use_taa.


void viewport_set_use_xr(viewport: RID, use_xr: bool) 🔗

如果為 true,則視口使用增強或虛擬實境技術。參閱 XRInterface


void viewport_set_vrs_mode(viewport: RID, mode: ViewportVRSMode) 🔗

設定視口的可變速率著色(VRS)模式。如果 GPU 不支援 VRS 則會忽略該屬性。等價於 ProjectSettings.rendering/vrs/mode


void viewport_set_vrs_texture(viewport: RID, texture: RID) 🔗

當 VRS 模式設定為 VIEWPORT_VRS_TEXTURE 時,要使用的紋理。等價於 ProjectSettings.rendering/vrs/texture


void viewport_set_vrs_update_mode(viewport: RID, mode: ViewportVRSUpdateMode) 🔗

Sets the update mode for Variable Rate Shading (VRS) for the viewport. VRS requires the input texture to be converted to the format usable by the VRS method supported by the hardware. The update mode defines how often this happens. If the GPU does not support VRS, or VRS is not enabled, this property is ignored.

If set to VIEWPORT_VRS_UPDATE_ONCE, the input texture is copied once and the mode is changed to VIEWPORT_VRS_UPDATE_DISABLED.


RID visibility_notifier_create() 🔗

Creates a new 3D visibility notifier object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all visibility_notifier_* RenderingServer functions.

Once finished with your RID, you will want to free the RID using the RenderingServer's free_rid() method.

To place in a scene, attach this notifier to an instance using instance_set_base() using the returned RID.

Note: The equivalent node is VisibleOnScreenNotifier3D.


void visibility_notifier_set_aabb(notifier: RID, aabb: AABB) 🔗

Sets the AABB of the specified visibility notifier.


void visibility_notifier_set_callbacks(notifier: RID, enter_callable: Callable, exit_callable: Callable) 🔗

Sets the methods to be called when the notifier enters or exits the view.


void voxel_gi_allocate_data(voxel_gi: RID, to_cell_xform: Transform3D, aabb: AABB, octree_size: Vector3i, octree_cells: PackedByteArray, data_cells: PackedByteArray, distance_field: PackedByteArray, level_counts: PackedInt32Array) 🔗

Allocates and initializes the voxel GI data for the specified voxel_gi RID. octree_cells must be a multiple of 32. octree_cells must be double the size of data_cells. The allocated data can be retrieved later using the various voxel_gi_get_* methods.


RID voxel_gi_create() 🔗

新建基於體素的全域光照物件並將其新增到 RenderingServer。可以通過返回的 RID 進行存取。這個 RID 會在所有 voxel_gi_* RenderingServer 函式中使用。

RID 使用結束後,應該使用 RenderingServer 的 free_rid() 方法進行釋放。

注意:等價節點為 VoxelGI


PackedByteArray voxel_gi_get_data_cells(voxel_gi: RID) const 🔗

Returns the data cells for the specified voxel GI data instance. See also voxel_gi_allocate_data().


PackedByteArray voxel_gi_get_distance_field(voxel_gi: RID) const 🔗

Returns the distance field data for the specified voxel GI data instance. See also voxel_gi_allocate_data().


PackedInt32Array voxel_gi_get_level_counts(voxel_gi: RID) const 🔗

Returns the level counts for the specified voxel GI data instance. See also voxel_gi_allocate_data().


PackedByteArray voxel_gi_get_octree_cells(voxel_gi: RID) const 🔗

Returns the octree cell data for the specified voxel GI data instance. See also voxel_gi_allocate_data().


Vector3i voxel_gi_get_octree_size(voxel_gi: RID) const 🔗

Returns the octree size for the specified voxel GI data instance, which corresponds to the number of subdivisions per axis. This can be viewed in the editor by hovering the Bake VoxelGI button at the top of the 3D editor viewport when a VoxelGI node is selected and looking at the Subdivisions field in the tooltip.


Transform3D voxel_gi_get_to_cell_xform(voxel_gi: RID) const 🔗

Returns the transform to cell space for the specified voxel GI data instance. See also voxel_gi_allocate_data().


void voxel_gi_set_baked_exposure_normalization(voxel_gi: RID, baked_exposure: float) 🔗

用於通知算繪器烘焙體素 GI 時使用的曝光正規化值。運作時會使用這個值進行調變,確保體素 GI 能夠維持恒定的曝光等級,即便場景範圍的曝光正規化值在運作時發生改變。更多資訊見 camera_attributes_set_exposure()


void voxel_gi_set_bias(voxel_gi: RID, bias: float) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.bias 值。


void voxel_gi_set_dynamic_range(voxel_gi: RID, range: float) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.dynamic_range 值。


void voxel_gi_set_energy(voxel_gi: RID, energy: float) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.energy 值。


void voxel_gi_set_interior(voxel_gi: RID, enable: bool) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.interior 值。


void voxel_gi_set_normal_bias(voxel_gi: RID, bias: float) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.normal_bias 值。


void voxel_gi_set_propagation(voxel_gi: RID, amount: float) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.propagation 值。


void voxel_gi_set_quality(quality: VoxelGIQuality) 🔗

設定算繪時使用的 ProjectSettings.rendering/global_illumination/voxel_gi/quality 值。這個參數是全域的,無法為單獨的 VoxelGI 進行設定。


void voxel_gi_set_use_two_bounces(voxel_gi: RID, enable: bool) 🔗

RIDvoxel_gi 的對象設定 VoxelGIData.use_two_bounces 值。