Skip to main content

CurveNetworkRenderData

Struct CurveNetworkRenderData 

Source
pub struct CurveNetworkRenderData {
Show 14 fields pub node_buffer: Buffer, pub node_color_buffer: Buffer, pub edge_vertex_buffer: Buffer, pub edge_color_buffer: Buffer, pub uniform_buffer: Buffer, pub bind_group: BindGroup, pub num_nodes: u32, pub num_edges: u32, pub generated_vertex_buffer: Option<Buffer>, pub num_edges_buffer: Option<Buffer>, pub compute_bind_group: Option<BindGroup>, pub tube_render_bind_group: Option<BindGroup>, pub node_uniform_buffer: Option<Buffer>, pub node_render_bind_group: Option<BindGroup>,
}
Expand description

GPU resources for rendering a curve network.

Fields§

§node_buffer: Buffer

Node position buffer (storage buffer, vec4 for alignment).

§node_color_buffer: Buffer

Node color buffer (storage buffer, vec4).

§edge_vertex_buffer: Buffer

Edge vertex buffer - contains tail and tip positions per edge. Layout: [tail0, tip0, tail1, tip1, …] (vec4 each for alignment)

§edge_color_buffer: Buffer

Edge color buffer (per-edge colors, vec4).

§uniform_buffer: Buffer

Uniform buffer for curve network settings.

§bind_group: BindGroup

Bind group for this curve network.

§num_nodes: u32

Number of nodes.

§num_edges: u32

Number of edges.

§generated_vertex_buffer: Option<Buffer>

Generated vertex buffer from compute shader (36 vertices per edge).

§num_edges_buffer: Option<Buffer>

Buffer containing num_edges as uniform.

§compute_bind_group: Option<BindGroup>

Bind group for tube compute shader.

§tube_render_bind_group: Option<BindGroup>

Bind group for tube render shader.

§node_uniform_buffer: Option<Buffer>

Uniform buffer for node sphere rendering (matches PointUniforms).

§node_render_bind_group: Option<BindGroup>

Bind group for node sphere rendering (uses point pipeline).

Implementations§

Source§

impl CurveNetworkRenderData

Source

pub fn new( device: &Device, bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, node_positions: &[Vec3], edge_tail_inds: &[u32], edge_tip_inds: &[u32], ) -> Self

Creates new render data from curve network geometry.

§Arguments
  • device - The wgpu device
  • bind_group_layout - The bind group layout for curve networks
  • camera_buffer - The camera uniform buffer
  • node_positions - Node positions
  • edge_tail_inds - Edge start indices
  • edge_tip_inds - Edge end indices
Source

pub fn init_tube_resources( &mut self, device: &Device, compute_bind_group_layout: &BindGroupLayout, render_bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, )

Initializes tube rendering resources.

Source

pub fn has_tube_resources(&self) -> bool

Returns whether tube resources are initialized.

Source

pub fn init_node_render_resources( &mut self, device: &Device, point_bind_group_layout: &BindGroupLayout, camera_buffer: &Buffer, )

Initializes node sphere rendering resources for tube mode. Uses the point pipeline to render spheres at each node to fill gaps at joints.

Source

pub fn has_node_render_resources(&self) -> bool

Returns whether node render resources are initialized.

Source

pub fn update_node_uniforms(&self, queue: &Queue, uniforms: &PointUniforms)

Updates node sphere uniforms (radius, color, etc.).

Source

pub fn update_uniforms(&self, queue: &Queue, uniforms: &CurveNetworkUniforms)

Updates the uniform buffer.

Source

pub fn update_node_colors(&self, queue: &Queue, colors: &[Vec4])

Updates node colors.

Source

pub fn update_edge_colors(&self, queue: &Queue, colors: &[Vec4])

Updates edge colors.

Source

pub fn update_node_positions(&self, queue: &Queue, positions: &[Vec3])

Updates node positions.

Source

pub fn update_edge_vertices( &self, queue: &Queue, node_positions: &[Vec3], edge_tail_inds: &[u32], edge_tip_inds: &[u32], )

Updates edge vertices (when node positions change).

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. 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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,