disable transparency

pull/4/head
Milk.H 2024-04-27 09:49:12 +01:00
parent d29e9c01c2
commit d17bc77f6c
2 changed files with 15 additions and 6 deletions

View File

@ -8,5 +8,8 @@ uniform sampler2D texture1;
void main()
{
FragColor = texture(texture1, TexCoord);
vec4 texColor = texture(texture1, TexCoord);
if(texColor.a < 0.1)
discard;
FragColor = texColor;
}

View File

@ -32,10 +32,12 @@ fn main() {
let window_builder = Some(WindowBuilder::new()
.with_transparent(true)
.with_transparent(false)
.with_title("MGQ Fighter Test")
);
let template = ConfigTemplateBuilder::new();
let template = ConfigTemplateBuilder::new()
.with_transparency(false);
let display_builder = DisplayBuilder::new()
.with_window_builder(window_builder);
@ -59,6 +61,7 @@ fn main() {
.unwrap();
// probably not needed here
//let raw_window_handle = window.as_ref().map(|window| window.window_handle()
// .unwrap()
@ -94,8 +97,6 @@ fn main() {
// current Window Reference Counter
let window = Rc::new(window.unwrap());
// window title
window.set_title("MGQ Fighter Test");
let attrs = window.build_surface_attributes(<_>::default());
@ -118,6 +119,11 @@ fn main() {
});
unsafe {
gl.disable(glow::BLEND);
gl.blend_func(glow::ONE, glow::ZERO);
}
// TODO write bevy Init code here
@ -169,7 +175,7 @@ fn main() {
Event::MainEventsCleared => {
unsafe {
gl.clear_color(0.0, 0.0, 0.0, 0.5);
gl.clear_color(0.0, 0.0, 0.0, 1.0);
gl.clear(glow::COLOR_BUFFER_BIT);
}