Skip to content
Snippets Groups Projects
Commit 070f7238 authored by Artur Wasmut's avatar Artur Wasmut
Browse files

add cheap blur filter and composite bloom compute passes.

parent 1ad25c45
No related branches found
No related tags found
1 merge request!62Resolve "Lens Flares"
Pipeline #25839 passed
#version 450
#extension GL_ARB_separate_shader_objects : enable
#extension GL_GOOGLE_include_directive : enable
#include "perMeshResources.inc"
layout(location = 0) in vec3 passNormal;
layout(location = 1) in vec2 passUV;
......@@ -7,14 +10,12 @@ layout(location = 2) in vec3 passPos;
layout(location = 0) out vec3 outColor;
layout(set=0, binding=0) uniform texture2D meshTexture;
layout(set=0, binding=1) uniform sampler textureSampler;
layout(set=0, binding=2) uniform sunBuffer {
layout(set=0, binding=0) uniform sunBuffer {
vec3 L; float padding;
mat4 lightMatrix;
};
layout(set=0, binding=3) uniform texture2D shadowMap;
layout(set=0, binding=4) uniform sampler shadowMapSampler;
layout(set=0, binding=1) uniform texture2D shadowMap;
layout(set=0, binding=2) uniform sampler shadowMapSampler;
float shadowTest(vec3 worldPos){
vec4 lightPos = lightMatrix * vec4(worldPos, 1);
......@@ -34,13 +35,11 @@ float shadowTest(vec3 worldPos){
}
void main() {
/*
vec3 N = normalize(passNormal);
vec3 sunColor = vec3(1);
vec3 sunColor = vec3(10);
vec3 sun = sunColor * clamp(dot(N, L), 0, 1);
sun *= shadowTest(passPos);
vec3 ambient = vec3(0.1);
vec3 albedo = texture(sampler2D(meshTexture, textureSampler), passUV).rgb;
*/
outColor = passNormal;
vec3 ambient = vec3(0.05);
vec3 albedo = texture(sampler2D(albedoTexture, textureSampler), passUV).rgb;
outColor = albedo * (sun + ambient);
}
\ No newline at end of file
......@@ -16,7 +16,7 @@ layout( push_constant ) uniform constants{
void main() {
gl_Position = mvp * vec4(inPosition, 1.0);
passNormal = inNormal;
passNormal = mat3(model) * inNormal; // assuming no weird stuff like shearing or non-uniform scaling
passUV = inUV;
passPos = (model * vec4(inPosition, 1)).xyz;
}
\ No newline at end of file
File deleted
File deleted
File deleted
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment