mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 23:17:02 +02:00
Merge pull request #7837 from samcake/hdr
Fixing the bad color format for skymaps
This commit is contained in:
commit
39a4e38485
1 changed files with 18 additions and 18 deletions
|
@ -105,19 +105,19 @@ const QImage& image, bool isLinear, bool doCompress) {
|
||||||
gpu::Semantic gpuSemantic;
|
gpu::Semantic gpuSemantic;
|
||||||
gpu::Semantic mipSemantic;
|
gpu::Semantic mipSemantic;
|
||||||
if (isLinear) {
|
if (isLinear) {
|
||||||
mipSemantic = gpu::SBGRA;
|
|
||||||
if (doCompress) {
|
|
||||||
gpuSemantic = gpu::COMPRESSED_SRGBA;
|
|
||||||
} else {
|
|
||||||
gpuSemantic = gpu::SRGBA;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mipSemantic = gpu::BGRA;
|
mipSemantic = gpu::BGRA;
|
||||||
if (doCompress) {
|
if (doCompress) {
|
||||||
gpuSemantic = gpu::COMPRESSED_RGBA;
|
gpuSemantic = gpu::COMPRESSED_RGBA;
|
||||||
} else {
|
} else {
|
||||||
gpuSemantic = gpu::RGBA;
|
gpuSemantic = gpu::RGBA;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
mipSemantic = gpu::SBGRA;
|
||||||
|
if (doCompress) {
|
||||||
|
gpuSemantic = gpu::COMPRESSED_SRGBA;
|
||||||
|
} else {
|
||||||
|
gpuSemantic = gpu::SRGBA;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
formatGPU = gpu::Element(gpu::VEC4, gpu::NUINT8, gpuSemantic);
|
formatGPU = gpu::Element(gpu::VEC4, gpu::NUINT8, gpuSemantic);
|
||||||
formatMip = gpu::Element(gpu::VEC4, gpu::NUINT8, mipSemantic);
|
formatMip = gpu::Element(gpu::VEC4, gpu::NUINT8, mipSemantic);
|
||||||
|
@ -125,19 +125,19 @@ const QImage& image, bool isLinear, bool doCompress) {
|
||||||
gpu::Semantic gpuSemantic;
|
gpu::Semantic gpuSemantic;
|
||||||
gpu::Semantic mipSemantic;
|
gpu::Semantic mipSemantic;
|
||||||
if (isLinear) {
|
if (isLinear) {
|
||||||
mipSemantic = gpu::SRGB;
|
|
||||||
if (doCompress) {
|
|
||||||
gpuSemantic = gpu::COMPRESSED_SRGB;
|
|
||||||
} else {
|
|
||||||
gpuSemantic = gpu::SRGB;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
mipSemantic = gpu::RGB;
|
mipSemantic = gpu::RGB;
|
||||||
if (doCompress) {
|
if (doCompress) {
|
||||||
gpuSemantic = gpu::COMPRESSED_RGB;
|
gpuSemantic = gpu::COMPRESSED_RGB;
|
||||||
} else {
|
} else {
|
||||||
gpuSemantic = gpu::RGB;
|
gpuSemantic = gpu::RGB;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
mipSemantic = gpu::SRGB;
|
||||||
|
if (doCompress) {
|
||||||
|
gpuSemantic = gpu::COMPRESSED_SRGB;
|
||||||
|
} else {
|
||||||
|
gpuSemantic = gpu::SRGB;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpuSemantic);
|
formatGPU = gpu::Element(gpu::VEC3, gpu::NUINT8, gpuSemantic);
|
||||||
formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, mipSemantic);
|
formatMip = gpu::Element(gpu::VEC3, gpu::NUINT8, mipSemantic);
|
||||||
|
@ -178,20 +178,20 @@ gpu::Texture* TextureUsage::process2DTextureColorFromImage(const QImage& srcImag
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* TextureUsage::create2DTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
gpu::Texture* TextureUsage::create2DTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
||||||
return process2DTextureColorFromImage(srcImage, true, false, true);
|
return process2DTextureColorFromImage(srcImage, false, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
gpu::Texture* TextureUsage::createAlbedoTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
gpu::Texture* TextureUsage::createAlbedoTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
||||||
return process2DTextureColorFromImage(srcImage, true, true, true);
|
return process2DTextureColorFromImage(srcImage, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* TextureUsage::createEmissiveTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
gpu::Texture* TextureUsage::createEmissiveTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
||||||
return process2DTextureColorFromImage(srcImage, true, true, true);
|
return process2DTextureColorFromImage(srcImage, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
gpu::Texture* TextureUsage::createLightmapTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
gpu::Texture* TextureUsage::createLightmapTextureFromImage(const QImage& srcImage, const std::string& srcImageName) {
|
||||||
return process2DTextureColorFromImage(srcImage, true, true, true);
|
return process2DTextureColorFromImage(srcImage, false, true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue