mirror of
https://github.com/lubosz/overte.git
synced 2025-04-26 16:15:47 +02:00
REmove the texture Transform for deferred_light slv which then makes it work correctly on AMD
This commit is contained in:
parent
acc7d493ec
commit
5ae604f341
3 changed files with 14 additions and 10 deletions
libraries
gpu-gl-common/src/gpu/gl
render-utils/src
|
@ -212,6 +212,8 @@ GLShader* GLBackend::compileBackendProgram(const Shader& program, const Shader::
|
|||
glprogram = ::gl::buildProgram(shaderGLObjects);
|
||||
|
||||
if (!::gl::linkProgram(glprogram, compilationLogs[version].message)) {
|
||||
qCWarning(gpugllogging) << "GLBackend::compileBackendProgram - Program didn't link:\n" << compilationLogs[version].message.c_str();
|
||||
compilationLogs[version].compiled = false;
|
||||
glDeleteProgram(glprogram);
|
||||
glprogram = 0;
|
||||
return nullptr;
|
||||
|
@ -254,7 +256,7 @@ GLint GLBackend::getRealUniformLocation(GLint location) const {
|
|||
// uniforms. If someone is requesting a uniform that isn't in the remapping structure
|
||||
// that's a bug from the calling code, because it means that location wasn't in the
|
||||
// reflection
|
||||
qWarning() << "Unexpected location requested for shader";
|
||||
qWarning() << "Unexpected location requested for shader: #" << location;
|
||||
return INVALID_UNIFORM_INDEX;
|
||||
}
|
||||
return itr->second;
|
||||
|
|
|
@ -135,7 +135,7 @@ static void loadLightProgram(int programId, bool lightVolume, gpu::PipelinePoint
|
|||
if (lightVolume) {
|
||||
PrepareStencil::testShape(*state);
|
||||
|
||||
state->setCullMode(gpu::State::CULL_BACK);
|
||||
state->setCullMode(gpu::State::CULL_NONE);
|
||||
//state->setCullMode(gpu::State::CULL_FRONT);
|
||||
//state->setDepthTest(true, false, gpu::GREATER_EQUAL);
|
||||
//state->setDepthClampEnable(true);
|
||||
|
@ -496,9 +496,10 @@ 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));
|
||||
// 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);
|
||||
|
@ -560,7 +561,8 @@ void RenderDeferredLocals::run(const render::RenderContextPointer& renderContext
|
|||
batch.setViewportTransform(viewport);
|
||||
batch.setStateScissorRect(viewport);
|
||||
|
||||
auto textureFrameTransform = gpu::Framebuffer::evalSubregionTexcoordTransformCoefficients(deferredFramebuffer->getFrameSize(), 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;
|
||||
|
@ -569,14 +571,14 @@ void RenderDeferredLocals::run(const render::RenderContextPointer& renderContext
|
|||
|
||||
// Local light pipeline
|
||||
batch.setPipeline(deferredLightingEffect->_localLight);
|
||||
batch._glUniform4fv(ru::Uniform::TexcoordTransform, 1, reinterpret_cast<const float*>(&textureFrameTransform));
|
||||
// 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._glUniform4fv(ru::Uniform::TexcoordTransform, 1, reinterpret_cast<const float*>(&textureFrameTransform));
|
||||
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
layout(location=RENDER_UTILS_ATTR_TEXCOORD01) out vec4 _texCoord01;
|
||||
|
||||
layout(location=RENDER_UTILS_UNIFORM_LIGHT_TEXCOORD_TRANSFORM) uniform vec4 texcoordFrameTransform;
|
||||
//layout(location=RENDER_UTILS_UNIFORM_LIGHT_TEXCOORD_TRANSFORM) uniform vec4 texcoordFrameTransform;
|
||||
|
||||
void main(void) {
|
||||
const float depth = 1.0;
|
||||
|
@ -30,8 +30,8 @@ void main(void) {
|
|||
|
||||
_texCoord01.xy = (pos.xy + 1.0) * 0.5;
|
||||
|
||||
_texCoord01.xy *= texcoordFrameTransform.zw;
|
||||
_texCoord01.xy += texcoordFrameTransform.xy;
|
||||
// _texCoord01.xy *= texcoordFrameTransform.zw;
|
||||
// _texCoord01.xy += texcoordFrameTransform.xy;
|
||||
|
||||
gl_Position = pos;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue