quakeforge/libs/video/renderer/vulkan/shader/bsp_shadow.vert
Bill Currie ff27da4a05 [vulkan] Use the shadow matrices when rendering maps
It turns out bsp faces are still back-face culled despite the null point
being on the front of every possible plane... or really, because it's on
the front of every possible plane: sometimes the back face is the front
face, and this breaks the face selection code (a separate traversal
function will be needed for non-culling rendering).

Despite that, other than having to deal with different pipelines,
getting the model renderers working went better than expected.
2023-07-30 11:52:13 +09:00

29 lines
615 B
GLSL

#version 450
#extension GL_GOOGLE_include_directive : enable
#extension GL_EXT_multiview : enable
layout (set = 0, binding = 0) buffer ShadowView {
mat4x4 shadowView[];
};
layout (push_constant) uniform PushConstants {
uint MatrixBase;
};
#include "entity.h"
layout (set = 1, binding = 0) buffer Entities {
Entity entities[];
};
layout (location = 0) in vec4 vertex;
layout (location = 2) in uint entid;
layout (location = 0) out int InstanceIndex;
void
main (void)
{
vec4 pos = vec4 (vertex * entities[entid].transform, 1);
gl_Position = shadowView[MatrixBase + gl_ViewIndex] * pos;
}