SSAO, performance sucks and it flickers so tweaking is needed, also more material support
This commit is contained in:
parent
5b231d6920
commit
577836a03f
39 changed files with 889 additions and 74 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#version 450
|
||||
|
||||
const int MAX_TEXTURES = 256;
|
||||
const int MAX_TEXTURES = 512;
|
||||
|
||||
layout(location = 0) in vec4 inPos;
|
||||
layout(location = 1) in vec3 inNormal;
|
||||
|
|
@ -69,6 +69,16 @@ void main()
|
|||
outPos = inPos;
|
||||
|
||||
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);
|
||||
outOpacity = vec4(0.0,0.0,1.0,1.0);
|
||||
outNormal = vec4(0.0,0.0,1.0,1.0);
|
||||
outEmissive = vec4(0.0,0.0,1.0,1.0);
|
||||
outTranslucency = vec4(0.0,0.0,1.0,1.0);
|
||||
outPBR = vec4(0.0,0.0,1.0,1.0);
|
||||
return;
|
||||
}
|
||||
if (material.hasTexture == 1) {
|
||||
outAlbedo = texture(textSampler[material.textureIdx], inTextCoords);
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue