pub struct NoiseTexture {
pub noise: Noise,
pub size: u32,
pub dark: [f32; 3],
pub light: [f32; 3],
}Expand description
A texture description that fits in MeshRenderer.texture, e.g. from a script:
mr.texture = NoiseTexture::new(Noise::new(NoiseKind::Worley)).key();
Fields§
§noise: NoiseFractal noise parameters sampled across the generated square.
size: u32Square output image edge length in pixels.
dark: [f32; 3]RGB colour at noise value zero, normally in 0..1.
light: [f32; 3]RGB colour at noise value one, normally in 0..1.
Implementations§
Source§impl NoiseTexture
impl NoiseTexture
Sourcepub fn new(noise: Noise) -> Self
pub fn new(noise: Noise) -> Self
Creates a 256-pixel grayscale texture descriptor for this noise.
Sourcepub fn colors(self, dark: [f32; 3], light: [f32; 3]) -> Self
pub fn colors(self, dark: [f32; 3], light: [f32; 3]) -> Self
Builder: replaces the low/high RGB colours.
Sourcepub fn parse(key: &str) -> Option<NoiseTexture>
pub fn parse(key: &str) -> Option<NoiseTexture>
Parses a procedural texture key; malformed input returns None.
Trait Implementations§
Source§impl Clone for NoiseTexture
impl Clone for NoiseTexture
Source§fn clone(&self) -> NoiseTexture
fn clone(&self) -> NoiseTexture
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for NoiseTexture
Source§impl Debug for NoiseTexture
impl Debug for NoiseTexture
Source§impl PartialEq for NoiseTexture
impl PartialEq for NoiseTexture
impl StructuralPartialEq for NoiseTexture
Auto Trait Implementations§
impl Freeze for NoiseTexture
impl RefUnwindSafe for NoiseTexture
impl Send for NoiseTexture
impl Sync for NoiseTexture
impl Unpin for NoiseTexture
impl UnsafeUnpin for NoiseTexture
impl UnwindSafe for NoiseTexture
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreimpl<T> MaybeSync for T
impl<T> Scalar for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.