summaryrefslogtreecommitdiffstats
path: root/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
diff options
context:
space:
mode:
authorAntti Määttä <antti.maatta@qt.io>2019-12-11 13:27:07 +0200
committerAntti Määttä <antti.maatta@qt.io>2019-12-13 11:14:49 +0200
commite363af8a8b660f0268c4b649963d8bd60c393d84 (patch)
tree26e8670f55af17a13c3fde4ad23023b6fd408eb3 /src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
parent7846b24ed4c2e753f5bc6bf5fc72e506ce4373f9 (diff)
Support RGBE hdr images directly
Do not convert RGBE images to 16-bit floating point, but use then directly in the shaders. Task-number: QT3DS-4031 Change-Id: Iecfc775247553d5fd8976c77c572435462b79e64 Reviewed-by: Janne Kangas <janne.kangas@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
Diffstat (limited to 'src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp')
-rw-r--r--src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp b/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
index 20b0738..3d0781d 100644
--- a/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
+++ b/src/runtimerender/resourcemanager/Qt3DSRenderBufferManager.cpp
@@ -463,10 +463,12 @@ struct SBufferManager : public IBufferManager
if (inLoadedImage.data) {
qt3ds::render::NVRenderTextureFormats::Enum destFormat = inLoadedImage.format;
if (inBsdfMipmaps) {
- if (m_Context->GetRenderContextType() == render::NVRenderContextValues::GLES2)
- destFormat = qt3ds::render::NVRenderTextureFormats::RGBA8;
- else
- destFormat = qt3ds::render::NVRenderTextureFormats::RGBA16F;
+ if (inLoadedImage.format != NVRenderTextureFormats::RGBE8) {
+ if (m_Context->GetRenderContextType() == render::NVRenderContextValues::GLES2)
+ destFormat = qt3ds::render::NVRenderTextureFormats::RGBA8;
+ else
+ destFormat = qt3ds::render::NVRenderTextureFormats::RGBA16F;
+ }
}
else {
theTexture->SetTextureData(