pub struct NativeRenderer { /* private fields */ }Expand description
Native WebGPU renderer implementation
Implementations§
Source§impl NativeRenderer
impl NativeRenderer
Sourcepub async fn new(width: u32, height: u32) -> Result<Self, String>
pub async fn new(width: u32, height: u32) -> Result<Self, String>
Create a new native WebGPU renderer backed by an offscreen target.
The native studio runs inside a aether/webview host, so there is no OS
window to provide a etalon::Surface. We render headless into a texture and
expose the frame via NativeRenderer::read_pixels, to be displayed
through the same CPU frame-buffer path the diffusion compute already uses.
Sourcepub fn read_pixels(&self) -> Option<Vec<u8>>
pub fn read_pixels(&self) -> Option<Vec<u8>>
Read the current frame back as tightly-packed RGBA8 (width*height*4 bytes).
Trait Implementations§
Source§impl Renderer for NativeRenderer
Available on non-WebAssembly only.
impl Renderer for NativeRenderer
Available on non-WebAssembly only.
Source§fn set_camera(&mut self, camera: Camera)
fn set_camera(&mut self, camera: Camera)
Set the active camera used for
Renderer::project.Source§fn project(&self, world: Vec3) -> Option<ScreenPoint>
fn project(&self, world: Vec3) -> Option<ScreenPoint>
Project a world-space point to screen space (CPU-side cull/fade helper).
Source§fn line(
&self,
a: ScreenPoint,
b: ScreenPoint,
color: &str,
alpha: f64,
width: f64,
)
fn line( &self, a: ScreenPoint, b: ScreenPoint, color: &str, alpha: f64, width: f64, )
Draw a screen-space line segment.
Source§fn point(&self, p: ScreenPoint, radius: f64, color: &str, alpha: f64)
fn point(&self, p: ScreenPoint, radius: f64, color: &str, alpha: f64)
Draw a filled screen-space disc (billboarded point).
Source§fn fill_polygon(&self, points: &[ScreenPoint], color: &str, alpha: f64)
fn fill_polygon(&self, points: &[ScreenPoint], color: &str, alpha: f64)
Fill a screen-space polygon (e.g. a depth-shaded quad).
Auto Trait Implementations§
impl !Freeze for NativeRenderer
impl !RefUnwindSafe for NativeRenderer
impl !UnwindSafe for NativeRenderer
impl Send for NativeRenderer
impl Sync for NativeRenderer
impl Unpin for NativeRenderer
impl UnsafeUnpin for NativeRenderer
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Create an instance of this type from an initialization function
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
impl<T, O> SuperFrom<T> for Owhere
O: From<T>,
§fn super_from(input: T) -> O
fn super_from(input: T) -> O
Convert from a type to another type.
§impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
impl<T, O, M> SuperInto<O, M> for Twhere
O: SuperFrom<T, M>,
§fn super_into(self) -> O
fn super_into(self) -> O
Convert from a type to another type.