transparency/alpha: blending v_0
authorFrantišek Kučera <franta-hg@frantovo.cz>
Sun, 03 Dec 2023 13:13:37 +0100
branchv_0
changeset 15 1eb7cfefbeea
parent 14 ceeb36fad818
child 16 0883358bc11d
transparency/alpha: blending
Shark.cpp
shaders/default.frag
--- a/Shark.cpp	Sun Dec 03 12:32:55 2023 +0100
+++ b/Shark.cpp	Sun Dec 03 13:13:37 2023 +0100
@@ -272,6 +272,10 @@
 	glc = glXCreateContext(dpy, vi, NULL, GL_TRUE);
 	glXMakeCurrent(dpy, win, glc);
 
+	glEnable(GL_DEPTH_TEST);
+	glEnable(GL_BLEND);
+	glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+
 	clear();
 	glXSwapBuffers(dpy, win);
 
--- a/shaders/default.frag	Sun Dec 03 12:32:55 2023 +0100
+++ b/shaders/default.frag	Sun Dec 03 13:13:37 2023 +0100
@@ -15,5 +15,5 @@
 	// fColor = grayscale(fColor);
 	// fColor *= vec4(0.8, 1., 0.2, 1.);
 
-	if (fColor.a < 0.1) discard;
+	// if (fColor.a < 0.1) discard;
 }