mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Remove unused waves texture
This commit is contained in:
parent
ebe063442a
commit
af1962f11c
@ -37,18 +37,13 @@ layout(location = 1) flat in uint f_pos_norm;
|
|||||||
// ShadowLocals shadowMats[/*MAX_LAYER_FACES*/192];
|
// ShadowLocals shadowMats[/*MAX_LAYER_FACES*/192];
|
||||||
// };
|
// };
|
||||||
|
|
||||||
layout(std140, set = 3, binding = 0)
|
layout(std140, set = 2, binding = 0)
|
||||||
uniform u_locals {
|
uniform u_locals {
|
||||||
vec3 model_offs;
|
vec3 model_offs;
|
||||||
float load_time;
|
float load_time;
|
||||||
ivec4 atlas_offs;
|
ivec4 atlas_offs;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(set = 2, binding = 0)
|
|
||||||
uniform texture2D t_waves;
|
|
||||||
layout(set = 2, binding = 1)
|
|
||||||
uniform sampler s_waves;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 tgt_color;
|
layout(location = 0) out vec4 tgt_color;
|
||||||
|
|
||||||
#include <sky.glsl>
|
#include <sky.glsl>
|
||||||
|
@ -39,18 +39,13 @@ layout(location = 1) flat in uint f_pos_norm;
|
|||||||
// ShadowLocals shadowMats[/*MAX_LAYER_FACES*/192];
|
// ShadowLocals shadowMats[/*MAX_LAYER_FACES*/192];
|
||||||
//};
|
//};
|
||||||
|
|
||||||
layout(std140, set = 3, binding = 0)
|
layout(std140, set = 2, binding = 0)
|
||||||
uniform u_locals {
|
uniform u_locals {
|
||||||
vec3 model_offs;
|
vec3 model_offs;
|
||||||
float load_time;
|
float load_time;
|
||||||
ivec4 atlas_offs;
|
ivec4 atlas_offs;
|
||||||
};
|
};
|
||||||
|
|
||||||
layout(set = 2, binding = 0)
|
|
||||||
uniform texture2D t_waves;
|
|
||||||
layout(set = 2, binding = 1)
|
|
||||||
uniform sampler s_waves;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 tgt_color;
|
layout(location = 0) out vec4 tgt_color;
|
||||||
|
|
||||||
#include <cloud.glsl>
|
#include <cloud.glsl>
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
layout(location = 0) in uint v_pos_norm;
|
layout(location = 0) in uint v_pos_norm;
|
||||||
// in uint v_col_light;
|
// in uint v_col_light;
|
||||||
|
|
||||||
layout(std140, set = 3, binding = 0)
|
layout(std140, set = 2, binding = 0)
|
||||||
uniform u_locals {
|
uniform u_locals {
|
||||||
vec3 model_offs;
|
vec3 model_offs;
|
||||||
float load_time;
|
float load_time;
|
||||||
|
BIN
assets/voxygen/texture/waves.png
(Stored with Git LFS)
BIN
assets/voxygen/texture/waves.png
(Stored with Git LFS)
Binary file not shown.
@ -25,7 +25,7 @@ pub use self::{
|
|||||||
BoneData as FigureBoneData, BoneMeshes, FigureLayout, FigureModel,
|
BoneData as FigureBoneData, BoneMeshes, FigureLayout, FigureModel,
|
||||||
Locals as FigureLocals,
|
Locals as FigureLocals,
|
||||||
},
|
},
|
||||||
fluid::{BindGroup as FluidWaves, Vertex as FluidVertex},
|
fluid::Vertex as FluidVertex,
|
||||||
lod_terrain::{LodData, Vertex as LodTerrainVertex},
|
lod_terrain::{LodData, Vertex as LodTerrainVertex},
|
||||||
particle::{Instance as ParticleInstance, Vertex as ParticleVertex},
|
particle::{Instance as ParticleInstance, Vertex as ParticleVertex},
|
||||||
postprocess::Locals as PostProcessLocals,
|
postprocess::Locals as PostProcessLocals,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use super::super::{AaMode, GlobalsLayouts, TerrainLayout, Texture, Vertex as VertexTrait};
|
use super::super::{AaMode, GlobalsLayouts, TerrainLayout, Vertex as VertexTrait};
|
||||||
use bytemuck::{Pod, Zeroable};
|
use bytemuck::{Pod, Zeroable};
|
||||||
use std::mem;
|
use std::mem;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
@ -47,65 +47,6 @@ impl VertexTrait for Vertex {
|
|||||||
const STRIDE: wgpu::BufferAddress = mem::size_of::<Self>() as wgpu::BufferAddress;
|
const STRIDE: wgpu::BufferAddress = mem::size_of::<Self>() as wgpu::BufferAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct BindGroup {
|
|
||||||
pub(in super::super) bind_group: wgpu::BindGroup,
|
|
||||||
waves: Texture,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct FluidLayout {
|
|
||||||
pub waves: wgpu::BindGroupLayout,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl FluidLayout {
|
|
||||||
pub fn new(device: &wgpu::Device) -> Self {
|
|
||||||
Self {
|
|
||||||
waves: device.create_bind_group_layout(&wgpu::BindGroupLayoutDescriptor {
|
|
||||||
label: None,
|
|
||||||
entries: &[
|
|
||||||
wgpu::BindGroupLayoutEntry {
|
|
||||||
binding: 0,
|
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
|
||||||
ty: wgpu::BindingType::Texture {
|
|
||||||
sample_type: wgpu::TextureSampleType::Float { filterable: true },
|
|
||||||
view_dimension: wgpu::TextureViewDimension::D2,
|
|
||||||
multisampled: false,
|
|
||||||
},
|
|
||||||
count: None,
|
|
||||||
},
|
|
||||||
wgpu::BindGroupLayoutEntry {
|
|
||||||
binding: 1,
|
|
||||||
visibility: wgpu::ShaderStage::VERTEX | wgpu::ShaderStage::FRAGMENT,
|
|
||||||
ty: wgpu::BindingType::Sampler {
|
|
||||||
filtering: true,
|
|
||||||
comparison: false,
|
|
||||||
},
|
|
||||||
count: None,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn bind(&self, device: &wgpu::Device, waves: Texture) -> BindGroup {
|
|
||||||
let bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor {
|
|
||||||
label: None,
|
|
||||||
layout: &self.waves,
|
|
||||||
entries: &[
|
|
||||||
wgpu::BindGroupEntry {
|
|
||||||
binding: 0,
|
|
||||||
resource: wgpu::BindingResource::TextureView(&waves.view),
|
|
||||||
},
|
|
||||||
wgpu::BindGroupEntry {
|
|
||||||
binding: 1,
|
|
||||||
resource: wgpu::BindingResource::Sampler(&waves.sampler),
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
|
|
||||||
BindGroup { bind_group, waves }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct FluidPipeline {
|
pub struct FluidPipeline {
|
||||||
pub pipeline: wgpu::RenderPipeline,
|
pub pipeline: wgpu::RenderPipeline,
|
||||||
}
|
}
|
||||||
@ -116,7 +57,6 @@ impl FluidPipeline {
|
|||||||
vs_module: &wgpu::ShaderModule,
|
vs_module: &wgpu::ShaderModule,
|
||||||
fs_module: &wgpu::ShaderModule,
|
fs_module: &wgpu::ShaderModule,
|
||||||
global_layout: &GlobalsLayouts,
|
global_layout: &GlobalsLayouts,
|
||||||
layout: &FluidLayout,
|
|
||||||
terrain_layout: &TerrainLayout,
|
terrain_layout: &TerrainLayout,
|
||||||
aa_mode: AaMode,
|
aa_mode: AaMode,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
@ -128,7 +68,6 @@ impl FluidPipeline {
|
|||||||
bind_group_layouts: &[
|
bind_group_layouts: &[
|
||||||
&global_layout.globals,
|
&global_layout.globals,
|
||||||
&global_layout.shadow_textures,
|
&global_layout.shadow_textures,
|
||||||
&layout.waves,
|
|
||||||
&terrain_layout.locals,
|
&terrain_layout.locals,
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
|
@ -21,7 +21,7 @@ use super::{
|
|||||||
mesh::Mesh,
|
mesh::Mesh,
|
||||||
model::{DynamicModel, Model},
|
model::{DynamicModel, Model},
|
||||||
pipelines::{
|
pipelines::{
|
||||||
blit, clouds, figure, fluid, postprocess, shadow, sprite, terrain, ui, GlobalsBindGroup,
|
blit, clouds, figure, postprocess, shadow, sprite, terrain, ui, GlobalsBindGroup,
|
||||||
GlobalsLayouts, ShadowTexturesBindGroup,
|
GlobalsLayouts, ShadowTexturesBindGroup,
|
||||||
},
|
},
|
||||||
texture::Texture,
|
texture::Texture,
|
||||||
@ -49,7 +49,6 @@ struct Layouts {
|
|||||||
|
|
||||||
clouds: clouds::CloudsLayout,
|
clouds: clouds::CloudsLayout,
|
||||||
figure: figure::FigureLayout,
|
figure: figure::FigureLayout,
|
||||||
fluid: fluid::FluidLayout,
|
|
||||||
postprocess: postprocess::PostProcessLayout,
|
postprocess: postprocess::PostProcessLayout,
|
||||||
shadow: shadow::ShadowLayout,
|
shadow: shadow::ShadowLayout,
|
||||||
sprite: sprite::SpriteLayout,
|
sprite: sprite::SpriteLayout,
|
||||||
@ -266,7 +265,6 @@ impl Renderer {
|
|||||||
|
|
||||||
let clouds = clouds::CloudsLayout::new(&device);
|
let clouds = clouds::CloudsLayout::new(&device);
|
||||||
let figure = figure::FigureLayout::new(&device);
|
let figure = figure::FigureLayout::new(&device);
|
||||||
let fluid = fluid::FluidLayout::new(&device);
|
|
||||||
let postprocess = postprocess::PostProcessLayout::new(&device);
|
let postprocess = postprocess::PostProcessLayout::new(&device);
|
||||||
let shadow = shadow::ShadowLayout::new(&device);
|
let shadow = shadow::ShadowLayout::new(&device);
|
||||||
let sprite = sprite::SpriteLayout::new(&device);
|
let sprite = sprite::SpriteLayout::new(&device);
|
||||||
@ -279,7 +277,6 @@ impl Renderer {
|
|||||||
|
|
||||||
clouds,
|
clouds,
|
||||||
figure,
|
figure,
|
||||||
fluid,
|
|
||||||
postprocess,
|
postprocess,
|
||||||
shadow,
|
shadow,
|
||||||
sprite,
|
sprite,
|
||||||
|
@ -2,7 +2,7 @@ use super::{
|
|||||||
super::{
|
super::{
|
||||||
buffer::Buffer,
|
buffer::Buffer,
|
||||||
pipelines::{
|
pipelines::{
|
||||||
figure, fluid, lod_terrain, shadow, sprite, terrain, ui, ColLights, GlobalModel,
|
figure, lod_terrain, shadow, sprite, terrain, ui, ColLights, GlobalModel,
|
||||||
GlobalsBindGroup,
|
GlobalsBindGroup,
|
||||||
},
|
},
|
||||||
texture::Texture,
|
texture::Texture,
|
||||||
@ -87,8 +87,4 @@ impl Renderer {
|
|||||||
pub fn sprite_bind_col_light(&self, col_light: Texture) -> ColLights<sprite::Locals> {
|
pub fn sprite_bind_col_light(&self, col_light: Texture) -> ColLights<sprite::Locals> {
|
||||||
self.layouts.global.bind_col_light(&self.device, col_light)
|
self.layouts.global.bind_col_light(&self.device, col_light)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn fluid_bind_waves(&self, texture: Texture) -> fluid::BindGroup {
|
|
||||||
self.layouts.fluid.bind(&self.device, texture)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -584,15 +584,11 @@ impl<'pass> FirstPassDrawer<'pass> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn draw_fluid<'data: 'pass>(
|
pub fn draw_fluid<'data: 'pass>(&mut self) -> FluidDrawer<'_, 'pass> {
|
||||||
&mut self,
|
|
||||||
waves: &'data fluid::BindGroup,
|
|
||||||
) -> FluidDrawer<'_, 'pass> {
|
|
||||||
let mut render_pass = self.render_pass.scope("fluid", self.borrow.device);
|
let mut render_pass = self.render_pass.scope("fluid", self.borrow.device);
|
||||||
|
|
||||||
render_pass.set_pipeline(&self.pipelines.fluid.pipeline);
|
render_pass.set_pipeline(&self.pipelines.fluid.pipeline);
|
||||||
set_quad_index_buffer::<fluid::Vertex>(&mut render_pass, &self.borrow);
|
set_quad_index_buffer::<fluid::Vertex>(&mut render_pass, &self.borrow);
|
||||||
render_pass.set_bind_group(2, &waves.bind_group, &[]);
|
|
||||||
|
|
||||||
FluidDrawer { render_pass }
|
FluidDrawer { render_pass }
|
||||||
}
|
}
|
||||||
@ -717,7 +713,7 @@ impl<'pass_ref, 'pass: 'pass_ref> FluidDrawer<'pass_ref, 'pass> {
|
|||||||
locals: &'data terrain::BoundLocals,
|
locals: &'data terrain::BoundLocals,
|
||||||
) {
|
) {
|
||||||
self.render_pass.set_vertex_buffer(0, model.buf().slice(..));
|
self.render_pass.set_vertex_buffer(0, model.buf().slice(..));
|
||||||
self.render_pass.set_bind_group(3, &locals.bind_group, &[]);
|
self.render_pass.set_bind_group(2, &locals.bind_group, &[]);
|
||||||
self.render_pass
|
self.render_pass
|
||||||
.draw_indexed(0..model.len() as u32 / 4 * 6, 0, 0..1);
|
.draw_indexed(0..model.len() as u32 / 4 * 6, 0, 0..1);
|
||||||
}
|
}
|
||||||
|
@ -439,7 +439,6 @@ fn create_ingame_and_shadow_pipelines(
|
|||||||
&shaders.fluid_vert,
|
&shaders.fluid_vert,
|
||||||
&shaders.fluid_frag,
|
&shaders.fluid_frag,
|
||||||
&layouts.global,
|
&layouts.global,
|
||||||
&layouts.fluid,
|
|
||||||
&layouts.terrain,
|
&layouts.terrain,
|
||||||
mode.aa,
|
mode.aa,
|
||||||
)
|
)
|
||||||
|
@ -11,9 +11,9 @@ use crate::{
|
|||||||
render::{
|
render::{
|
||||||
create_sprite_verts_buffer,
|
create_sprite_verts_buffer,
|
||||||
pipelines::{self, ColLights},
|
pipelines::{self, ColLights},
|
||||||
Buffer, ColLightInfo, FirstPassDrawer, FluidVertex, FluidWaves, GlobalModel, Instances,
|
Buffer, ColLightInfo, FirstPassDrawer, FluidVertex, GlobalModel, Instances, LodData, Mesh,
|
||||||
LodData, Mesh, Model, RenderError, Renderer, SpriteGlobalsBindGroup, SpriteInstance,
|
Model, RenderError, Renderer, SpriteGlobalsBindGroup, SpriteInstance, SpriteVertex,
|
||||||
SpriteVertex, TerrainLocals, TerrainShadowDrawer, TerrainVertex, SPRITE_VERT_PAGE_SIZE,
|
TerrainLocals, TerrainShadowDrawer, TerrainVertex, SPRITE_VERT_PAGE_SIZE,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -360,7 +360,6 @@ pub struct Terrain<V: RectRasterableVol = TerrainChunk> {
|
|||||||
/// for any particular chunk; look at the `texture` field in
|
/// for any particular chunk; look at the `texture` field in
|
||||||
/// `TerrainChunkData` for that.
|
/// `TerrainChunkData` for that.
|
||||||
col_lights: Arc<ColLights<pipelines::terrain::Locals>>,
|
col_lights: Arc<ColLights<pipelines::terrain::Locals>>,
|
||||||
waves: FluidWaves,
|
|
||||||
|
|
||||||
phantom: PhantomData<V>,
|
phantom: PhantomData<V>,
|
||||||
}
|
}
|
||||||
@ -590,24 +589,6 @@ impl<V: RectRasterableVol> Terrain<V> {
|
|||||||
&sprite_render_context.sprite_verts_buffer,
|
&sprite_render_context.sprite_verts_buffer,
|
||||||
),
|
),
|
||||||
col_lights: Arc::new(col_lights),
|
col_lights: Arc::new(col_lights),
|
||||||
waves: {
|
|
||||||
let waves_tex = renderer
|
|
||||||
.create_texture(
|
|
||||||
// TODO: actually this is unused, remove?
|
|
||||||
// TODO: re-add alpha channel?
|
|
||||||
&image::DynamicImage::ImageRgba8(
|
|
||||||
assets::Image::load_expect("voxygen.texture.waves")
|
|
||||||
.read()
|
|
||||||
.0
|
|
||||||
.to_rgba8(),
|
|
||||||
),
|
|
||||||
Some(wgpu::FilterMode::Linear),
|
|
||||||
Some(wgpu::AddressMode::Repeat),
|
|
||||||
)
|
|
||||||
.expect("Failed to create wave texture");
|
|
||||||
|
|
||||||
renderer.fluid_bind_waves(waves_tex)
|
|
||||||
},
|
|
||||||
phantom: PhantomData,
|
phantom: PhantomData,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1599,7 +1580,7 @@ impl<V: RectRasterableVol> Terrain<V> {
|
|||||||
|
|
||||||
// Translucent
|
// Translucent
|
||||||
span!(guard, "Fluid chunks");
|
span!(guard, "Fluid chunks");
|
||||||
let mut fluid_drawer = drawer.draw_fluid(&self.waves);
|
let mut fluid_drawer = drawer.draw_fluid();
|
||||||
chunk_iter
|
chunk_iter
|
||||||
.filter(|(_, chunk)| chunk.visible.is_visible())
|
.filter(|(_, chunk)| chunk.visible.is_visible())
|
||||||
.filter_map(|(_, chunk)| {
|
.filter_map(|(_, chunk)| {
|
||||||
|
Loading…
Reference in New Issue
Block a user