Skip to content

Commit c9a747f

Browse files
GLTF Viewer: use RGBA8_UNORM for white furnace environment
1 parent 21029b0 commit c9a747f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Samples/GLTFViewer/src/GLTFViewer.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -331,18 +331,20 @@ static RefCntAutoPtr<ITextureView> CreateWhiteFurnaceEnvMap(IRenderDevice* pDevi
331331
TexDesc.Type = RESOURCE_DIM_TEX_CUBE;
332332
TexDesc.Usage = USAGE_IMMUTABLE;
333333
TexDesc.BindFlags = BIND_SHADER_RESOURCE;
334-
TexDesc.Format = TEX_FORMAT_RGBA32_FLOAT;
334+
// R32 float is not supported on some low-end devices.
335+
// Since we simply need environment map to be 1.0, RGBA8 is sufficient.
336+
TexDesc.Format = TEX_FORMAT_RGBA8_UNORM;
335337
TexDesc.Width = 16;
336338
TexDesc.Height = 16;
337339
TexDesc.MipLevels = 1;
338340
TexDesc.ArraySize = 6;
339341

340-
std::vector<float4> Data(6 * TexDesc.Width * TexDesc.Height, float4{1});
342+
std::vector<Uint32> Data(6 * TexDesc.Width * TexDesc.Height, 0xFFFFFFFFu);
341343
std::vector<TextureSubResData> SubResData(6);
342344
for (auto& Subres : SubResData)
343345
{
344346
Subres.pData = Data.data();
345-
Subres.Stride = TexDesc.Width * sizeof(float4);
347+
Subres.Stride = TexDesc.Width * sizeof(Uint32);
346348
}
347349
TextureData InitData{SubResData.data(), static_cast<Uint32>(SubResData.size())};
348350

0 commit comments

Comments
 (0)