Missing alpha blended vectors
Hi all,
I am in the process of porting https://github.com/mdsteele/azimuth for the web using Emscripten. The game uses OpenGL 2.1 functions, so I need gl4es as translation library.
I've replaced
#include <SDL_opengl.h>
with
#include <GL/gl.h>
and loaded initialize_gl4es() early on.
The compile runs fine, but there are certain (later destructable) alpha blended wall structures which are not visible in the port. In the native build those wall structures are visible.
I already tried to tweak some environment variables via https://github.com/ptitSeb/gl4es/blob/master/USAGE.md without success.
Thanks for your support and have a nice week midzer
Do you have any idea what kind of drawing those wall are doing?
Without deep OpenGL knowledge, I guess it has to be somewhere around https://github.com/mdsteele/azimuth/blob/050f838b35d19ffdc738f33178abaf9d69d834ec/src/azimuth/view/wall.c#L492, assuming it's a AZ_WALL_DESTRUCTIBLE_CHARGED wall.
The original author answered https://github.com/mdsteele/azimuth/issues/25#issuecomment-2405183156
This error is also thrown after level is loaded where those walls are opaque:
GL_INVALID_OPERATION: Vertex buffer is not big enough for the draw call
By replacing GL_QUADS with GL_TRIANGLE_STRIPS I could fix the issue.
Still strange it didn't worked with GL_QUADS, as internaly, they are replaced with GL_TRIANGLE_STRIP anyway.
In addition I had to exchange 3rd <-> 4th vertex.
Yeah, gl4es transformation quads->strip should be correct. But I guess there is an attribute somehow that got lost in the transformation.
Don't know.
Here are all the changes https://github.com/midzer/azimuth/tree/replaceQuads