disable unneeded depth testing. enable antialiasing and alpha blending

This commit is contained in:
Dustin Carlino 2019-01-22 22:47:30 -08:00
parent 099846437c
commit 03215a5836
3 changed files with 6 additions and 7 deletions

View File

@ -66,6 +66,8 @@
## Switch to OpenGL (for speed) ## Switch to OpenGL (for speed)
- get things running again - get things running again
- editor is very slow... why?
- colors still seem off
- circles, arrows, other disabled things - circles, arrows, other disabled things
- forking - forking
- render text - render text

View File

@ -113,11 +113,7 @@ impl<'a> GfxCtx<'a> {
program: &'a glium::Program, program: &'a glium::Program,
) -> GfxCtx<'a> { ) -> GfxCtx<'a> {
let params = glium::DrawParameters { let params = glium::DrawParameters {
depth: glium::Depth { blend: glium::Blend::alpha_blending(),
test: glium::DepthTest::IfLess,
write: true,
..Default::default()
},
..Default::default() ..Default::default()
}; };
@ -152,7 +148,7 @@ impl<'a> GfxCtx<'a> {
pub fn clear(&mut self, color: Color) { pub fn clear(&mut self, color: Color) {
self.target self.target
.clear_color_and_depth((color.0[0], color.0[1], color.0[2], color.0[3]), 1.0); .clear_color(color.0[0], color.0[1], color.0[2], color.0[3]);
} }
// Use graphics::Line internally for now, but make it easy to switch to something else by // Use graphics::Line internally for now, but make it easy to switch to something else by

View File

@ -251,7 +251,8 @@ pub fn run<T, G: GUI<T>>(mut gui: G, window_title: &str) {
gui.get_mut_canvas().window_width, gui.get_mut_canvas().window_width,
gui.get_mut_canvas().window_height, gui.get_mut_canvas().window_height,
)); ));
let context = glutin::ContextBuilder::new().with_depth_buffer(24); // 2 looks bad, 4 looks fine
let context = glutin::ContextBuilder::new().with_multisampling(4);
let display = glium::Display::new(window, context, &events_loop).unwrap(); let display = glium::Display::new(window, context, &events_loop).unwrap();
let program = glium::Program::from_source( let program = glium::Program::from_source(
&display, &display,