summaryrefslogtreecommitdiff
path: root/chickadee/render/pbr.scm
diff options
context:
space:
mode:
Diffstat (limited to 'chickadee/render/pbr.scm')
-rw-r--r--chickadee/render/pbr.scm17
1 files changed, 15 insertions, 2 deletions
diff --git a/chickadee/render/pbr.scm b/chickadee/render/pbr.scm
index ab02659..167334e 100644
--- a/chickadee/render/pbr.scm
+++ b/chickadee/render/pbr.scm
@@ -94,11 +94,18 @@
#ifdef GLSL330
layout (location = 0) in vec3 position;
layout (location = 1) in vec2 texcoord0;
-#elif ifdef GLSL130
+#elif defined(GLSL130)
in vec3 position;
in vec2 texcoord0;
+#elif defined(GLSL120)
+attribute vec3 position;
+attribute vec2 texcoord0;
#endif
+#ifdef GLSL120
+varying vec2 fragTex;
+#else
out vec2 fragTex;
+#endif
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
@@ -109,8 +116,14 @@ void main(void) {
}
"
"
+#ifdef GLSL120
+attribute vec2 fragTex;
+#else
in vec2 fragTex;
+#endif
+#ifdef GLSL330
out vec4 fragColor;
+#endif
uniform vec3 baseColorFactor;
uniform sampler2D baseColorTexture;
@@ -118,7 +131,7 @@ void main (void) {
#ifdef GLSL330
fragColor = texture(baseColorTexture, fragTex) *
vec4(baseColorFactor, 1.0);
-#elif ifdef GLSL130
+#else
gl_FragColor = texture2D(baseColorTexture, fragTex) *
vec4(baseColorFactor, 1.0);
#endif