parent
8acc59a2e1
commit
652fc3ab00
9 changed files with 1 additions and 9 deletions
|
|
@ -1,10 +1,8 @@
|
||||||
#version 450
|
#version 450
|
||||||
|
|
||||||
layout(location = 0) out vec4 color;
|
layout(location = 0) out vec4 color;
|
||||||
//layout(location = 0) out float fragmentdepth;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
// fragmentdepth = gl_FragCoord.z;
|
|
||||||
color = vec4(1.0, 0.0, 0.0, 1.0);
|
color = vec4(1.0, 0.0, 0.0, 1.0);
|
||||||
}
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -60,7 +60,6 @@ void main()
|
||||||
vec3 V = normalize(inViewVec);
|
vec3 V = normalize(inViewVec);
|
||||||
vec3 R = normalize(-reflect(L, N));
|
vec3 R = normalize(-reflect(L, N));
|
||||||
vec3 diffuse = max(dot(N, L), ambient) * inColor;
|
vec3 diffuse = max(dot(N, L), ambient) * inColor;
|
||||||
// vec3 specular = pow(max(dot(R, V), 0.0), 50.0) * vec3(0.75);
|
|
||||||
|
|
||||||
outFragColor = vec4(diffuse * shadow, 1.0);
|
outFragColor = vec4(diffuse * shadow, 1.0);
|
||||||
|
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -35,9 +35,6 @@
|
||||||
#endif
|
#endif
|
||||||
#define SHADOWMAP_FILTER VK_FILTER_LINEAR
|
#define SHADOWMAP_FILTER VK_FILTER_LINEAR
|
||||||
|
|
||||||
// Offscreen frame buffer properties
|
|
||||||
#define FB_COLOR_FORMAT VK_FORMAT_R8G8B8A8_UNORM
|
|
||||||
|
|
||||||
class VulkanExample : public VulkanExampleBase
|
class VulkanExample : public VulkanExampleBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
@ -240,8 +237,6 @@ public:
|
||||||
offscreenPass.width = SHADOWMAP_DIM;
|
offscreenPass.width = SHADOWMAP_DIM;
|
||||||
offscreenPass.height = SHADOWMAP_DIM;
|
offscreenPass.height = SHADOWMAP_DIM;
|
||||||
|
|
||||||
VkFormat fbColorFormat = FB_COLOR_FORMAT;
|
|
||||||
|
|
||||||
// For shadow mapping we only need a depth attachment
|
// For shadow mapping we only need a depth attachment
|
||||||
VkImageCreateInfo image = vks::initializers::imageCreateInfo();
|
VkImageCreateInfo image = vks::initializers::imageCreateInfo();
|
||||||
image.imageType = VK_IMAGE_TYPE_2D;
|
image.imageType = VK_IMAGE_TYPE_2D;
|
||||||
|
|
@ -656,7 +651,7 @@ public:
|
||||||
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
|
VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT,
|
||||||
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT,
|
||||||
&uniformBuffers.debug,
|
&uniformBuffers.debug,
|
||||||
sizeof(uboVSscene)));
|
sizeof(uboVSquad)));
|
||||||
|
|
||||||
// Offscreen vertex shader uniform buffer block
|
// Offscreen vertex shader uniform buffer block
|
||||||
VK_CHECK_RESULT(vulkanDevice->createBuffer(
|
VK_CHECK_RESULT(vulkanDevice->createBuffer(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue