reckfellENGINE

GpuParticlesCollisionSdf3D

A baked signed distance field 3D particle collision shape affecting GPUParticles3D nodes.

On this page
class GpuParticlesCollisionSdf3DReckfellSharpInherits GpuParticlesCollision3D

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 GpuParticlesCollisionSdf3D.Size will be taken into account for baking, regardless of their GeometryInstance3D.GIMode. Note: Baking a GpuParticlesCollisionSdf3D's GpuParticlesCollisionSdf3D.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 GpuParticlesCollisionSdf3D.Texture property in an exported project. Note: ParticleProcessMaterial.CollisionMode must be ParticleProcessMaterial.CollisionModeEnum.Rigid or ParticleProcessMaterial.CollisionModeEnum.HideOnContact on the GpuParticles3D's process material for collision to work. Note: Particle collision only affects GpuParticles3D, not CpuParticles3D.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

GpuParticlesCollisionSdf3DConstructor
# GpuParticlesCollisionSdf3D
C#
public GpuParticlesCollisionSdf3D();

Properties5

BakeMaskProperty
# BakeMask
C#
public uint BakeMask { get; set; }

Geometry render layers for SDF baking. Not the emitter-selection CullMask. Changing selection/geometry requires validating and regenerating the field, not just assigning a mask.

ResolutionProperty
# Resolution
C#
public GpuParticlesCollisionSdf3D.ResolutionEnum Resolution { get; set; }

The bake resolution to use for the signed distance field GpuParticlesCollisionSdf3D.Texture. The texture must be baked again for changes to the GpuParticlesCollisionSdf3D.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.

SizeProperty
# Size
C#
public Vector3 Size { get; set; }

Full local SDF-region dimensions, not half extents. Response requires appropriate Texture data and supported rendering. Changing Size is not the same as rebaking geometry.

TextureProperty
# Texture
C#
public Texture3D Texture { get; set; }

3D distance-field data for collision. Not visible albedo or a gameplay CollisionShape. Check generated-data availability/freshness; mesh edits do not rewrite this texture automatically.

ThicknessProperty
# Thickness
C#
public float Thickness { get; set; }

The collision shape's thickness. Unlike other particle colliders, GpuParticlesCollisionSdf3D is actually hollow on the inside. GpuParticlesCollisionSdf3D.Thickness can be increased to prevent particles from tunneling through the collision shape at high speeds, or when the GpuParticlesCollisionSdf3D is moved.

Methods12

GetBakeMaskuint
# GetBakeMask
C#
public uint GetBakeMask();
Returns uint
GetBakeMaskValuebool
# GetBakeMaskValue
C#
public bool GetBakeMaskValue(int layerNumber);

Returns whether or not the specified layer of the GpuParticlesCollisionSdf3D.BakeMask is enabled, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
Returns bool
GetResolutionGpuParticlesCollisionSdf3D.ResolutionEnum
# GetResolution
C#
public GpuParticlesCollisionSdf3D.ResolutionEnum GetResolution();
Returns GpuParticlesCollisionSdf3D.ResolutionEnum
GetSizeVector3
# GetSize
C#
public Vector3 GetSize();
Returns Vector3
GetTextureTexture3D
# GetTexture
C#
public Texture3D GetTexture();
Returns Texture3D
GetThicknessfloat
# GetThickness
C#
public float GetThickness();
Returns float
SetBakeMaskvoid
# SetBakeMask
C#
public void SetBakeMask(uint mask);
Parameters
NameTypeDefault
maskuint—
SetBakeMaskValuevoid
# SetBakeMaskValue
C#
public void SetBakeMaskValue(int layerNumber, bool value);

Based on value, enables or disables the specified layer in the GpuParticlesCollisionSdf3D.BakeMask, given a layer_number between 1 and 32.

Parameters
NameTypeDefault
layerNumberint—
valuebool—
SetResolutionvoid
# SetResolution
C#
public void SetResolution(GpuParticlesCollisionSdf3D.ResolutionEnum resolution);
Parameters
NameTypeDefault
resolutionGpuParticlesCollisionSdf3D.ResolutionEnum—
SetSizevoid
# SetSize
C#
public void SetSize(Vector3 size);
Parameters
NameTypeDefault
sizeVector3—
SetTexturevoid
# SetTexture
C#
public void SetTexture(Texture3D texture);
Parameters
NameTypeDefault
textureTexture3D—
SetThicknessvoid
# SetThickness
C#
public void SetThickness(float thickness);
Parameters
NameTypeDefault
thicknessfloat—

GpuParticlesCollisionSdf3D.ResolutionEnum

ValueDescription
Max = 6

Represents the size of the GpuParticlesCollisionSdf3D.ResolutionEnum enum.

Resolution128 = 3

Bake a 128×128×128 signed distance field.

Resolution16 = 0

Bake a 16×16×16 signed distance field. This is the fastest option, but also the least precise.

Resolution256 = 4

Bake a 256×256×256 signed distance field.

Resolution32 = 1

Bake a 32×32×32 signed distance field.

Resolution512 = 5

Bake a 512×512×512 signed distance field. This is the slowest option, but also the most precise.

Resolution64 = 2

Bake a 64×64×64 signed distance field.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.