diff options
Diffstat (limited to 'themes/src/shaders')
-rw-r--r-- | themes/src/shaders/renderer2d.frag | 0 | ||||
-rw-r--r-- | themes/src/shaders/renderer2d.vert | 0 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d.frag | 7 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d.vert | 15 |
4 files changed, 22 insertions, 0 deletions
diff --git a/themes/src/shaders/renderer2d.frag b/themes/src/shaders/renderer2d.frag new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/themes/src/shaders/renderer2d.frag diff --git a/themes/src/shaders/renderer2d.vert b/themes/src/shaders/renderer2d.vert new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/themes/src/shaders/renderer2d.vert diff --git a/themes/src/shaders/renderer3d.frag b/themes/src/shaders/renderer3d.frag new file mode 100644 index 0000000..2f50347 --- /dev/null +++ b/themes/src/shaders/renderer3d.frag @@ -0,0 +1,7 @@ +varying lowp vec4 VertexColor; +varying lowp vec4 VertexNormal; + +void main() { + const lowp vec3 lightDirection = vec3(0.0, 1.0, 0.0); + gl_FragColor = vec4(VertexColor.xyz * dot(VertexNormal.xyz, lightDirection), 1); +} diff --git a/themes/src/shaders/renderer3d.vert b/themes/src/shaders/renderer3d.vert new file mode 100644 index 0000000..026285f --- /dev/null +++ b/themes/src/shaders/renderer3d.vert @@ -0,0 +1,15 @@ +attribute vec4 position; +attribute vec4 color; +attribute vec4 normal; +uniform mat4 projection; +uniform mat4 view; +uniform mat4 model; +varying lowp vec4 VertexColor; +varying lowp vec4 VertexNormal; + +void main() { + vec4 fragmentPosition = projection * view * model * position; + gl_Position = fragmentPosition; + VertexColor = color; + VertexNormal = normal; +} |