diff options
Diffstat (limited to 'engine/src/renderer.rs')
| -rw-r--r-- | engine/src/renderer.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/engine/src/renderer.rs b/engine/src/renderer.rs index 066f3fc..1a77f9e 100644 --- a/engine/src/renderer.rs +++ b/engine/src/renderer.rs @@ -17,6 +17,7 @@ use crate::builder; use crate::draw_flags::{DrawFlags, NoDraw, PolygonModeConfig}; use crate::mesh::Mesh; use crate::model::{MaterialSearchResult, Model}; +use crate::renderer::blending::Config as BlendingConfig; use crate::renderer::object::{Id as ObjectId, Store as ObjectStore}; use crate::shader::cursor::{ BindingLocation as ShaderBindingLocation, @@ -33,6 +34,7 @@ use crate::shader::{ use crate::texture::{Texture, WHITE_1X1_ASSET_LABEL as TEXTURE_WHITE_1X1_ASSET_LABEL}; use crate::windowing::window::Window; +pub mod blending; pub mod object; pub mod opengl; @@ -218,6 +220,8 @@ pub enum MeshUsage pub struct DrawProperties { pub polygon_mode_config: PolygonModeConfig, + pub blending_enabled: bool, + pub blending_config: BlendingConfig, } bitflags! { @@ -225,6 +229,8 @@ bitflags! { pub struct DrawPropertiesUpdateFlags: usize { const POLYGON_MODE_CONFIG = 1 << 0; + const BLENDING_CONFIG = 1 << 1; + const BLENDING_ENABLED = 1 << 2; } } @@ -340,9 +346,7 @@ pub fn add_main_render_passes( renderer_ctx_ent_id, surface_id: surface_spec.id, commands: Vec::with_capacity(30), - draw_properties: DrawProperties { - polygon_mode_config: PolygonModeConfig::default(), - }, + draw_properties: DrawProperties::default(), }); let render_pass = render_passes.passes.front_mut().expect("Not possible"); @@ -468,6 +472,7 @@ pub fn add_main_render_passes( render_pass.commands.push(Command::UpdateDrawProperties( DrawProperties { polygon_mode_config: draw_flags.polygon_mode_config.clone(), + ..Default::default() }, DrawPropertiesUpdateFlags::POLYGON_MODE_CONFIG, )); @@ -491,6 +496,7 @@ pub fn add_main_render_passes( render_pass.commands.push(Command::UpdateDrawProperties( DrawProperties { polygon_mode_config: PolygonModeConfig::default(), + ..Default::default() }, DrawPropertiesUpdateFlags::POLYGON_MODE_CONFIG, )); |
