Improved openGL and ImGUI implementation

This commit is contained in:
2026-03-10 20:46:53 +00:00
parent d5f27c8dc2
commit a31af8f9b8
3 changed files with 145 additions and 17 deletions
+13 -4
View File
@@ -1,9 +1,18 @@
#version 330 core
layout (location = 0) in vec2 aPos;
layout(location = 0) in vec3 aPos; // Position
layout(location = 1) in vec4 aColor; // Color (RGBA)
layout(location = 2) in float aLife; // Life
out vec3 vColor;
out vec4 vColor;
void main() {
gl_Position = vec4(aPos, 0.0, 1.0);
float alpha = aLife;
if (aLife > 0.0) {
alpha = aLife / 10.0; // Fade mortal particles
} else if (aLife < 0.0) {
alpha = 1.0; // Eternal particles are fully opaque
}
vColor = vec4(aColor.rgb, aColor.a * alpha);
gl_Position = vec4(aPos, 1.0);
gl_PointSize = 10.0; // Make them big enough to see!
}