From 2c82cd4475a16884bd7b5a0a1ac5258254f3f546 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Garc=C3=ADa=20Li=C3=B1=C3=A1n?= Date: Fri, 27 Aug 2021 00:06:34 +0200 Subject: [PATCH] glTF: Remove separate occlusion texture --- simgear/scene/model/ReaderWriterGLTF.cxx | 11 ++++------- simgear/scene/viewer/CompositorBuffer.cxx | 1 + 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/simgear/scene/model/ReaderWriterGLTF.cxx b/simgear/scene/model/ReaderWriterGLTF.cxx index aa199735..30d58a16 100644 --- a/simgear/scene/model/ReaderWriterGLTF.cxx +++ b/simgear/scene/model/ReaderWriterGLTF.cxx @@ -256,13 +256,10 @@ struct GLTFBuilder { SGPropertyNode *normalTexNode = makeChild(params, "texture", 1); if (!makeTextureParameters(normalTexNode, material.normalTexture.index)) makeChild(normalTexNode, "type")->setValue("null-normalmap"); - SGPropertyNode *metRoughTexNode = makeChild(params, "texture", 2); - if (!makeTextureParameters(metRoughTexNode, pbr.metallicRoughnessTexture.index)) - makeChild(metRoughTexNode, "type")->setValue("white"); - SGPropertyNode *occlusionTexNode = makeChild(params, "texture", 3); - if (!makeTextureParameters(occlusionTexNode, material.occlusionTexture.index)) - makeChild(occlusionTexNode, "type")->setValue("white"); - SGPropertyNode *emissiveTexNode = makeChild(params, "texture", 4); + SGPropertyNode *ormTexNode = makeChild(params, "texture", 2); + if (!makeTextureParameters(ormTexNode, pbr.metallicRoughnessTexture.index)) + makeChild(ormTexNode, "type")->setValue("white"); + SGPropertyNode *emissiveTexNode = makeChild(params, "texture", 3); if (!makeTextureParameters(emissiveTexNode, material.emissiveTexture.index)) makeChild(emissiveTexNode, "type")->setValue("white"); diff --git a/simgear/scene/viewer/CompositorBuffer.cxx b/simgear/scene/viewer/CompositorBuffer.cxx index cc13080e..46a51ffb 100644 --- a/simgear/scene/viewer/CompositorBuffer.cxx +++ b/simgear/scene/viewer/CompositorBuffer.cxx @@ -70,6 +70,7 @@ PropStringMap buffer_format_map { {"r32f", {GL_R32F, GL_RED, GL_FLOAT}}, {"rg16f", {GL_RG16F, GL_RG, GL_HALF_FLOAT}}, {"rg32f", {GL_RG32F, GL_RG, GL_FLOAT}}, + {"rgb10-a2", {GL_RGB10_A2, GL_RGBA, GL_UNSIGNED_INT_10_10_10_2}}, {"r11f-g11f-b10f", {GL_R11F_G11F_B10F, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV}}, {"depth16", {GL_DEPTH_COMPONENT16, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT}}, {"depth24", {GL_DEPTH_COMPONENT24, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT}},