git.s-ol.nu ~forks/DiligentFX / 722df5c
GLTF PBR renderer: updated default physical desc texture to define rough non-metal material assiduous 10 months ago
2 changed file(s) with 10 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
350350 RefCntAutoPtr<ITextureView> m_pWhiteTexSRV;
351351 RefCntAutoPtr<ITextureView> m_pBlackTexSRV;
352352 RefCntAutoPtr<ITextureView> m_pDefaultNormalMapSRV;
353 RefCntAutoPtr<ITextureView> m_pDefaultPhysDescSRV;
353354
354355
355356 static constexpr TEXTURE_FORMAT IrradianceCubeFmt = TEX_FORMAT_RGBA32_FLOAT;
106106 pDevice->CreateTexture(TexDesc, &InitData, &pDefaultNormalMap);
107107 m_pDefaultNormalMapSRV = pDefaultNormalMap->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE);
108108
109 TexDesc.Name = "Default physical description map for GLTF renderer";
110 for (auto& c : Data) c = 0x0000FF00;
111 RefCntAutoPtr<ITexture> pDefaultPhysDesc;
112 pDevice->CreateTexture(TexDesc, &InitData, &pDefaultPhysDesc);
113 m_pDefaultPhysDescSRV = pDefaultPhysDesc->GetDefaultView(TEXTURE_VIEW_SHADER_RESOURCE);
114
109115 // clang-format off
110116 StateTransitionDesc Barriers[] =
111117 {
112118 {pWhiteTex, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, true},
113119 {pBlackTex, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, true},
114 {pDefaultNormalMap, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, true}
120 {pDefaultNormalMap, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, true},
121 {pDefaultPhysDesc, RESOURCE_STATE_UNKNOWN, RESOURCE_STATE_SHADER_RESOURCE, true}
115122 };
116123 // clang-format on
117124 pCtx->TransitionResourceStates(_countof(Barriers), Barriers);
460467 };
461468
462469 SetTexture(GLTF::Material::TEXTURE_ID_BASE_COLOR, m_pWhiteTexSRV, "g_ColorMap");
463 SetTexture(GLTF::Material::TEXTURE_ID_PHYSICAL_DESC, m_pWhiteTexSRV, "g_PhysicalDescriptorMap");
470 SetTexture(GLTF::Material::TEXTURE_ID_PHYSICAL_DESC, m_pDefaultPhysDescSRV, "g_PhysicalDescriptorMap");
464471 SetTexture(GLTF::Material::TEXTURE_ID_NORMAL_MAP, m_pDefaultNormalMapSRV, "g_NormalMap");
465472 if (m_Settings.UseAO)
466473 {