Added conservative rasterization example

Refs #422
This commit is contained in:
saschawillems 2018-03-03 17:32:28 +01:00
parent c918914bd4
commit b2d37e714b
12 changed files with 837 additions and 0 deletions

View file

@ -0,0 +1,11 @@
#version 450
layout (binding = 1) uniform sampler2D samplerColor;
layout (location = 0) in vec2 inUV;
layout (location = 0) out vec4 outFragColor;
void main()
{
outFragColor = texture(samplerColor, inUV);
}

Binary file not shown.

View file

@ -0,0 +1,14 @@
#version 450
layout (location = 0) out vec2 outUV;
out gl_PerVertex
{
vec4 gl_Position;
};
void main()
{
outUV = vec2((gl_VertexIndex << 1) & 2, gl_VertexIndex & 2);
gl_Position = vec4(outUV * 2.0f - 1.0f, 0.0f, 1.0f);
}

Binary file not shown.

View file

@ -0,0 +1,10 @@
#version 450
layout (location = 0) in vec3 inColor;
layout (location = 0) out vec4 outFragColor;
void main()
{
outFragColor.rgb = inColor;
}

Binary file not shown.

View file

@ -0,0 +1,23 @@
#version 450
layout (location = 0) in vec3 inPos;
layout (location = 1) in vec3 inColor;
layout (binding = 0) uniform UBO
{
mat4 projection;
mat4 model;
} ubo;
layout (location = 0) out vec3 outColor;
out gl_PerVertex
{
vec4 gl_Position;
};
void main()
{
outColor = inColor;
gl_Position = ubo.projection * ubo.model * vec4(inPos, 1.0);
}

Binary file not shown.

View file

@ -0,0 +1,8 @@
#version 450
layout (location = 0) out vec4 outFragColor;
void main()
{
outFragColor.rgb = vec3(1.0, 1.0, 1.0);
}