FogVolume
Local or global volumetric-fog contribution.
An Entity3D object with a fog shape, size and material. Requires Forward+ and enabled Environment volumetric fog. FogMaterial supplies built-in behavior; a fog-type ShaderMaterial defines a custom contribution.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
FogVolumeConstructor
public FogVolume();Creates a Box volume of size (2,2,2) with no assigned material. Requires Forward+ and enabled environment volumetric fog. In current RD, no assigned material selects default density-1 fog rather than disabling the volume. Assign a FogMaterial or fog-type ShaderMaterial to control its contribution.
Properties3
MaterialProperty
public Material Material { get; set; }Local participating-medium material. Use FogMaterial or a ShaderMaterial with shader_type fog; StandardMaterial3D describes a mesh surface and is not a fog shader. A visible FogVolume requires Forward+ and VolumetricFogEnabled on the effective Environment.
ShapeProperty
public RenderingServer.FogVolumeShape Shape { get; set; }Volumetric fog region: Ellipsoid, Cone, Cylinder, Box or World from RenderingServer.FogVolumeShape. Local shapes use Size and the Entity transform. World acts globally without Size bounds; it does not replace Environment.VolumetricFogEnabled.
SizeProperty
public Vector3 Size { get; set; }Full local volume dimensions, not half-extents. Assignment clamps negative components to zero; zero dimensions do not define a useful fog region. Shape=World is not bounded by this size. The example Box uses 10×5×10.
Methods6
GetMaterialMaterial
public Material GetMaterial();Volume contribution material: FogMaterial or a ShaderMaterial with shader_type fog. Assignment does not enable Environment.VolumetricFogEnabled. Volumes using the same material share its parameter values. null clears the assignment, but current RD uses its default material; set Visible=false to hide the volume.
MaterialAssigned Material, or null. This getter does not return the internal renderer default material.
GetShapeRenderingServer.FogVolumeShape
public RenderingServer.FogVolumeShape GetShape();Volume shape: Ellipsoid, Cone, Cylinder, Box or World. Local shapes use Size and the Entity3D transform; World is global. In current RD, referencing SDF disables the automatic shape mask, so provide your own DENSITY mask.
RenderingServer.FogVolumeShapeAssigned FogVolumeShape value.
GetSizeVector3
public Vector3 GetSize();Full local-shape size, not half-extents or fog-grid resolution. Negative components are clamped to zero. World shape does not use this size as a global-volume boundary.
Vector3Stored size after negative components are clamped to zero.
SetMaterialvoid
public void SetMaterial(Material material);Volume contribution material: FogMaterial or a ShaderMaterial with shader_type fog. Assignment does not enable Environment.VolumetricFogEnabled. Volumes using the same material share its parameter values. null clears the assignment, but current RD uses its default material; set Visible=false to hide the volume.
| Name | Type | Default |
|---|---|---|
material | Material | — |
materialFog material, or null. null selects the RD default rather than disabling the volume.
SetShapevoid
public void SetShape(RenderingServer.FogVolumeShape shape);Volume shape: Ellipsoid, Cone, Cylinder, Box or World. Local shapes use Size and the Entity3D transform; World is global. In current RD, referencing SDF disables the automatic shape mask, so provide your own DENSITY mask.
| Name | Type | Default |
|---|---|---|
shape | RenderingServer.FogVolumeShape | — |
shapeFogVolumeShape; World is not constrained by Size.
SetSizevoid
public void SetSize(Vector3 size);Full local-shape size, not half-extents or fog-grid resolution. Negative components are clamped to zero. World shape does not use this size as a global-volume boundary.
| Name | Type | Default |
|---|---|---|
size | Vector3 | — |
sizeFull size; use positive components for a nonempty local shape.