3
0
Fork 0
mirror of https://github.com/lubosz/overte.git synced 2025-04-26 19:55:27 +02:00

Completely remove the texcoord frame transform as we don;t use it at all

This commit is contained in:
sam gateau 2018-08-21 14:51:54 -07:00
parent 8c5aab7fa0
commit 6b994ba39a
2 changed files with 7 additions and 14 deletions

View file

@ -496,11 +496,6 @@ void RenderDeferredSetup::run(const render::RenderContextPointer& renderContext,
batch.setPipeline(program);
}
// NOTE: WE are assuming that the deferred lighting pass is always full screen so this texture transform is not needed (and cause problems on AMD)
// Adjust the texcoordTransform in the case we are rendeirng a sub region(mini mirror)
// auto textureFrameTransform = gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(deferredFramebuffer->getFrameSize(), args->_viewport);
// batch._glUniform4fv(ru::Uniform::TexcoordTransform, 1, reinterpret_cast< const float* >(&textureFrameTransform));
// Setup the global lighting
deferredLightingEffect->setupKeyLightBatch(args, batch);
@ -561,24 +556,18 @@ void RenderDeferredLocals::run(const render::RenderContextPointer& renderContext
batch.setViewportTransform(viewport);
batch.setStateScissorRect(viewport);
// NOTE: WE are assuming that the deferred lighting pass is always full screen so this texture transform is not needed (and cause problems on AMD)
// auto textureFrameTransform = gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(deferredFramebuffer->getFrameSize(), viewport);
auto& lightIndices = lightClusters->_visibleLightIndices;
if (!lightIndices.empty() && lightIndices[0] > 0) {
deferredLightingEffect->setupLocalLightsBatch(batch, lightClusters);
// Local light pipeline
batch.setPipeline(deferredLightingEffect->_localLight);
// batch._glUniform4fv(ru::Uniform::TexcoordTransform, 1, reinterpret_cast<const float*>(&textureFrameTransform));
batch.draw(gpu::TRIANGLE_STRIP, 4);
// Draw outline as well ?
if (lightingModel->isShowLightContourEnabled()) {
batch.setPipeline(deferredLightingEffect->_localLightOutline);
// batch._glUniform4fv(ru::Uniform::TexcoordTransform, 1, reinterpret_cast<const float*>(&textureFrameTransform));
batch.draw(gpu::TRIANGLE_STRIP, 4);
}

View file

@ -16,8 +16,10 @@
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
#ifdef RENDER_UTILS_USE_TEXCOORD_FRAME_TRANSFORM
// NOTE: WE are assuming that the deferred lighting pass is always full screen so this texture transform is not needed (and cause problems on AMD)
//layout(location=RENDER_UTILS_UNIFORM_LIGHT_TEXCOORD_TRANSFORM) uniform vec4 texcoordFrameTransform;
layout(location=RENDER_UTILS_UNIFORM_LIGHT_TEXCOORD_TRANSFORM) uniform vec4 texcoordFrameTransform;
#endif
void main(void) {
const float depth = 1.0;
@ -31,8 +33,10 @@ void main(void) {
_texCoord01.xy = (pos.xy + 1.0) * 0.5;
// _texCoord01.xy *= texcoordFrameTransform.zw;
// _texCoord01.xy += texcoordFrameTransform.xy;
#ifdef RENDER_UTILS_USE_TEXCOORD_FRAME_TRANSFORM
_texCoord01.xy *= texcoordFrameTransform.zw;
_texCoord01.xy += texcoordFrameTransform.xy;
#endif
gl_Position = pos;
}