[][src]Struct gdnative::api::GIProbe

pub struct GIProbe { /* fields omitted */ }

core class GIProbe inherits VisualInstance (unsafe).

Official documentation

See the documentation of this class in the Godot engine's official documentation.

Memory management

Non reference counted objects such as the ones of this type are usually owned by the engine.

GIProbe is a reference-only type. Persistent references can only exist in the unsafe Ref<GIProbe> form.

In the cases where Rust code owns an object of this type, for example if the object was just created on the Rust side and not passed to the engine yet, ownership should be either given to the engine or the object must be manually destroyed using Ref::free, or Ref::queue_free if it is a Node.

Class hierarchy

GIProbe inherits methods from:

Safety

All types in the Godot API have "interior mutability" in Rust parlance. To enforce that the official thread-safety guidelines are followed, the typestate pattern is used in the Ref and TRef smart pointers, and the Instance API. The typestate Access in these types tracks whether the access is unique, shared, or exclusive to the current thread. For more information, see the type-level documentation on Ref.

Implementations

impl GIProbe[src]

Constants

pub const SUBDIV_128: i64[src]

pub const SUBDIV_256: i64[src]

pub const SUBDIV_512: i64[src]

pub const SUBDIV_64: i64[src]

pub const SUBDIV_MAX: i64[src]

impl GIProbe[src]

pub fn new() -> Ref<GIProbe, Unique>[src]

Creates a new instance of this object.

Because this type is not reference counted, the lifetime of the returned object is not automatically managed.

Immediately after creation, the object is owned by the caller, and can be passed to the engine (in which case the engine will be responsible for destroying the object) or destroyed manually using Ref::free, or preferably Ref::queue_free if it is a Node.

pub fn bake(&self, from_node: impl AsArg<Node>, create_visual_debug: bool)[src]

Bakes the effect from all [GeometryInstance]s marked with [member GeometryInstance.use_in_baked_light] and [Light]s marked with either [constant Light.BAKE_INDIRECT] or [constant Light.BAKE_ALL]. If [code]create_visual_debug[/code] is [code]true[/code], after baking the light, this will generate a [MultiMesh] that has a cube representing each solid cell with each cube colored to the cell's albedo color. This can be used to visualize the [GIProbe]'s data and debug any issues that may be occurring.

Default Arguments

  • from_node - null
  • create_visual_debug - false

pub fn debug_bake(&self)[src]

Calls [method bake] with [code]create_visual_debug[/code] enabled.

pub fn bias(&self) -> f64[src]

Offsets the lookup of the light contribution from the [GIProbe]. This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and [member normal_bias] should be played around with to minimize self-shadowing and light leaking.
			[b]Note:[/b] [code]bias[/code] should usually be above 1.0 as that is the size of the voxels.

pub fn dynamic_range(&self) -> i64[src]

The maximum brightness that the [GIProbe] will recognize. Brightness will be scaled within this range.

pub fn energy(&self) -> f64[src]

Energy multiplier. Makes the lighting contribution from the [GIProbe] brighter.

pub fn extents(&self) -> Vector3D<f32, UnknownUnit>[src]

The size of the area covered by the [GIProbe]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting.

pub fn normal_bias(&self) -> f64[src]

Offsets the lookup into the [GIProbe] based on the object's normal direction. Can be used to reduce some self-shadowing artifacts.

pub fn probe_data(&self) -> Option<Ref<GIProbeData, Shared>>[src]

The [GIProbeData] resource that holds the data for this [GIProbe].

pub fn propagation(&self) -> f64[src]

How much light propagates through the probe internally. A higher value allows light to spread further.

pub fn subdiv(&self) -> Subdiv[src]

Number of times to subdivide the grid that the [GIProbe] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance.

pub fn is_compressed(&self) -> bool[src]

If [code]true[/code], the data for this [GIProbe] will be compressed. Compression saves space, but results in far worse visual quality.

pub fn is_interior(&self) -> bool[src]

If [code]true[/code], ignores the sky contribution when calculating lighting.

pub fn set_bias(&self, max: f64)[src]

Offsets the lookup of the light contribution from the [GIProbe]. This can be used to avoid self-shadowing, but may introduce light leaking at higher values. This and [member normal_bias] should be played around with to minimize self-shadowing and light leaking.
			[b]Note:[/b] [code]bias[/code] should usually be above 1.0 as that is the size of the voxels.

pub fn set_compress(&self, enable: bool)[src]

If [code]true[/code], the data for this [GIProbe] will be compressed. Compression saves space, but results in far worse visual quality.

pub fn set_dynamic_range(&self, max: i64)[src]

The maximum brightness that the [GIProbe] will recognize. Brightness will be scaled within this range.

pub fn set_energy(&self, max: f64)[src]

Energy multiplier. Makes the lighting contribution from the [GIProbe] brighter.

pub fn set_extents(&self, extents: Vector3D<f32, UnknownUnit>)[src]

The size of the area covered by the [GIProbe]. If you make the extents larger without increasing the subdivisions with [member subdiv], the size of each cell will increase and result in lower detailed lighting.

pub fn set_interior(&self, enable: bool)[src]

If [code]true[/code], ignores the sky contribution when calculating lighting.

pub fn set_normal_bias(&self, max: f64)[src]

Offsets the lookup into the [GIProbe] based on the object's normal direction. Can be used to reduce some self-shadowing artifacts.

pub fn set_probe_data(&self, data: impl AsArg<GIProbeData>)[src]

The [GIProbeData] resource that holds the data for this [GIProbe].

pub fn set_propagation(&self, max: f64)[src]

How much light propagates through the probe internally. A higher value allows light to spread further.

pub fn set_subdiv(&self, subdiv: i64)[src]

Number of times to subdivide the grid that the [GIProbe] operates on. A higher number results in finer detail and thus higher visual quality, while lower numbers result in better performance.

Methods from Deref<Target = VisualInstance>

pub fn get_aabb(&self) -> Aabb[src]

Returns the [AABB] (also known as the bounding box) for this [VisualInstance]. See also [method get_transformed_aabb].

pub fn get_base(&self) -> Rid[src]

Returns the RID of the resource associated with this [VisualInstance]. For example, if the Node is a [MeshInstance], this will return the RID of the associated [Mesh].

pub fn get_instance(&self) -> Rid[src]

Returns the RID of this instance. This RID is the same as the RID returned by [method VisualServer.instance_create]. This RID is needed if you want to call [VisualServer] functions directly on this [VisualInstance].

pub fn layer_mask(&self) -> i64[src]

The render layer(s) this [VisualInstance] is drawn on.
			This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.

pub fn get_layer_mask_bit(&self, layer: i64) -> bool[src]

Returns [code]true[/code] when the specified layer is enabled in [member layers] and [code]false[/code] otherwise.

pub fn get_transformed_aabb(&self) -> Aabb[src]

Returns the transformed [AABB] (also known as the bounding box) for this [VisualInstance].
				Transformed in this case means the [AABB] plus the position, rotation, and scale of the [Spatial]'s [Transform]. See also [method get_aabb].

pub fn set_base(&self, base: Rid)[src]

Sets the resource that is instantiated by this [VisualInstance], which changes how the engine handles the [VisualInstance] under the hood. Equivalent to [method VisualServer.instance_set_base].

pub fn set_layer_mask(&self, mask: i64)[src]

The render layer(s) this [VisualInstance] is drawn on.
			This object will only be visible for [Camera]s whose cull mask includes the render object this [VisualInstance] is set to.

pub fn set_layer_mask_bit(&self, layer: i64, enabled: bool)[src]

Enables a particular layer in [member layers].

Trait Implementations

impl Debug for GIProbe[src]

impl Deref for GIProbe[src]

type Target = VisualInstance

The resulting type after dereferencing.

impl DerefMut for GIProbe[src]

impl GodotObject for GIProbe[src]

type RefKind = ManuallyManaged

The memory management kind of this type. This modifies the behavior of the Ref smart pointer. See its type-level documentation for more information. Read more

impl Instanciable for GIProbe[src]

impl QueueFree for GIProbe[src]

impl SubClass<Node> for GIProbe[src]

impl SubClass<Object> for GIProbe[src]

impl SubClass<Spatial> for GIProbe[src]

impl SubClass<VisualInstance> for GIProbe[src]

Auto Trait Implementations

impl RefUnwindSafe for GIProbe

impl !Send for GIProbe

impl !Sync for GIProbe

impl Unpin for GIProbe

impl UnwindSafe for GIProbe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SubClass<T> for T where
    T: GodotObject
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.