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,7 @@
#version 450
const int MAX_TEXTURES = 256;
const int MAX_TEXTURES = 512;
layout(location = 0) in vec4 inPos;
layout(location = 1) in vec3 inNormal;
@ -44,6 +45,11 @@ layout(push_constant) uniform pc{
void main()
{
Material material = matUniform.materials[push_constants.materialIdx];
int textureIndex = int(material.textureIdx);
if (textureIndex >= MAX_TEXTURES){
outAlbedo = vec4(0.0,0.0,1.0,1.0);
return;
}
if(material.hasTexture == 1){
vec4 texColor = texture(textSampler[material.textureIdx],inTextCoords);
outAlbedo = texColor;