diff options
author | Joshua Rahm <joshua.rahm@colorado.edu> | 2014-04-19 14:50:38 -0600 |
---|---|---|
committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2014-04-19 14:50:38 -0600 |
commit | 14b6f5cee8236f7c42065813c5dd6a659d4d5d65 (patch) | |
tree | d64893feea6fcfe1a1e0188f328b8d92bdc55f7a /shaders/basic.frag | |
parent | 491d908b52e4f2854bf844a8c393211dea041333 (diff) | |
download | terralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.tar.gz terralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.tar.bz2 terralloc-14b6f5cee8236f7c42065813c5dd6a659d4d5d65.zip |
made shaders faster
Diffstat (limited to 'shaders/basic.frag')
-rw-r--r-- | shaders/basic.frag | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/shaders/basic.frag b/shaders/basic.frag index 719137d..835efbf 100644 --- a/shaders/basic.frag +++ b/shaders/basic.frag @@ -20,6 +20,8 @@ in float texture_blend[8] ; in vec2 texcoord ; in vec4 position ; +flat in int texidx ; + vec3 sample(float xc,float yc) { vec3 color = vec3(0); for ( int i = 0 ; i < 8 ; ++ i ) { @@ -49,7 +51,7 @@ int dominentTexture() { } vec3 calNormChange( vec3 norm, vec3 down, vec3 right ) { - int dom = dominentTexture() ; + int dom = texidx ; float x00 = length(sample2(dom,-dX, dY)); float x01 = length(sample2(dom, 0, dY)); float x02 = length(sample2(dom, dX, dY)); |