summaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorDavid Thompson <davet@gnu.org>2015-06-06 09:30:42 -0400
committerDavid Thompson <davet@gnu.org>2015-06-06 09:30:42 -0400
commitde2abeb1a9bb6a51b0057baa5097b64c06590297 (patch)
treed00bd781b7d7bfdcb65b3932d7737196d98dffe9 /data
parentbef0b89e4e8eec38fac455f19657ecff979aa287 (diff)
render: Bypass texture rendering when a model uses the null texture.
* data/shaders/default-fragment.glsl (use_texture): New uniform. (main): Skip texture rendering when 'use_texture' is false. * sly/render/model.scm (draw-model): Set 'use_texture' uniform before rendering. * sly/render/shader.scm (load-default-shader): Register 'use_texture' uniform.
Diffstat (limited to 'data')
-rw-r--r--data/shaders/default-fragment.glsl5
1 files changed, 5 insertions, 0 deletions
diff --git a/data/shaders/default-fragment.glsl b/data/shaders/default-fragment.glsl
index 21bb756..a447a79 100644
--- a/data/shaders/default-fragment.glsl
+++ b/data/shaders/default-fragment.glsl
@@ -3,7 +3,12 @@
in vec2 frag_tex;
uniform vec4 color;
uniform sampler2D color_texture;
+uniform bool use_texture;
void main (void) {
+ if(use_texture) {
gl_FragColor = texture2D(color_texture, frag_tex) * color;
+ } else {
+ gl_FragColor = color;
+ }
}