mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:13:28 +02:00
Final cleans and tests using R11G11B10 for lighting buffer
This commit is contained in:
parent
f6c80e01e9
commit
0492bb1c6d
2 changed files with 7 additions and 9 deletions
|
@ -89,9 +89,10 @@ void FramebufferCache::createPrimaryFramebuffer() {
|
|||
|
||||
auto smoothSampler = gpu::Sampler(gpu::Sampler::FILTER_MIN_MAG_MIP_LINEAR);
|
||||
|
||||
// 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(gpu::VEC3, gpu::NUINT8, gpu::R11G11B10), width, height, defaultSampler));
|
||||
_lightingTexture = gpu::TexturePointer(gpu::Texture::create2D(gpu::Element(gpu::VEC4, gpu::HALF, gpu::RGBA), width, height, smoothSampler));
|
||||
_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::VEC4, gpu::HALF, gpu::RGBA), width, height, defaultSampler));
|
||||
_lightingFramebuffer = gpu::FramebufferPointer(gpu::Framebuffer::create());
|
||||
_lightingFramebuffer->setRenderBuffer(0, _lightingTexture);
|
||||
_lightingFramebuffer->setDepthStencilBuffer(_primaryDepthTexture, depthFormat);
|
||||
|
|
|
@ -64,13 +64,9 @@ void ToneMappingEffect::init() {
|
|||
out vec4 outFragColor;
|
||||
|
||||
void main(void) {
|
||||
vec4 fragColorRaw = textureLod(colorMap, varTexCoord0, 0);
|
||||
vec4 fragColorRaw = texture(colorMap, varTexCoord0);
|
||||
vec3 fragColor = fragColorRaw.xyz;
|
||||
/*
|
||||
vec4 fragColorAverage = textureLod(colorMap, varTexCoord0, 10);
|
||||
float averageIntensity = length(fragColorAverage.xyz);
|
||||
fragColor /= averageIntensity;
|
||||
*/
|
||||
|
||||
vec3 srcColor = fragColor * getTwoPowExposure();
|
||||
|
||||
int toneCurve = getToneCurve();
|
||||
|
@ -124,7 +120,8 @@ void ToneMappingEffect::render(RenderArgs* args) {
|
|||
auto destFbo = framebufferCache->getPrimaryFramebuffer();
|
||||
batch.setFramebuffer(destFbo);
|
||||
|
||||
batch.generateTextureMips(lightingBuffer);
|
||||
// FIXME: Generate the Luminosity map
|
||||
//batch.generateTextureMips(lightingBuffer);
|
||||
|
||||
batch.setViewportTransform(args->_viewport);
|
||||
batch.setProjectionTransform(glm::mat4());
|
||||
|
|
Loading…
Reference in a new issue