Use new sample building scene for subpass example, added transparent texture

This commit is contained in:
saschawillems 2017-01-14 16:06:44 +01:00
parent 81885abeb6
commit 405c76737c
9 changed files with 1681 additions and 13 deletions

View file

@ -14,7 +14,7 @@ layout (location = 1) out vec4 outPosition;
layout (location = 2) out vec4 outNormal;
layout (location = 3) out vec4 outAlbedo;
layout (constant_id = 0) const int NUM_LIGHTS = 32;
layout (constant_id = 0) const int NUM_LIGHTS = 64;
struct Light {
vec4 position;
@ -67,9 +67,9 @@ void main()
// Specular map values are stored in alpha of albedo mrt
vec3 R = reflect(-L, N);
float NdotR = max(0.0, dot(R, V));
vec3 spec = ubo.lights[i].color * albedo.a * pow(NdotR, 32.0) * atten;
//vec3 spec = ubo.lights[i].color * albedo.a * pow(NdotR, 32.0) * atten;
fragcolor += diff + spec;
fragcolor += diff;// + spec;
}
outFragcolor = vec4(fragcolor, 1.0);

View file

@ -4,6 +4,7 @@
#extension GL_ARB_shading_language_420pack : enable
layout (input_attachment_index = 1, binding = 1) uniform subpassInput samplerPositionDepth;
layout (binding = 2) uniform sampler2D samplerTexture;
layout (location = 0) in vec3 inColor;
layout (location = 1) in vec2 inUV;
@ -28,6 +29,5 @@ void main ()
discard;
};
outColor.rgb = vec3(0.0, 0.25, 0.86);
outColor.a = 0.5;
outColor = texture(samplerTexture, inUV);
}