17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 14:53:30 +01:00

Draw instances from the GPU culling with indirect draws, occlusion culling and a depth prepass

This commit is contained in:
2026-10-16 12:54:52 +02:00
parent 2f0a06b98e
commit 466cb5339e
23 changed files with 1002 additions and 32 deletions

View File

@@ -0,0 +1,16 @@
// depth prepass of materials whose colour shader tests the alpha of the diffuse texture against the opacity of the
// material (mat_default.frag and the like). the test here is stricter by one step of 8-bit alpha: a fragment which writes
// depth here is never discarded by the colour pass, which would leave a hole with nothing drawn behind it
in vec2 f_coord;
#include <common>
#texture (diffuse, 0, sRGB_A)
uniform sampler2D diffuse;
void main()
{
if (texture(diffuse, f_coord).a < opacity + 1.0 / 255.0)
discard;
}