working on additive blending for determination of winding order. Saving here because this bug is very pretty

This commit is contained in:
2020-02-22 01:37:47 -08:00
parent b3e092e25a
commit 5dde94cdf9
7 changed files with 97 additions and 35 deletions

View File

@@ -392,7 +392,7 @@ impl CanvasState {
let mut image_vertex_buffer: HashMap<Arc<CanvasImageHandle>, Vec<ImageVertex3D>> = HashMap::new();
let mut text_instances: HashMap<Arc<CanvasFontHandle>, Vec<TextVertex3D>> = HashMap::new();
let mut text_vertex_buffer: Vec<TextVertex3D> = Vec::new();
let mut text_vertex_buffer: Vec<ColorVertex3D> = Vec::new();
for value in canvas_frame.map {
match value {
@@ -542,29 +542,58 @@ impl CanvasState {
}
}
self.dynamic_state = DynamicState {
line_width: None,
viewports: self.dynamic_state.viewports.clone(),
scissors: None,
compare_mask: Some(DynamicStencilValue {
face: StencilFaceFlags::StencilFrontAndBack,
value: 0xFF,
}),
write_mask: Some(DynamicStencilValue {
face: StencilFaceFlags::StencilFrontAndBack,
value: 0xFF,
}),
reference: Some(DynamicStencilValue {
face: StencilFaceFlags::StencilFrontAndBack,
value: 0xFF,
}),
};
// Text
let mut shader = self.shader_buffers.get(
self.get_shader_handle(String::from("simple_text"))
.unwrap().clone().get_handle() as usize
).unwrap();
//
// self.dynamic_state = DynamicState {
// line_width: None,
// viewports: self.dynamic_state.viewports.clone(),
// scissors: None,
// compare_mask: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0x00,
// }),
// write_mask: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0xFF,
// }),
// reference: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0x00,
// }),
// };
//
// if !allocated_buffers.text_vertex_buffer.is_empty() {
// command_buffer = command_buffer.draw(
// shader.get_pipeline().clone(),
// &self.dynamic_state.clone(),
// allocated_buffers.text_vertex_buffer.clone(),
// (), (),
// ).unwrap();
// }
//
// self.dynamic_state = DynamicState {
// line_width: None,
// viewports: self.dynamic_state.viewports.clone(),
// scissors: None,
// compare_mask: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0xFF,
// }),
// write_mask: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0x00,
// }),
// reference: Some(DynamicStencilValue {
// face: StencilFaceFlags::StencilFrontAndBack,
// value: 0x00,
// }),
// };
if !allocated_buffers.text_vertex_buffer.is_empty() {
command_buffer = command_buffer.draw(
@@ -575,6 +604,7 @@ impl CanvasState {
).unwrap();
}
command_buffer
.end_render_pass()
.unwrap()