diff options
author | mattkae <mattkae@protonmail.com> | 2023-07-31 07:31:52 -0400 |
---|---|---|
committer | mattkae <mattkae@protonmail.com> | 2023-07-31 07:31:52 -0400 |
commit | b6a666e96ffd04bd6d52be8fd9899faf27b751db (patch) | |
tree | ddc56ec77d0fa6a35a581ea49bcd1b4c3cac3756 /themes/src/shaders | |
parent | ffa1ada2b7f65e0b3afe561b3291219394df21f3 (diff) |
Some initial shader loading work
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/renderer2d_frag.h | 4 | ||||
-rw-r--r-- | themes/src/shaders/renderer2d_vert.h | 4 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d.frag | 7 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d.vert | 15 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d_frag.h | 11 | ||||
-rw-r--r-- | themes/src/shaders/renderer3d_vert.h | 19 | ||||
-rw-r--r-- | themes/src/shaders/sun_vert.h | 4 |
9 files changed, 42 insertions, 22 deletions
diff --git a/themes/src/shaders/renderer2d.frag b/themes/src/shaders/renderer2d.frag deleted file mode 100644 index e69de29..0000000 --- a/themes/src/shaders/renderer2d.frag +++ /dev/null diff --git a/themes/src/shaders/renderer2d.vert b/themes/src/shaders/renderer2d.vert deleted file mode 100644 index e69de29..0000000 --- a/themes/src/shaders/renderer2d.vert +++ /dev/null diff --git a/themes/src/shaders/renderer2d_frag.h b/themes/src/shaders/renderer2d_frag.h new file mode 100644 index 0000000..6f5e472 --- /dev/null +++ b/themes/src/shaders/renderer2d_frag.h @@ -0,0 +1,4 @@ +#ifndef SHADER_RENDERER2D_FRAG +#define SHADER_RENDERER2D_FRAG +const char* shader_renderer2d_frag = " \n"; +#endif diff --git a/themes/src/shaders/renderer2d_vert.h b/themes/src/shaders/renderer2d_vert.h new file mode 100644 index 0000000..b32cf9f --- /dev/null +++ b/themes/src/shaders/renderer2d_vert.h @@ -0,0 +1,4 @@ +#ifndef SHADER_RENDERER2D_VERT +#define SHADER_RENDERER2D_VERT +const char* shader_renderer2d_vert = " \n"; +#endif diff --git a/themes/src/shaders/renderer3d.frag b/themes/src/shaders/renderer3d.frag deleted file mode 100644 index 2f50347..0000000 --- a/themes/src/shaders/renderer3d.frag +++ /dev/null @@ -1,7 +0,0 @@ -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 deleted file mode 100644 index 026285f..0000000 --- a/themes/src/shaders/renderer3d.vert +++ /dev/null @@ -1,15 +0,0 @@ -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; -} diff --git a/themes/src/shaders/renderer3d_frag.h b/themes/src/shaders/renderer3d_frag.h new file mode 100644 index 0000000..6b3a936 --- /dev/null +++ b/themes/src/shaders/renderer3d_frag.h @@ -0,0 +1,11 @@ +#ifndef SHADER_RENDERER3D_FRAG +#define SHADER_RENDERER3D_FRAG +const char* shader_renderer3d_frag = "varying lowp vec4 VertexColor; \n" +"varying lowp vec4 VertexNormal; \n" +" \n" +"void main() { \n" +" const lowp vec3 lightDirection = vec3(0.0, 1.0, 0.0); \n" +" gl_FragColor = vec4(VertexColor.xyz * dot(VertexNormal.xyz, lightDirection), 1); \n" +"} \n" +" \n"; +#endif diff --git a/themes/src/shaders/renderer3d_vert.h b/themes/src/shaders/renderer3d_vert.h new file mode 100644 index 0000000..20e69f9 --- /dev/null +++ b/themes/src/shaders/renderer3d_vert.h @@ -0,0 +1,19 @@ +#ifndef SHADER_RENDERER3D_VERT +#define SHADER_RENDERER3D_VERT +const char* shader_renderer3d_vert = "attribute vec4 position; \n" +"attribute vec4 color; \n" +"attribute vec4 normal; \n" +"uniform mat4 projection; \n" +"uniform mat4 view; \n" +"uniform mat4 model; \n" +"varying lowp vec4 VertexColor; \n" +"varying lowp vec4 VertexNormal; \n" +" \n" +"void main() { \n" +" vec4 fragmentPosition = projection * view * model * position; \n" +" gl_Position = fragmentPosition; \n" +" VertexColor = color; \n" +" VertexNormal = normal; \n" +"} \n" +" \n"; +#endif diff --git a/themes/src/shaders/sun_vert.h b/themes/src/shaders/sun_vert.h new file mode 100644 index 0000000..2f9bf69 --- /dev/null +++ b/themes/src/shaders/sun_vert.h @@ -0,0 +1,4 @@ +#ifndef SHADER_SUN_VERT +#define SHADER_SUN_VERT +const char* shader_sun_vert = " \n"; +#endif |