Skip to content

Commit aec8514

Browse files
committed
[add] anisotropic clamping to public api
1 parent 8cbd2f3 commit aec8514

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

crates/lambda-rs/src/render/texture.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,19 @@ impl SamplerBuilder {
627627
return self;
628628
}
629629

630+
/// Set the maximum anisotropic filtering level.
631+
///
632+
/// Valid values are `1` (disabled) through `16`. Values outside this range
633+
/// are clamped. Higher values improve texture quality at oblique viewing
634+
/// angles but increase GPU cost.
635+
///
636+
/// Note: Anisotropic filtering is most effective with linear filtering and
637+
/// mipmapped textures.
638+
pub fn with_anisotropy_clamp(mut self, clamp: u16) -> Self {
639+
self.inner = self.inner.with_anisotropy_clamp(clamp);
640+
return self;
641+
}
642+
630643
/// Attach a debug label.
631644
pub fn with_label(mut self, label: &str) -> Self {
632645
self.inner = self.inner.with_label(label);

0 commit comments

Comments
 (0)