gausplat_renderer/render/gaussian_3d/
forward.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//! 3DGS rendering context (forward).

pub use super::*;

/// Rendering inputs (forward).
#[derive(Clone, Debug)]
pub struct RenderInput<B: Backend> {
    /// Device for rendering.
    pub device: B::Device,
    /// Point count.
    ///
    /// It is `P`.
    pub point_count: u64,
    /// The shape is `[P, M * 3]`.
    pub colors_sh: B::FloatTensorPrimitive,
    /// The shape is `[P, 1]`.
    pub opacities: B::FloatTensorPrimitive,
    /// The shape is `[P, 3]`.
    pub positions: B::FloatTensorPrimitive,
    /// The shape is `[P, 4]`.
    pub rotations: B::FloatTensorPrimitive,
    /// The shape is `[P, 3]`.
    pub scalings: B::FloatTensorPrimitive,
}

/// Rendering outputs (forward).
#[derive(Clone, Debug)]
pub struct RenderOutput<B: Backend> {
    /// The shape is `[I_y, I_x, 3]`
    pub colors_rgb_2d: B::FloatTensorPrimitive,
    /// Rendering inputs (backward).
    pub state: backward::RenderInput<B>,
}