diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-12-06 15:17:34 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-12-07 08:04:36 +0000 |
commit | 1daff642404ea00d04aab96951c72eb20f7dc3c0 (patch) | |
tree | e6fa253181f00760bb9a793417e91729645b1459 /src/render/backend | |
parent | 17d1ae7b4d35d0698d307a3a21cd4ad2c21fc361 (diff) |
Separate GLSL 1.00 and newer shader snippets for lights
Many but not all OpenGL ES 2.0 implementations support dynamic indexing.
For these the normal for loop is fine. For simple GLSL 1.00 compilers
without dynamic indexing support (e.g. RPi) a separate, limited version
is provided that supports a lower number of lights and uses copy-paste
instead of the loop.
Right now there is no sane way to choose which snippet to use as that
requires the OpenGL context at minimum (and even then we could only rely
on vendor/renderer checks). Therefore a QT3D_GLSL100_WORKAROUND
environment variable is used for now. This is temporary until
we figure out something more sophisticated.
The default GL2/ES2 lighting shader is now equivalent to the GL3
version, supporting up to 8 lights.
Change-Id: I0244c920a1f2c2516b130991996afca68207a7db
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/backend')
-rw-r--r-- | src/render/backend/renderview.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/render/backend/renderview.cpp b/src/render/backend/renderview.cpp index fa02447b3..6c1f4b4e9 100644 --- a/src/render/backend/renderview.cpp +++ b/src/render/backend/renderview.cpp @@ -784,7 +784,6 @@ void RenderView::setShaderAndUniforms(RenderCommand *command, RenderPass *rPass, } } - // Shaders without dynamic indexing will not have lightCount if (uniformNames.contains(LIGHT_COUNT_NAME)) setUniformValue(command->m_uniforms, LIGHT_COUNT_NAME, qMax(1, lightIdx)); |