diff --git a/resources.qrc b/resources.qrc
index 248b9fa0..3392db02 100644
--- a/resources.qrc
+++ b/resources.qrc
@@ -6,6 +6,10 @@
resources/tree-branch-more.png
resources/tree-branch-open.png
resources/tree-vline.png
+ shaders/default.vert
+ shaders/default.frag
+ shaders/default.core.vert
+ shaders/default.core.frag
ACKNOWLEDGEMENTS.html
AUTHORS
CONTRIBUTORS
diff --git a/shaders/default.core.frag b/shaders/default.core.frag
new file mode 100644
index 00000000..0e835ce0
--- /dev/null
+++ b/shaders/default.core.frag
@@ -0,0 +1,20 @@
+#version 150
+in highp vec3 vert;
+in highp vec3 vertNormal;
+in highp vec3 vertColor;
+in highp vec2 vertTexCoord;
+out highp vec4 fragColor;
+uniform highp vec3 lightPos;
+uniform highp sampler2D textureId;
+uniform highp int textureEnabled;
+void main()
+{
+ highp vec3 L = normalize(lightPos - vert);
+ highp float NL = max(dot(normalize(vertNormal), L), 0.0);
+ highp vec3 color = vertColor;
+ if (textureEnabled == 1) {
+ color = texture(textureId, vertTexCoord).rgb;
+ }
+ highp vec3 col = clamp(color * 0.2 + color * 0.8 * NL, 0.0, 1.0);
+ fragColor = vec4(col, 1.0);
+}
\ No newline at end of file
diff --git a/shaders/default.core.vert b/shaders/default.core.vert
new file mode 100644
index 00000000..4aafcdb5
--- /dev/null
+++ b/shaders/default.core.vert
@@ -0,0 +1,20 @@
+#version 150
+in vec4 vertex;
+in vec3 normal;
+in vec3 color;
+in vec2 texCoord;
+out vec3 vert;
+out vec3 vertNormal;
+out vec3 vertColor;
+out vec2 vertTexCoord;
+uniform mat4 projMatrix;
+uniform mat4 mvMatrix;
+uniform mat3 normalMatrix;
+void main()
+{
+ vert = vertex.xyz;
+ vertNormal = normalMatrix * normal;
+ vertColor = color;
+ vertTexCoord = texCoord;
+ gl_Position = projMatrix * mvMatrix * vertex;
+}
\ No newline at end of file
diff --git a/shaders/default.frag b/shaders/default.frag
new file mode 100644
index 00000000..4f460ab1
--- /dev/null
+++ b/shaders/default.frag
@@ -0,0 +1,18 @@
+varying highp vec3 vert;
+varying highp vec3 vertNormal;
+varying highp vec3 vertColor;
+varying highp vec2 vertTexCoord;
+uniform highp vec3 lightPos;
+uniform highp sampler2D textureId;
+uniform highp int textureEnabled;
+void main()
+{
+ highp vec3 L = normalize(lightPos - vert);
+ highp float NL = max(dot(normalize(vertNormal), L), 0.0);
+ highp vec3 color = vertColor;
+ if (textureEnabled == 1) {
+ color = texture2D(textureId, vertTexCoord).rgb;
+ }
+ highp vec3 col = clamp(color * 0.2 + color * 0.8 * NL, 0.0, 1.0);
+ gl_FragColor = vec4(col, 1.0);
+}
\ No newline at end of file
diff --git a/shaders/default.vert b/shaders/default.vert
new file mode 100644
index 00000000..63a207d4
--- /dev/null
+++ b/shaders/default.vert
@@ -0,0 +1,19 @@
+attribute vec4 vertex;
+attribute vec3 normal;
+attribute vec3 color;
+attribute vec2 texCoord;
+varying vec3 vert;
+varying vec3 vertNormal;
+varying vec3 vertColor;
+varying vec2 vertTexCoord;
+uniform mat4 projMatrix;
+uniform mat4 mvMatrix;
+uniform mat3 normalMatrix;
+void main()
+{
+ vert = vertex.xyz;
+ vertNormal = normalMatrix * normal;
+ vertColor = color;
+ vertTexCoord = texCoord;
+ gl_Position = projMatrix * mvMatrix * vertex;
+}
\ No newline at end of file
diff --git a/src/modelshaderprogram.cpp b/src/modelshaderprogram.cpp
index 90175bdc..cd4a161b 100644
--- a/src/modelshaderprogram.cpp
+++ b/src/modelshaderprogram.cpp
@@ -1,91 +1,31 @@
#include
+#include
+#include