summaryrefslogtreecommitdiffstats
path: root/examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@theqtcompany.com>2015-07-15 23:39:58 +0200
committerAndy Nichols <andy.nichols@theqtcompany.com>2015-08-08 12:55:31 +0000
commit473bd13ed373c4cc24bdd3211ee90a070a466ce2 (patch)
tree4dbfd0bc5ea908a3feb20fed8ad5242c6cef56bb /examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl
parenta1a7e3661bce196a633ef3edd7d905c215bf9031 (diff)
Add support for loading scenes from glTF 0.8 files
This patch includes a new scene parser plugin which enables the loading of glTF files (using the 0.8 spec) into Qt3D scenes. The gltf example has been updated to work with the current APIs and the asset files it used have been updated to match the glTF 0.8 spec requrements. Previously an unused copy of the GLTF scene parser was located in render/io. It was being built, but not used as only plugin based sceneloaders were loaded by the renderer. Now it should be usable and always available. Change-Id: Ic2e31e2b63a871559aad9bad90ec2820988a1571 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl')
-rw-r--r--examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl25
1 files changed, 6 insertions, 19 deletions
diff --git a/examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl b/examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl
index 72192fee4..b41a6d5fc 100644
--- a/examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl
+++ b/examples/qt3d/exampleresources/assets/gltf/wine/wine2FS.glsl
@@ -1,21 +1,8 @@
-#version 150
-//precision highp float;
-
-in vec3 v_normal;
-uniform vec4 u_ambient;
-uniform vec4 u_diffuse;
-uniform float u_transparency;
-out vec4 fragColor;
-
+precision highp float;
void main(void) {
- vec3 normal = normalize(v_normal);
- vec4 color = vec4(0., 0., 0., 0.);
- vec4 diffuse = vec4(0., 0., 0., 1.);
- vec4 ambient;
- ambient = u_ambient;
- diffuse = u_diffuse;
- diffuse.xyz *= max(dot(normal,vec3(0.,0.,1.)), 0.);
- color.xyz += diffuse.xyz;
- color = vec4(color.rgb * diffuse.a, diffuse.a * u_transparency);
- fragColor = color;
+vec4 color = vec4(0., 0., 0., 0.);
+vec4 diffuse = vec4(0., 0., 0., 1.);
+color.xyz += diffuse.xyz;
+color = vec4(color.rgb * diffuse.a, diffuse.a);
+gl_FragColor = color;
}