38 lines
772 B
GLSL
38 lines
772 B
GLSL
#version 450
|
|
#extension GL_KHR_vulkan_glsl : enable
|
|
|
|
//#include "ShaderDescriptorDefinitions.glsl"
|
|
|
|
layout(location = 0) in vec3 aVertexPos;
|
|
layout(location = 1) in vec2 aUV;
|
|
layout(location = 2) in vec3 aNormal;
|
|
layout(location = 3) in vec3 aTangent;
|
|
layout(location = 4) in mat4 worldTransform;
|
|
|
|
|
|
layout(location = 0) out struct
|
|
{
|
|
vec4 vertColor; // location 0
|
|
vec2 uv; // location = 1
|
|
|
|
} Out;
|
|
|
|
// material stuff
|
|
layout(location = 2) out struct
|
|
{
|
|
int materialIndex;
|
|
} Out2;
|
|
|
|
layout(set = 2, binding = 0) uniform CameraData
|
|
{
|
|
vec4 position;
|
|
mat4 vpMat;
|
|
} cameraData;
|
|
|
|
void main()
|
|
{
|
|
Out.uv = aUV;
|
|
Out2.materialIndex = gl_InstanceIndex;
|
|
gl_Position = cameraData.vpMat * worldTransform * vec4 (aVertexPos, 1.0f);
|
|
Out.vertColor = vec4 (aVertexPos, 1.0f);
|
|
} |