Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ fn main() {
("chunk_border.frag", shaderc::ShaderKind::Fragment),
("item_entity.vert", shaderc::ShaderKind::Vertex),
("item_entity.frag", shaderc::ShaderKind::Fragment),
("cloud.vert", shaderc::ShaderKind::Vertex),
("cloud.frag", shaderc::ShaderKind::Fragment),
];

for (file, kind) in &shaders {
Expand Down
19 changes: 19 additions & 0 deletions src/renderer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ pub struct Renderer {
entity_renderer: EntityRenderer,
chunk_border_pipeline: pipelines::chunk_borders::ChunkBorderPipeline,
item_entity_pipeline: pipelines::item_entity::ItemEntityPipeline,
cloud_pipeline: pipelines::cloud::CloudPipeline,
chunk_buffers: ChunkBufferStore,
swapchain_dirty: bool,
width: u32,
Expand Down Expand Up @@ -276,6 +277,16 @@ impl Renderer {
&atlas,
);

let cloud_pipeline = pipelines::cloud::CloudPipeline::new(
&ctx.device,
swapchain_state.render_pass,
&ctx.allocator,
ctx.graphics_queue,
ctx.command_pool,
jar_assets_dir,
asset_index,
);

Ok(Self {
ctx,
swapchain: swapchain_state,
Expand All @@ -295,6 +306,7 @@ impl Renderer {
entity_renderer,
chunk_border_pipeline,
item_entity_pipeline,
cloud_pipeline,
chunk_buffers,
swapchain_dirty: false,
width: size.width.max(1),
Expand Down Expand Up @@ -522,6 +534,8 @@ impl Renderer {
.recreate_pipeline(&self.ctx.device, self.swapchain.render_pass);
self.item_entity_pipeline
.recreate_pipeline(&self.ctx.device, self.swapchain.render_pass);
self.cloud_pipeline
.recreate_pipeline(&self.ctx.device, self.swapchain.render_pass);
self.blur_pipeline.resize(
&self.ctx.device,
&self.ctx.allocator,
Expand Down Expand Up @@ -939,6 +953,9 @@ impl Renderer {
.draw_indirect(&self.ctx.device, cmd, frame);
let cull_ms = t_cull.elapsed().as_secs_f32() * 1000.0;

self.cloud_pipeline
.draw(&self.ctx.device, cmd, frame, &self.camera, sky);

if let Some((block_pos, stage)) = destroy_info {
self.block_overlay_pipeline.draw(
&self.ctx.device,
Expand Down Expand Up @@ -1198,6 +1215,8 @@ impl Drop for Renderer {
.destroy(&self.ctx.device, &self.ctx.allocator);
self.item_entity_pipeline
.destroy(&self.ctx.device, &self.ctx.allocator);
self.cloud_pipeline
.destroy(&self.ctx.device, &self.ctx.allocator);
self.atlas.destroy(&self.ctx.device, &self.ctx.allocator);
self.swapchain.destroy(
&self.ctx.device,
Expand Down
Loading
Loading