mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Correctly represent light fbo fmt
This commit is contained in:
parent
d99dcf5450
commit
1234514e8f
3 changed files with 8 additions and 7 deletions
|
@ -225,6 +225,12 @@ public:
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case gpu::R11G11B10:
|
||||||
|
texel.format = GL_RGB;
|
||||||
|
// the type should be float
|
||||||
|
texel.internalFormat = GL_R11F_G11F_B10F;
|
||||||
|
break;
|
||||||
|
|
||||||
case gpu::DEPTH:
|
case gpu::DEPTH:
|
||||||
texel.format = GL_DEPTH_COMPONENT; // It's depth component to load it
|
texel.format = GL_DEPTH_COMPONENT; // It's depth component to load it
|
||||||
texel.internalFormat = GL_DEPTH_COMPONENT;
|
texel.internalFormat = GL_DEPTH_COMPONENT;
|
||||||
|
@ -302,11 +308,6 @@ public:
|
||||||
case gpu::SRGBA:
|
case gpu::SRGBA:
|
||||||
texel.internalFormat = GL_SRGB; // standard 2.2 gamma correction color
|
texel.internalFormat = GL_SRGB; // standard 2.2 gamma correction color
|
||||||
break;
|
break;
|
||||||
case gpu::R11G11B10: {
|
|
||||||
// the type should be float
|
|
||||||
texel.internalFormat = GL_R11F_G11F_B10F;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
qCDebug(gpulogging) << "Unknown combination of texel format";
|
qCDebug(gpulogging) << "Unknown combination of texel format";
|
||||||
}
|
}
|
||||||
|
|
|
@ -285,7 +285,7 @@ Texture::Size Texture::resize(Type type, const Element& texelFormat, uint16 widt
|
||||||
}
|
}
|
||||||
|
|
||||||
// Here the Texture has been fully defined from the gpu point of view (size and format)
|
// Here the Texture has been fully defined from the gpu point of view (size and format)
|
||||||
_defined = true;
|
_defined = true;
|
||||||
} else {
|
} else {
|
||||||
_stamp++;
|
_stamp++;
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,7 +97,7 @@ void FramebufferCache::createPrimaryFramebuffer() {
|
||||||
|
|
||||||
// FIXME: Decide on the proper one, let s stick to R11G11B10 for now
|
// FIXME: Decide on the proper one, let s stick to R11G11B10 for now
|
||||||
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, defaultSampler));
|
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element::COLOR_RGBA_32, width, height, defaultSampler));
|
||||||
_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC3, gpu::NUINT8, gpu::R11G11B10), width, height, defaultSampler));
|
_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::SCALAR, gpu::FLOAT, gpu::R11G11B10), width, height, defaultSampler));
|
||||||
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
|
//_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
|
||||||
_lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
_lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
||||||
_lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
|
_lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
|
||||||
|
|
Loading…
Reference in a new issue