Some gltf improvements #4

Merged
SeanOMik merged 13 commits from feature/gltf-scene-fixes into main 2024-03-09 05:46:45 +00:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 88cda91657 - Show all commits

View File

@ -307,6 +307,7 @@ impl RenderTexture {
}
/// Convert [`lyra_resource::WrappingMode`] to [`wgpu::AddressMode`]
#[inline(always)]
fn res_wrap_to_wgpu(wmode: WrappingMode) -> wgpu::AddressMode {
match wmode {
WrappingMode::ClampToEdge => wgpu::AddressMode::ClampToEdge,
@ -316,6 +317,7 @@ fn res_wrap_to_wgpu(wmode: WrappingMode) -> wgpu::AddressMode {
}
/// Convert [`lyra_resource::FilterMode`] to [`wgpu::FilterMode`]
#[inline(always)]
fn res_filter_to_wgpu(fmode: FilterMode) -> wgpu::FilterMode {
match fmode {
FilterMode::Nearest => wgpu::FilterMode::Nearest,

View File

@ -319,6 +319,7 @@ impl Material {
}
impl From<gltf::texture::MagFilter> for FilterMode {
#[inline(always)]
fn from(value: gltf::texture::MagFilter) -> Self {
match value {
gltf::texture::MagFilter::Nearest => Self::Nearest,
@ -329,6 +330,7 @@ impl From<gltf::texture::MagFilter> for FilterMode {
impl FilterMode {
/// Get the MinFilter mode and the mipmap filter mode from gltf MinFilter
#[inline(always)]
pub fn from_min_filter(minf: MinFilter) -> FilterMode {
match minf {
MinFilter::Nearest => FilterMode::Nearest,
@ -340,6 +342,7 @@ impl FilterMode {
}
}
#[inline(always)]
pub fn from_mag_filter(magf: MagFilter) -> FilterMode {
match magf {
MagFilter::Nearest => FilterMode::Nearest,
@ -347,6 +350,7 @@ impl FilterMode {
}
}
#[inline(always)]
pub fn mipmap_filter(minf: MinFilter) -> Option<FilterMode> {
match minf {
MinFilter::Nearest => None,
@ -360,6 +364,7 @@ impl FilterMode {
}
impl From<gltf::texture::WrappingMode> for WrappingMode {
#[inline(always)]
fn from(value: gltf::texture::WrappingMode) -> Self {
match value {
gltf::texture::WrappingMode::ClampToEdge => Self::ClampToEdge,