All Downloads are FREE. Search and download functionalities are using the official Maven repository.

Standard.Shader.PostProcessing.simple_blur.frag Maven / Gradle / Ivy

There is a newer version: 0.0.1-alpha1
Show newest version
#version 450
#extension GL_ARB_separate_shader_objects:enable

layout(set=0,binding=0) uniform BlurInfoUBO{
    ivec2 textureSize;
    int blurSize;
    int stride;
}blurInfo;
layout(set=1,binding=0) uniform texture2D albedoTexture;
layout(set=1,binding=1) uniform texture2D depthTexture;
layout(set=1,binding=2) uniform texture2D positionTexture;
layout(set=1,binding=3) uniform texture2D normalTexture;
layout(set=1,binding=4) uniform texture2D stencilTexture;
layout(set=2,binding=0) uniform sampler textureSampler;

layout(location=0) in vec2 fragTexCoords;

layout(location=0) out vec4 outColor;

void main(){
    float stencil=texture(sampler2D(stencilTexture,textureSampler),fragTexCoords).r;
    vec2 texelSize=1.0/blurInfo.textureSize;

    vec4 sum=vec4(0.0);
    int count=0;
    for(int x=0;x




© 2015 - 2024 Weber Informatics LLC | Privacy Policy