Skip to main content

PointShadowFit

Struct PointShadowFit 

Source
pub struct PointShadowFit {
    pub position: Vec3,
    pub near: f32,
    pub far: f32,
}
Expand description

Ein Atlas-Slot: die Lichtposition in Weltkoordinaten und die Gesicht-Spanne. far ist die Reichweite des Lichts — jenseits davon attenuiert der Falloff ohnehin auf null, eine weitere Tiefe würde nur Precision verschenken.

Fields§

§position: Vec3§near: f32§far: f32

Implementations§

Source§

impl PointShadowFit

Source

pub fn new(position: Vec3, near: f32, far: f32) -> Self

Source

pub fn face_view(&self, face: usize) -> Mat4

Sicht des Gesichts: vom Licht entlang der Achse, Up aus FACE_UP — dieselbe Konstruktion wie der GPU-Hochlauf.

Source

pub fn face_proj(&self) -> Mat4

Perspektive 90°, Seitenverhältnis 1 — für alle Gesichter gleich.

Source

pub fn face_view_proj(&self, face: usize) -> Mat4

Kombinierte Gesicht-Matrix (Upload- und Projektionsform des Kaskaden-Kerns: proj · view, Spalten-major).

Source

pub fn project(&self, world: Vec3) -> Option<(usize, [f32; 2], f32)>

Projektion eines Welt-Punkts in sein dominantes Gesicht. Gibt (Gesicht, uv in Kern-Konvention, Tiefe 0..=1) zurück; None hinter dem Licht (w ≤ 0) — dort gibt es keinen Eintrag, derselbe Fall, in dem der Shader „kein Schatten“ liefert.

Source

pub fn visibility( &self, map: &[f32], size: usize, world: Vec3, normal: Vec3, constant: f32, slope: f32, ) -> f32

Schatten-Term eines Welt-Punkts gegen eine gelesene Gesichts- Map (Zeilen-major, size×size, Tiefen 0..=1 — das Format von read_point_shadow_map): 0.0 = voll im Schatten, 1.0 = frei. uv außerhalb der Map gilt als frei, wie im Kaskaden-Kern.

Die Referenz ist die eigene Tiefe minus depth_bias — die Richtung (Subtraktion) ist die des Kaskaden-Pass: der Empfänger rutscht Richtung Licht und schattiert sich nicht selbst.

Trait Implementations§

Source§

impl Clone for PointShadowFit

Source§

fn clone(&self) -> PointShadowFit

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PointShadowFit

Source§

impl Debug for PointShadowFit

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for PointShadowFit

Source§

fn eq(&self, other: &PointShadowFit) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PointShadowFit

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.