summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-13 15:37:22 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-13 18:44:14 +0000
commit3abbf9227ada8f68821a5ad473bba4f52e625fb5 (patch)
tree95c87c69e606155a4feb91c2b19f2e3a7c410a3e
parent8b90be308d31f1efada42a08d676569683637837 (diff)
Avoid instance names in uniform blocks
Version 140 (OpenGL 3.1) does not support the namespacing features yet. Instance names are introduced only in 150 (OpenGL 3.2). Change-Id: I3917093113beff6049c25c3282c13062d220700b Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--examples/deferred-renderer-cpp/final_gl3.frag6
-rw-r--r--examples/deferred-renderer-qml/FinalEffect.qml12
2 files changed, 9 insertions, 9 deletions
diff --git a/examples/deferred-renderer-cpp/final_gl3.frag b/examples/deferred-renderer-cpp/final_gl3.frag
index fe4854f2d..8aeb1cbcf 100644
--- a/examples/deferred-renderer-cpp/final_gl3.frag
+++ b/examples/deferred-renderer-cpp/final_gl3.frag
@@ -18,7 +18,7 @@ struct PointLight
const int lightCount = 3;
uniform PointLightBlock {
PointLight lights[lightCount];
-} pointLights;
+};
void main()
{
@@ -29,8 +29,8 @@ void main()
vec4 lightColor;
for (int i = 0; i < 3; i++) {
- vec3 s = normalize(pointLights.lights[i].position - pos);
- lightColor += pointLights.lights[i].color * (pointLights.lights[i].intensity * max(dot(s, norm), 0.0));
+ vec3 s = normalize(lights[i].position - pos);
+ lightColor += lights[i].color * (lights[i].intensity * max(dot(s, norm), 0.0));
}
lightColor /= float(lightCount);
fragColor = col * lightColor;
diff --git a/examples/deferred-renderer-qml/FinalEffect.qml b/examples/deferred-renderer-qml/FinalEffect.qml
index f4a4e984d..632487688 100644
--- a/examples/deferred-renderer-qml/FinalEffect.qml
+++ b/examples/deferred-renderer-qml/FinalEffect.qml
@@ -86,7 +86,7 @@ Effect {
const int lightCount = 5;
uniform PointLightBlock {
PointLight lights[lightCount];
- } pointLights;
+ };
void main()
{
@@ -97,8 +97,8 @@ Effect {
vec4 lightColor;
for (int i = 0; i < lightCount; i++) {
- vec3 s = normalize(pointLights.lights[i].position - pos);
- lightColor += pointLights.lights[i].color * (pointLights.lights[i].intensity * max(dot(s, norm), 0.0));
+ vec3 s = normalize(lights[i].position - pos);
+ lightColor += lights[i].color * (lights[i].intensity * max(dot(s, norm), 0.0));
}
lightColor /= float(lightCount);
fragColor = col * lightColor;
@@ -153,7 +153,7 @@ Effect {
uniform struct
{
PointLight lights[lightCount];
- } pointLights;
+ };
void main()
{
@@ -164,8 +164,8 @@ Effect {
vec4 lightColor;
for (int i = 0; i < lightCount; i++) {
- vec3 s = normalize(pointLights.lights[i].position - pos);
- lightColor += pointLights.lights[i].color * (pointLights.lights[i].intensity * max(dot(s, norm), 0.0));
+ vec3 s = lights[i].position - pos);
+ lightColor += lights[i].color * (lights[i].intensity * max(dot(s, norm), 0.0));
}
lightColor /= float(lightCount);
gl_FragColor = col * lightColor;