Skip to content

Commit

Permalink
remove cubemap texture mipmapping todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidster committed Feb 17, 2024
1 parent e129c7b commit 4ea8d2b
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
2 changes: 0 additions & 2 deletions ikari/src/asset_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions ikari/src/renderer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2277,7 +2277,6 @@ impl Renderer {
wgpu::TextureFormat::Rgba16Float,
None,
&texture_er,
false,
)?
};

Expand All @@ -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,
Expand Down
15 changes: 1 addition & 14 deletions ikari/src/texture.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
use std::collections::hash_map::Entry;


use crate::camera::*;
use crate::renderer::BaseRenderer;
use crate::renderer::RendererConstantData;
Expand All @@ -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;
Expand Down Expand Up @@ -575,7 +573,6 @@ impl Texture {
format: wgpu::TextureFormat,
label: Option<&str>,
er_texture: &Texture,
generate_mipmaps: bool,
) -> Result<Self> {
let equirectangular_to_cubemap_pipeline = match format {
wgpu::TextureFormat::Rgba8UnormSrgb => {
Expand All @@ -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,
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 4ea8d2b

Please sign in to comment.