1234567891011121314151617181920212223242526272829303132333435 |
- #version 430
- layout (binding = 0) uniform sampler2D colorSamp;
- layout (binding = 1) uniform sampler2D ssaoSamp;
- layout (binding = 2) uniform sampler2D shadowSamp;
- layout (binding = 3) uniform sampler2D worldNormalSamp;
- uniform bool useSSAO;
- in vec2 varTex;
- out vec4 color;
- const vec3 light = vec3(-0.280166, -0.573576, -0.769751);
- void main()
- {
- if(useSSAO)
- {
- color = vec4(texture(colorSamp, varTex).xyz * (texture(ssaoSamp, varTex).r + 0.5), 1.0);
- }
- else
- {
- color = vec4(texture(colorSamp, varTex).xyz, 1.0);
- }
- float diffuseLight = float(dot(texture(worldNormalSamp, varTex).xyz, -light) > 0);
- float f = diffuseLight * texture(shadowSamp, varTex).r;
- color *= f * 0.5 + 0.5;
- //color *= f * 0.5 + 0.5;
- //color = texture(worldNormalSamp, varTex);
- }
|