aboutsummaryrefslogtreecommitdiff
path: root/shaders/basic.vert
diff options
context:
space:
mode:
authorJoshua Rahm <joshua.rahm@colorado.edu>2014-04-19 14:50:38 -0600
committerJoshua Rahm <joshua.rahm@colorado.edu>2014-04-19 14:50:38 -0600
commit14b6f5cee8236f7c42065813c5dd6a659d4d5d65 (patch)
treed64893feea6fcfe1a1e0188f328b8d92bdc55f7a /shaders/basic.vert
parent491d908b52e4f2854bf844a8c393211dea041333 (diff)
downloadterralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.tar.gz
terralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.tar.bz2
terralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.zip
made shaders faster
Diffstat (limited to 'shaders/basic.vert')
-rw-r--r--shaders/basic.vert4
1 files changed, 3 insertions, 1 deletions
diff --git a/shaders/basic.vert b/shaders/basic.vert
index e1abeb5..36e0c48 100644
--- a/shaders/basic.vert
+++ b/shaders/basic.vert
@@ -16,6 +16,7 @@ out vec4 position ;
out vec3 normal ;
out float texture_blend[8] ;
+flat out int texidx ;
void main() {
gl_Position = pjMatrix * (position = mvMatrix * vec4(in_position,1.0)) ;
@@ -23,5 +24,6 @@ void main() {
normal = normalMatrix * in_normal ;
for ( int i = 0 ; i < 8 ; ++ i )
texture_blend[i] = 0 ;
- texture_blend[int(clamp(round(in_color.a),0,8))] = 1.0 ;
+ texidx = int(clamp(round(in_color.a),0,8));
+ texture_blend[texidx] = 1.0 ;
}