ADD: async glTF loading

This commit is contained in:
2025-12-04 00:04:56 +09:00
parent 01b28174be
commit 73e15ee456
16 changed files with 755 additions and 51 deletions

View File

@@ -36,7 +36,15 @@ layout(push_constant) uniform constants
void main() {
// Apply baseColor texture and baseColorFactor once
vec3 albedo = inColor * texture(colorTex, inUV).rgb * materialData.colorFactors.rgb;
vec4 baseTex = texture(colorTex, inUV);
// Alpha from baseColor texture and factor, used for cutouts on MASK materials.
float alpha = clamp(baseTex.a * materialData.colorFactors.a, 0.0, 1.0);
float alphaCutoff = materialData.extra[2].x;
if (alphaCutoff > 0.0 && alpha < alphaCutoff)
{
discard;
}
vec3 albedo = inColor * baseTex.rgb * materialData.colorFactors.rgb;
// glTF metallic-roughness in G (roughness) and B (metallic)
vec2 mrTex = texture(metalRoughTex, inUV).gb;