diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2015-02-13 20:20:04 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2015-02-14 15:51:04 +0000 |
commit | f0803bbc750077d53b3dffa4763bf48f033ab0d3 (patch) | |
tree | 358086420e58b454407e4e058a5585521e9bfee6 | |
parent | ed0457ce6d655fa42ada6f71780344a6bd97d9b9 (diff) |
Fix texture sampling calls
texture2D() is not available in core profiles, although some drivers accept
it. Instead, use texture() in >=130 shaders.
Change-Id: I555d7b1fb7229db1fdb7257bd23a3a38d0087d88
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r-- | examples/deferred-renderer-cpp/final_gl3.frag | 6 | ||||
-rw-r--r-- | examples/deferred-renderer-qml/FinalEffect.qml | 6 | ||||
-rw-r--r-- | examples/playground-qml/AnimatedDiffuseMaterial.qml | 2 | ||||
-rw-r--r-- | examples/playground-qml/ComplexTechnique.qml | 6 |
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/deferred-renderer-cpp/final_gl3.frag b/examples/deferred-renderer-cpp/final_gl3.frag index 8aeb1cbcf..88abd5cb1 100644 --- a/examples/deferred-renderer-cpp/final_gl3.frag +++ b/examples/deferred-renderer-cpp/final_gl3.frag @@ -23,9 +23,9 @@ uniform PointLightBlock { void main() { vec2 texCoord = gl_FragCoord.xy / winSize; - vec4 col = texture2D(color, texCoord); - vec3 pos = texture2D(position, texCoord).xyz; - vec3 norm = texture2D(normal, texCoord).xyz; + vec4 col = texture(color, texCoord); + vec3 pos = texture(position, texCoord).xyz; + vec3 norm = texture(normal, texCoord).xyz; vec4 lightColor; for (int i = 0; i < 3; i++) { diff --git a/examples/deferred-renderer-qml/FinalEffect.qml b/examples/deferred-renderer-qml/FinalEffect.qml index 632487688..f46e65c12 100644 --- a/examples/deferred-renderer-qml/FinalEffect.qml +++ b/examples/deferred-renderer-qml/FinalEffect.qml @@ -91,9 +91,9 @@ Effect { void main() { vec2 texCoord = gl_FragCoord.xy / winSize; - vec4 col = texture2D(color, texCoord); - vec3 pos = texture2D(position, texCoord).xyz; - vec3 norm = texture2D(normal, texCoord).xyz; + vec4 col = texture(color, texCoord); + vec3 pos = texture(position, texCoord).xyz; + vec3 norm = texture(normal, texCoord).xyz; vec4 lightColor; for (int i = 0; i < lightCount; i++) { diff --git a/examples/playground-qml/AnimatedDiffuseMaterial.qml b/examples/playground-qml/AnimatedDiffuseMaterial.qml index cc29ca045..c09f166bd 100644 --- a/examples/playground-qml/AnimatedDiffuseMaterial.qml +++ b/examples/playground-qml/AnimatedDiffuseMaterial.qml @@ -187,7 +187,7 @@ Material { void main() { - fragColor = texture2D(tex, texCoord); + fragColor = texture(tex, texCoord); } " } diff --git a/examples/playground-qml/ComplexTechnique.qml b/examples/playground-qml/ComplexTechnique.qml index 24f88b262..9bc3cad58 100644 --- a/examples/playground-qml/ComplexTechnique.qml +++ b/examples/playground-qml/ComplexTechnique.qml @@ -103,7 +103,7 @@ Technique { color += pointLights[i].color * (pointLights[i].intensity * max(dot(s, normal), 0.0)); } color /= float(lightCount); - fragColor = texture2D(texture, texCoord) * color; + fragColor = texture(texture, texCoord) * color; }" } }, @@ -132,7 +132,7 @@ Technique { void main() { - fragColor = texture2D(tex, texCoord); + fragColor = texture(tex, texCoord); } " } @@ -219,7 +219,7 @@ Technique { void main() { - fragColor = texture2D(gBuffer, texCoord); + fragColor = texture(gBuffer, texCoord); } " } |