Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AnimationMixer (2)
- AudioStreamPlayer
- CanvasItem (2)
- CanvasLayer (1)
- EditorFileSystem
- EditorPlugin (1)
- EditorResourcePreview
- HTTPRequest
- InstancePlaceholder
- MissingNode
- MultiplayerSpawner
- MultiplayerSynchronizer
- NavigationAgent2D
- NavigationAgent3D
- Node3D (31)
- ResourcePreloader
- ShaderGlobalsOverride
- StatusIndicator
- Timer
- Viewport (2)
- WorldEnvironment
- AudioListener3D
- AudioStreamPlayer3D
- BoneAttachment3D
- Camera3D (1)
- CollisionObject3D (2)
- CollisionPolygon3D
- CollisionShape3D
- GridMap
- ImporterMeshInstance3D
- Joint3D (5)
- LightmapProbe
- Marker3D
- NavigationLink3D
- NavigationObstacle3D
- NavigationRegion3D
- OpenXRCompositionLayer (3)
- OpenXRHand
- Path3D
- PathFollow3D
- RayCast3D
- RemoteTransform3D
- ShapeCast3D
- Skeleton3D
- SkeletonModifier3D (7)
- SpringArm3D
- SpringBoneCollision3D (3)
- VehicleWheel3D
- VisualInstance3D (13)
- XRFaceModifier3D
- XRNode3D (2)
- XROrigin3D
- Decal
- FogVolume
- GPUParticlesAttractor3D (3)
- GPUParticlesCollision3D (4)
- GeometryInstance3D (7)
- Light3D (3)
- LightmapGI
- OccluderInstance3D
- OpenXRVisibilityMask
- ReflectionProbe
- RootMotionView
- VisibleOnScreenNotifier3D (1)
- VoxelGI
- GPUParticlesCollisionBox3D
- GPUParticlesCollisionHeightField3D
- GPUParticlesCollisionSDF3D
- GPUParticlesCollisionSphere3D
Table of contents
-
var bake_mask: int = 4294967295 -
var resolution = RESOLUTION_64 -
var size: Vector3 = Vector3(2, 2, 2) -
var texture: Texture3D -
var thickness: float = 1.0 -
const func get_bake_mask_value(layer_number: int) -> bool -
func set_bake_mask_value(value: bool) -> void -
const RESOLUTION_16 = 0 enum Resolution -
const RESOLUTION_32 = 1 enum Resolution -
const RESOLUTION_64 = 2 enum Resolution -
const RESOLUTION_128 = 3 enum Resolution -
const RESOLUTION_256 = 4 enum Resolution -
const RESOLUTION_512 = 5 enum Resolution -
const RESOLUTION_MAX = 6 enum Resolution -
enum Resolution
GPUParticlesCollisionSDF3D #
is_instantiable, Node3D, Node, core, not_builtin_classes
A baked signed distance field 3D particle collision shape affecting GPUParticles3D nodes.
A baked signed distance field 3D particle collision shape affecting GPUParticles3D nodes.
Signed distance fields (SDF) allow for efficiently representing approximate collision shapes for convex and concave objects of any shape. This is more flexible than GPUParticlesCollisionHeightField3D, but it requires a baking step.
Baking: The signed distance field texture can be baked by selecting the GPUParticlesCollisionSDF3D node in the editor, then clicking Bake SDF at the top of the 3D viewport. Any visible MeshInstance3Ds within the size will be taken into account for baking, regardless of their GeometryInstance3D.gi_mode.
Note: Baking a GPUParticlesCollisionSDF3D's texture is only possible within the editor, as there is no bake method exposed for use in exported projects. However, it's still possible to load pre-baked Texture3Ds into its texture property in an exported project.
Note: ParticleProcessMaterial.collision_mode must be ParticleProcessMaterial.COLLISION_RIGID or ParticleProcessMaterial.COLLISION_HIDE_ON_CONTACT on the GPUParticles3D's process material for collision to work.
Note: Particle collision only affects GPUParticles3D, not CPUParticles3D.
Members #
var bake_mask: int = 4294967295#
The visual layers to account for when baking the particle collision SDF. Only MeshInstance3Ds whose VisualInstance3D.layers match with this bake_mask will be included in the generated particle collision SDF. By default, all objects are taken into account for the particle collision SDF baking.
var resolution = RESOLUTION_64#
The bake resolution to use for the signed distance field texture. The texture must be baked again for changes to the resolution property to be effective. Higher resolutions have a greater performance cost and take more time to bake. Higher resolutions also result in larger baked textures, leading to increased VRAM and storage space requirements. To improve performance and reduce bake times, use the lowest resolution possible for the object you're representing the collision of.
var size: Vector3 = Vector3(2, 2, 2)#
The collision SDF's size in 3D units. To improve SDF quality, the size should be set as small as possible while covering the parts of the scene you need.
var texture: Texture3D#
The 3D texture representing the signed distance field.
var thickness: float = 1.0#
The collision shape's thickness. Unlike other particle colliders, GPUParticlesCollisionSDF3D is actually hollow on the inside. thickness can be increased to prevent particles from tunneling through the collision shape at high speeds, or when the GPUParticlesCollisionSDF3D is moved.
Methods #
const func get_bake_mask_value(layer_number: int) -> bool#
Returns whether or not the specified layer of the bake_mask is enabled, given a layer_number between 1 and 32.
func set_bake_mask_value(value: bool) -> void#
Based on value, enables or disables the specified layer in the bake_mask, given a layer_number between 1 and 32.
Annotations #
Constants #
const RESOLUTION_16 = 0 enum Resolution#
Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise.
const RESOLUTION_32 = 1 enum Resolution#
Bake a 32×32×32 signed distance field.
const RESOLUTION_64 = 2 enum Resolution#
Bake a 64×64×64 signed distance field.
const RESOLUTION_128 = 3 enum Resolution#
Bake a 128×128×128 signed distance field.
const RESOLUTION_256 = 4 enum Resolution#
Bake a 256×256×256 signed distance field.
const RESOLUTION_512 = 5 enum Resolution#
Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise.
const RESOLUTION_MAX = 6 enum Resolution#
Represents the size of the Resolution enum.
Constructors #
Enums #
Resolution#
enum Resolution {
RESOLUTION_16 = 0,
RESOLUTION_32 = 1,
RESOLUTION_64 = 2,
RESOLUTION_128 = 3,
RESOLUTION_256 = 4,
RESOLUTION_512 = 5,
RESOLUTION_MAX = 6,
}