Skip to content
This repository was archived by the owner on Feb 16, 2025. It is now read-only.

Commit cc6af6d

Browse files
authored
Auto merge of #191 - asajeffrey:glwindow-blending, r=Manishearth
Enable alpha blendingin the glwindow device This change gets AR examples, and multi-layer examples from WebXR Layers to work.
2 parents 7763f48 + 86e0753 commit cc6af6d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

webxr/glwindow/mod.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ impl DeviceAPI for GlWindowDevice {
276276
(gl::NO_ERROR, gl::FRAMEBUFFER_COMPLETE)
277277
);
278278

279-
self.gl.clear_color(0.2, 0.3, 0.3, 1.0);
279+
self.gl.clear_color(0.0, 0.0, 0.0, 0.0);
280280
self.gl.clear(gl::COLOR_BUFFER_BIT);
281281
debug_assert_eq!(self.gl.get_error(), gl::NO_ERROR);
282282

@@ -436,6 +436,14 @@ impl GlWindowDevice {
436436
(gl::NO_ERROR, gl::FRAMEBUFFER_COMPLETE)
437437
);
438438

439+
gl.enable(gl::BLEND);
440+
gl.blend_func_separate(
441+
gl::SRC_ALPHA,
442+
gl::ONE_MINUS_SRC_ALPHA,
443+
gl::ONE,
444+
gl::ONE_MINUS_SRC_ALPHA,
445+
);
446+
439447
let swap_chains = SwapChains::new();
440448
let layer_manager = None;
441449

0 commit comments

Comments
 (0)