SSAO, performance sucks and it flickers so tweaking is needed, also more material support

This commit is contained in:
Halbear 2026-09-01 03:33:26 +01:00
parent 5b231d6920
commit 577836a03f
39 changed files with 889 additions and 74 deletions

View file

@ -1,6 +1,6 @@
#version 450
const int MAX_TEXTURES = 128;
const int MAX_TEXTURES = 512;
const float GAMMA_CONST = 0.4545;
layout(location = 0) in vec2 inUV;
@ -16,9 +16,12 @@ vec4 gamma(vec4 color){
}
void main() {
if (push_constants.textureIndex >= MAX_TEXTURES){
outColor = vec4(0.0,0.0,1.0,1.0);
return;
}
vec4 tex = texture(spriteTextures[push_constants.textureIndex], inUV);
outColor = gamma(tex);
if (outColor.a <= 0.09) {
discard;
}