17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 19:47: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

20
shaders/depthprepass.vert Normal file
View File

@@ -0,0 +1,20 @@
// depth prepass of the instances drawn from the gpu culling (opengl46_renderer::Render_Instances_Indirect()).
// the position is worked out the way vertex.vert of the materials does it, and declared invariant in both, so the colour
// pass which follows gets the same depth for the same surface
layout(location = 0) in vec3 v_vert;
layout(location = 2) in vec2 v_coord;
#include <common>
invariant gl_Position;
out vec2 f_coord;
void main()
{
mat4 mv = effective_modelview();
vec4 position = mv * vec4(v_vert, 1.0);
gl_Position = projection * position;
f_coord = v_coord;
}