Am 24.07.2014 um 11:25 schrieb Martin Ertl <qsmokeonthewa...@gmail.com>:
> ...
> -> define 'which texture unit a given "uniform sampler2D tex" refers to' by
> calling
> program()->setUniformValue("uTex0", 0);
> program()->setUniformValue("uTex1", 1);
> ...
Or use the "layout syntax" in the shader itself, so you can skip setting the
"value" ("texture unit selector") of the uniforms (like you do above), like so:
>> layout (binding = 0) uniform sampler2D foo;
>> layout (binding = 1) uniform sampler2D bar;
>> etc.
Works at least with recent OpenGL versions (and off course only if you write
the shaders yourself ;)).
But by now I realise that the "SG" prefix probably stands for "Scene Graph"
(which you are probably extending with your own objects), so you're with OpenGL
ES 2 I guess (which probably won't digest above shader "layout" syntax).
Cheers,
Oliver
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest