Use createBuffer function from Vulkan device class
This commit is contained in:
parent
927660680d
commit
e573a4c244
15 changed files with 222 additions and 233 deletions
|
|
@ -3,15 +3,6 @@
|
|||
#extension GL_ARB_separate_shader_objects : enable
|
||||
#extension GL_ARB_shading_language_420pack : enable
|
||||
|
||||
layout (location = 0) in vec3 inPos;
|
||||
layout (location = 1) in vec2 inUV;
|
||||
|
||||
layout (binding = 0) uniform UBO
|
||||
{
|
||||
mat4 projection;
|
||||
mat4 model;
|
||||
} ubo;
|
||||
|
||||
layout (location = 0) out vec2 outUV;
|
||||
|
||||
out gl_PerVertex
|
||||
|
|
@ -21,6 +12,6 @@ out gl_PerVertex
|
|||
|
||||
void main()
|
||||
{
|
||||
outUV = inUV;
|
||||
gl_Position = ubo.projection * ubo.model * vec4(inPos.xyz, 1.0);
|
||||
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.
|
|
@ -11,6 +11,8 @@ layout (location = 2) in vec3 inViewVec;
|
|||
layout (location = 3) in vec3 inLightVec;
|
||||
layout (location = 4) in vec4 inShadowCoord;
|
||||
|
||||
layout (constant_id = 0) const int enablePCF = 0;
|
||||
|
||||
layout (location = 0) out vec4 outFragColor;
|
||||
|
||||
#define ambient 0.1
|
||||
|
|
@ -55,7 +57,7 @@ float filterPCF(vec4 sc)
|
|||
|
||||
void main()
|
||||
{
|
||||
float shadow = filterPCF(inShadowCoord / inShadowCoord.w);
|
||||
float shadow = (enablePCF == 1) ? filterPCF(inShadowCoord / inShadowCoord.w) : textureProj(inShadowCoord / inShadowCoord.w, vec2(0.0));
|
||||
|
||||
vec3 N = normalize(inNormal);
|
||||
vec3 L = normalize(inLightVec);
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue