From 4ea8d2b8bbc0e0898fe740a9a343a642bb18f6a8 Mon Sep 17 00:00:00 2001 From: David Huculak Date: Sat, 17 Feb 2024 18:13:42 -0500 Subject: [PATCH] remove cubemap texture mipmapping todo --- ikari/src/asset_loader.rs | 2 -- ikari/src/renderer.rs | 2 -- ikari/src/texture.rs | 15 +-------------- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/ikari/src/asset_loader.rs b/ikari/src/asset_loader.rs index d0c65656..73ec2938 100644 --- a/ikari/src/asset_loader.rs +++ b/ikari/src/asset_loader.rs @@ -912,7 +912,6 @@ pub fn bind_skybox( wgpu::TextureFormat::Rgba8UnormSrgb, Some("cubemap_skybox_texture"), &er_background_texture, - false, // an artifact occurs between the edges of the texture with mipmaps enabled )? } BindableSkyboxBackground::Cube(image) => Texture::create_cubemap( @@ -972,7 +971,6 @@ pub fn bind_skybox( wgpu::TextureFormat::Rgba16Float, None, &er_hdr_env_texture, - false, )?; generate_diffuse_and_specular_maps(&hdr_env_texture) diff --git a/ikari/src/renderer.rs b/ikari/src/renderer.rs index 172ca2f9..79ddbbaa 100644 --- a/ikari/src/renderer.rs +++ b/ikari/src/renderer.rs @@ -2277,7 +2277,6 @@ impl Renderer { wgpu::TextureFormat::Rgba16Float, None, &texture_er, - false, )? }; @@ -2294,7 +2293,6 @@ impl Renderer { wgpu::TextureFormat::Rgba8UnormSrgb, None, background_texture_er, - false, // an artifact occurs between the edges of the texture with mipmaps enabled )?, diffuse_environment_map: Texture::create_diffuse_env_map( base, diff --git a/ikari/src/texture.rs b/ikari/src/texture.rs index dc62c9ae..34776642 100644 --- a/ikari/src/texture.rs +++ b/ikari/src/texture.rs @@ -1,6 +1,5 @@ use std::collections::hash_map::Entry; - use crate::camera::*; use crate::renderer::BaseRenderer; use crate::renderer::RendererConstantData; @@ -13,7 +12,6 @@ use crate::wasm_not_sync::WasmNotArc; use anyhow::*; use glam::f32::Vec3; - use serde::Deserialize; use serde::Serialize; use wgpu::util::DeviceExt; @@ -575,7 +573,6 @@ impl Texture { format: wgpu::TextureFormat, label: Option<&str>, er_texture: &Texture, - generate_mipmaps: bool, ) -> Result { let equirectangular_to_cubemap_pipeline = match format { wgpu::TextureFormat::Rgba8UnormSrgb => { @@ -596,18 +593,12 @@ impl Texture { depth_or_array_layers: 6, }; - let mip_level_count = if generate_mipmaps { - size.max_mips(wgpu::TextureDimension::D2) - } else { - 1 - }; - let cubemap_texture = base_renderer .device .create_texture(&wgpu::TextureDescriptor { label: if USE_LABELS { label } else { None }, size, - mip_level_count, + mip_level_count: 1, sample_count: 1, dimension: wgpu::TextureDimension::D2, format, @@ -754,10 +745,6 @@ impl Texture { base_renderer.queue.submit(Some(encoder.finish())); } - if generate_mipmaps { - todo!("Call generate_mipmaps_for_texture for each side of the cubemap"); - } - let view = cubemap_texture.create_view(&wgpu::TextureViewDescriptor { dimension: Some(wgpu::TextureViewDimension::Cube), ..Default::default()