reckfellENGINE

GeometryInstance3D

Base node for geometry-based visual instances.

On this page
class GeometryInstance3DReckfellSharpInherits VisualInstance3D

Base node for geometry-based visual instances.

Base node for geometry-based visual instances. Shares some common functionality like visibility and custom materials.

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

Constructors1

GeometryInstance3DConstructor
# GeometryInstance3D
C#
public GeometryInstance3D();

Properties16

CastShadowProperty
# CastShadow
C#
public GeometryInstance3D.ShadowCastingSetting CastShadow { get; set; }

Controls geometry shadow casting, not ordinary visibility or shadow reception. Off removes the object shadow; the light also needs ShadowEnabled. The example verifies DirectionalLight3D in Compatibility.

CustomAabbProperty
# CustomAabb
C#
public Aabb CustomAabb { get; set; }

Custom local bounds for culling the rendering instance. A nonzero Aabb replaces computed bounds; default(Aabb) removes the override. ExtraCullMargin is then applied before transforming the result to world space. Does not change vertices, Mesh.GetAabb(), VisualInstance3D.GetAabb() or collision. An excessively large box weakens culling and is not a general switch disabling visibility tests.

ExtraCullMarginProperty
# ExtraCullMargin
C#
public float ExtraCullMargin { get; set; }

Additional geometry-culling bounds margin. Useful when a vertex shader moves vertices outside the original AABB. Does not modify CPU vertices, the original Mesh.GetAabb or CollisionShape3D. Choose it for the maximum possible displacement; the example uses 2.

GILightmapScaleProperty · Deprecated
# GILightmapScale
C#
public GeometryInstance3D.LightmapScale GILightmapScale { get; set; }

The texel density to use for lightmapping in LightmapGI.

GILightmapTexelScaleProperty
# GILightmapTexelScale
C#
public float GILightmapTexelScale { get; set; }

The texel density to use for lightmapping in LightmapGI. Greater scale values provide higher resolution in the lightmap, which can result in sharper shadows for lights that have both direct and indirect light baked. However, greater scale values will also increase the space taken by the mesh in the lightmap texture, which increases the memory, storage, and bake time requirements. When using a single mesh at different scales, consider adjusting this value to keep the lightmap texel density consistent across meshes. For example, doubling GeometryInstance3D.GILightmapTexelScale doubles the lightmap texture resolution for this object on each axis, so it will quadruple the texel count.

GIModeProperty
# GIMode
C#
public GeometryInstance3D.GIModeEnum GIMode { get; set; }

The global illumination mode to use for the whole geometry. To avoid inconsistent results, use a mode that matches the purpose of the mesh during gameplay (static/dynamic). Note: Lights' bake mode will also affect the global illumination rendering. See Light3D.LightBakeMode.

IgnoreOcclusionCullingProperty
# IgnoreOcclusionCulling
C#
public bool IgnoreOcclusionCulling { get; set; }

Bypasses occlusion culling for this geometry. The test restores the hidden sphere to the render list behind a wall; it does not make it visible through the opaque wall or disable every other culling mechanism.

LodBiasProperty
# LodBias
C#
public float LodBias { get; set; }

Instance mesh-LOD selection multiplier. Increasing 1 to 8 preserves more distant primitives in the test. Does not create missing LOD data, modify physics or specify a fixed switching distance.

MaterialOverlayProperty
# MaterialOverlay
C#
public Material MaterialOverlay { get; set; }

Additional material rendered over the base in another pass. Does not replace MaterialOverride and is not returned by GetActiveMaterial. A transparent Alpha overlay is verified; configure transparency, depth and extra-pass cost separately.

MaterialOverrideProperty
# MaterialOverride
C#
public Material MaterialOverride { get; set; }

Base material overriding all instance surfaces, ahead of surface overrides and Mesh materials. Assigning an existing resource does not make it unique. null restores surface-material selection.

TransparencyProperty
# Transparency
C#
public float Transparency { get; set; }

The transparency applied to the whole geometry (as a multiplier of the materials' existing transparency). 0.0 is fully opaque, while 1.0 is fully transparent. Values greater than 0.0 (exclusive) will force the geometry's materials to go through the transparent pipeline, which is slower to render and can exhibit rendering issues due to incorrect transparency sorting. However, unlike using a transparent material, setting GeometryInstance3D.Transparency to a value greater than 0.0 (exclusive) will not disable shadow rendering. In spatial shaders, 1.0 - transparency is set as the default value of the ALPHA built-in. Note: GeometryInstance3D.Transparency is clamped between 0.0 and 1.0, so this property cannot be used to make transparent materials more opaque than they originally are. Note: Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, GeometryInstance3D.Transparency is ignored and is considered as always being 0.0.

VisibilityRangeBeginProperty
# VisibilityRangeBegin
C#
public float VisibilityRangeBegin { get; set; }

Lower visibility-distance bound, measured from the camera to the transformed AABB center. Zero disables this bound. Range culling does not stop _Process, physics or unload resources. With zero margins both adjacent models can be visible at an exact shared threshold.

VisibilityRangeBeginMarginProperty
# VisibilityRangeBeginMargin
C#
public float VisibilityRangeBeginMargin { get; set; }

Margin around the lower bound. With fading disabled it supplies state-dependent switching hysteresis, not automatic transparency. Coordinate it with the neighboring model’s upper range.

VisibilityRangeEndProperty
# VisibilityRangeEnd
C#
public float VisibilityRangeEnd { get; set; }

Upper visibility-distance bound; zero disables it. Measured to the transformed AABB center, not necessarily the entity origin. Selects visible geometry; does not stream resources or automatically simplify triangles.

VisibilityRangeEndMarginProperty
# VisibilityRangeEndMargin
C#
public float VisibilityRangeEndMargin { get; set; }

Margin around the upper bound. With fading disabled it contributes to hysteresis; fade modes use it as a transition band. The value alone does not enable transparency or stop entity processing.

VisibilityRangeFadeModeProperty
# VisibilityRangeFadeMode
C#
public GeometryInstance3D.VisibilityRangeFadeModeEnum VisibilityRangeFadeMode { get; set; }

Range-transition mode. Disabled switches visibility without transparent fading. Source configuration requires Forward+ for transparent Self/Dependencies fading; do not rely on it in Compatibility or Mobile. The native example verifies only Disabled with zero margins.

Methods34

GetCastShadowsSettingGeometryInstance3D.ShadowCastingSetting
# GetCastShadowsSetting
C#
public GeometryInstance3D.ShadowCastingSetting GetCastShadowsSetting();
Returns GeometryInstance3D.ShadowCastingSetting
GetCustomAabbAabb
# GetCustomAabb
C#
public Aabb GetCustomAabb();

Returns the stored CustomAabb value, not final server-side culling bounds. Calling RenderingServer.InstanceSetCustomAabb directly does not update this wrapper value.

Returns Aabb

The configured local Aabb, or default(Aabb) when no override is set through the wrapper. This does not query automatically computed bounds.

GetExtraCullMarginfloat
# GetExtraCullMargin
C#
public float GetExtraCullMargin();

Returns the stored extra local-bounds margin. A direct RenderingServer.InstanceSetExtraVisibilityMargin call changes server state but does not update this wrapper value.

Returns float

The configured ExtraCullMargin, initially 0. This is neither the complete bounds size nor a world-space distance after scaling.

GetGIModeGeometryInstance3D.GIModeEnum
# GetGIMode
C#
public GeometryInstance3D.GIModeEnum GetGIMode();
Returns GeometryInstance3D.GIModeEnum
GetInstanceShaderParameterVariant
# GetInstanceShaderParameter
C#
public Variant GetInstanceShaderParameter(StringName name);

Reads the effective instance-uniform value for this geometry. After a Nil reset, the verified example returns the shader default White. This differs from ShaderMaterial.GetShaderParameter, which returns Nil without a stored override.

Parameters
NameTypeDefault
nameStringName—
name

Case-sensitive name of a declared instance uniform.

Returns Variant

Variant containing the current parameter value. Color White is verified after resetting surface_tint; do not assume the same default for unknown names.

GetLightmapScaleGeometryInstance3D.LightmapScale
# GetLightmapScale
C#
public GeometryInstance3D.LightmapScale GetLightmapScale();
Returns GeometryInstance3D.LightmapScale
GetLightmapTexelScalefloat
# GetLightmapTexelScale
C#
public float GetLightmapTexelScale();
Returns float
GetLodBiasfloat
# GetLodBias
C#
public float GetLodBias();
Returns float
GetMaterialOverlayMaterial
# GetMaterialOverlay
C#
public Material GetMaterialOverlay();

Additional material for another draw pass. It neither replaces base MaterialOverride nor appears as GetActiveMaterial. Its queue, blending and depth still apply: an opaque overlay is not guaranteed on top. The check verifies a transparent alpha overlay blending with the base.

Returns Material

Assigned Material, or null, without cloning.

GetMaterialOverrideMaterial
# GetMaterialOverride
C#
public Material GetMaterialOverride();

Base material for the entire instance, ahead of surface overrides and Mesh materials. Assignment does not clone the resource. null restores per-surface selection; MaterialOverlay remains a separate pass.

Returns Material

Assigned Material, or null, without cloning.

GetTransparencyfloat
# GetTransparency
C#
public float GetTransparency();
Returns float
GetVisibilityRangeBeginfloat
# GetVisibilityRangeBegin
C#
public float GetVisibilityRangeBegin();
Returns float
GetVisibilityRangeBeginMarginfloat
# GetVisibilityRangeBeginMargin
C#
public float GetVisibilityRangeBeginMargin();
Returns float
GetVisibilityRangeEndfloat
# GetVisibilityRangeEnd
C#
public float GetVisibilityRangeEnd();
Returns float
GetVisibilityRangeEndMarginfloat
# GetVisibilityRangeEndMargin
C#
public float GetVisibilityRangeEndMargin();
Returns float
GetVisibilityRangeFadeModeGeometryInstance3D.VisibilityRangeFadeModeEnum
# GetVisibilityRangeFadeMode
C#
public GeometryInstance3D.VisibilityRangeFadeModeEnum GetVisibilityRangeFadeMode();
Returns GeometryInstance3D.VisibilityRangeFadeModeEnum
IsIgnoringOcclusionCullingbool
# IsIgnoringOcclusionCulling
C#
public bool IsIgnoringOcclusionCulling();
Returns bool
SetCastShadowsSettingvoid
# SetCastShadowsSetting
C#
public void SetCastShadowsSetting(GeometryInstance3D.ShadowCastingSetting shadowCastingSetting);
Parameters
NameTypeDefault
shadowCastingSettingGeometryInstance3D.ShadowCastingSetting—
SetCustomAabbvoid
# SetCustomAabb
C#
public void SetCustomAabb(Aabb aabb);

Stores CustomAabb and forwards it to the RenderingServer instance. The box uses local coordinates. For wind or other GPU deformation, cover every vertex position: the engine does not infer this displacement from shader code.

Parameters
NameTypeDefault
aabbAabb—
aabb

Custom local bounds; default(Aabb) restores automatic bounds selection. This value is not written into the source Mesh.

SetExtraCullMarginvoid
# SetExtraCullMargin
C#
public void SetExtraCullMargin(float margin);

Grows local rendering bounds on every side before the instance transform is applied. Useful for vertex-shader displacement; reducing scale also reduces the world-space margin. Does not change source vertices, GetAabb() or collision. A negative value is rejected with an engine error and leaves the prior setting unchanged.

Parameters
NameTypeDefault
marginfloat—
margin

Nonnegative padding in local units; 0 removes the extra growth. For world-space displacement, account for scale and rotation rather than copying the amplitude alone.

SetGIModevoid
# SetGIMode
C#
public void SetGIMode(GeometryInstance3D.GIModeEnum mode);
Parameters
NameTypeDefault
modeGeometryInstance3D.GIModeEnum—
SetIgnoreOcclusionCullingvoid
# SetIgnoreOcclusionCulling
C#
public void SetIgnoreOcclusionCulling(bool ignoreCulling);
Parameters
NameTypeDefault
ignoreCullingbool—
SetInstanceShaderParametervoid
# SetInstanceShaderParameter
C#
public void SetInstanceShaderParameter(StringName name, Variant value);

Sets an instance uniform on this geometry while other meshes retain a shared ShaderMaterial. The parameter must be declared as instance uniform. Nil removes the override and restores that parameter’s shader default.

Parameters
NameTypeDefault
nameStringName—
valueVariant—
name

Exact instance-uniform name, such as surface_tint. The example regular uniform height_scale is assigned on ShaderMaterial.

value

Compatible Variant value; the example passes Color for vec4 with source_color. default(Variant) removes the individual override without removing the shared material.

SetLightmapScalevoid
# SetLightmapScale
C#
public void SetLightmapScale(GeometryInstance3D.LightmapScale scale);
Parameters
NameTypeDefault
scaleGeometryInstance3D.LightmapScale—
SetLightmapTexelScalevoid
# SetLightmapTexelScale
C#
public void SetLightmapTexelScale(float scale);
Parameters
NameTypeDefault
scalefloat—
SetLodBiasvoid
# SetLodBias
C#
public void SetLodBias(float bias);
Parameters
NameTypeDefault
biasfloat—
SetMaterialOverlayvoid
# SetMaterialOverlay
C#
public void SetMaterialOverlay(Material material);

Additional material for another draw pass. It neither replaces base MaterialOverride nor appears as GetActiveMaterial. Its queue, blending and depth still apply: an opaque overlay is not guaranteed on top. The check verifies a transparent alpha overlay blending with the base.

Parameters
NameTypeDefault
materialMaterial—
material

Material to assign; null clears this override/overlay. Keep the resource alive while used.

SetMaterialOverridevoid
# SetMaterialOverride
C#
public void SetMaterialOverride(Material material);

Base material for the entire instance, ahead of surface overrides and Mesh materials. Assignment does not clone the resource. null restores per-surface selection; MaterialOverlay remains a separate pass.

Parameters
NameTypeDefault
materialMaterial—
material

Material to assign; null clears this override/overlay. Keep the resource alive while used.

SetTransparencyvoid
# SetTransparency
C#
public void SetTransparency(float transparency);
Parameters
NameTypeDefault
transparencyfloat—
SetVisibilityRangeBeginvoid
# SetVisibilityRangeBegin
C#
public void SetVisibilityRangeBegin(float distance);
Parameters
NameTypeDefault
distancefloat—
SetVisibilityRangeBeginMarginvoid
# SetVisibilityRangeBeginMargin
C#
public void SetVisibilityRangeBeginMargin(float distance);
Parameters
NameTypeDefault
distancefloat—
SetVisibilityRangeEndvoid
# SetVisibilityRangeEnd
C#
public void SetVisibilityRangeEnd(float distance);
Parameters
NameTypeDefault
distancefloat—
SetVisibilityRangeEndMarginvoid
# SetVisibilityRangeEndMargin
C#
public void SetVisibilityRangeEndMargin(float distance);
Parameters
NameTypeDefault
distancefloat—
SetVisibilityRangeFadeModevoid
# SetVisibilityRangeFadeMode
C#
public void SetVisibilityRangeFadeMode(GeometryInstance3D.VisibilityRangeFadeModeEnum mode);
Parameters
NameTypeDefault
modeGeometryInstance3D.VisibilityRangeFadeModeEnum—

GeometryInstance3D.GIModeEnum

ValueDescription
Disabled = 0

Disabled global illumination mode. Use for dynamic objects that do not contribute to global illumination (such as characters). When using VoxelGI and SDFGI, the geometry will receive indirect lighting and reflections but the geometry will not be considered in GI baking.

Dynamic = 2

Dynamic global illumination mode. Use for dynamic objects that contribute to global illumination. This GI mode is only effective when using VoxelGI, but it has a higher performance impact than GeometryInstance3D.GIModeEnum.Static. When using other GI methods, this will act the same as GeometryInstance3D.GIModeEnum.Disabled. When using LightmapGI, the object will receive indirect lighting using lightmap probes instead of using the baked lightmap texture.

Static = 1

Baked global illumination mode. Use for static objects that contribute to global illumination (such as level geometry). This GI mode is effective when using VoxelGI, SDFGI and LightmapGI.

GeometryInstance3D.LightmapScale

ValueDescription
Max = 4

Represents the size of the GeometryInstance3D.LightmapScale enum.

Scale1X = 0

The standard texel density for lightmapping with LightmapGI.

Scale2X = 1

Multiplies texel density by 2× for lightmapping with LightmapGI. To ensure consistency in texel density, use this when scaling a mesh by a factor between 1.5 and 3.0.

Scale4X = 2

Multiplies texel density by 4× for lightmapping with LightmapGI. To ensure consistency in texel density, use this when scaling a mesh by a factor between 3.0 and 6.0.

Scale8X = 3

Multiplies texel density by 8× for lightmapping with LightmapGI. To ensure consistency in texel density, use this when scaling a mesh by a factor greater than 6.0.

GeometryInstance3D.ShadowCastingSetting

ValueDescription
DoubleSided = 2

Will cast shadows from all visible faces in the GeometryInstance3D. Will not take culling into account, so all faces will be taken into account when shadow casting.

Off = 0

Will not cast any shadows. Use this to improve performance for small geometry that is unlikely to cast noticeable shadows (such as debris).

On = 1

Will cast shadows from all visible faces in the GeometryInstance3D. Will take culling into account, so faces not being rendered will not be taken into account when shadow casting.

ShadowsOnly = 3

Will only show the shadows casted from this object. In other words, the actual mesh will not be visible, only the shadows casted from the mesh will be.

GeometryInstance3D.VisibilityRangeFadeModeEnum

ValueDescription
Dependencies = 2

Will fade-in its visibility dependencies (see Entity3D.VisibilityParent) when reaching the limits of its own visibility range. This is slower than GeometryInstance3D.VisibilityRangeFadeModeEnum.Disabled, but it can provide smoother transitions. The fading range is determined by GeometryInstance3D.VisibilityRangeBeginMargin and GeometryInstance3D.VisibilityRangeEndMargin. Note: Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like GeometryInstance3D.VisibilityRangeFadeModeEnum.Disabled but with hysteresis disabled.

Disabled = 0

Will not fade itself nor its visibility dependencies, hysteresis will be used instead. This is the fastest approach to manual LOD, but it can result in noticeable LOD transitions depending on how the LOD meshes are authored. See GeometryInstance3D.VisibilityRangeBegin and Entity3D.VisibilityParent for more information.

Self = 1

Will fade-out itself when reaching the limits of its own visibility range. This is slower than GeometryInstance3D.VisibilityRangeFadeModeEnum.Disabled, but it can provide smoother transitions. The fading range is determined by GeometryInstance3D.VisibilityRangeBeginMargin and GeometryInstance3D.VisibilityRangeEndMargin. Note: Only supported when using the Forward+ rendering method. When using the Mobile or Compatibility rendering method, this mode acts like GeometryInstance3D.VisibilityRangeFadeModeEnum.Disabled but with hysteresis disabled.

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.