mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-27 14:42:07 +00:00
a08261c620
This allows the use of an entity id to index into the entity data and fetch the transform and colormod data in the vertex shader, thus making instanced rendering possible. Non-world brush entities are still not rendered, but the world entity is using both the entity data buffer and entid buffer.
21 lines
426 B
GLSL
21 lines
426 B
GLSL
#version 450
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
#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)
|
|
{
|
|
vec3 vert = vertex * entities[entid].transform;
|
|
gl_Position = vec4 (vert, 1);;
|
|
InstanceIndex = gl_InstanceIndex;
|
|
}
|