aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-12-03 13:25:29 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-12-03 13:25:29 -0700
commitd2c266dd1dfe9ca3497e9b8966ac0086c3d4da62 (patch)
tree33c436d80447d6c12ea2beabd9472ee4c1758eeb
parentecf90db5ffada1890e759c5a7e91c13ec15a02bd (diff)
downloadterralloc-d2c266dd1dfe9ca3497e9b8966ac0086c3d4da62.tar.gz
terralloc-d2c266dd1dfe9ca3497e9b8966ac0086c3d4da62.tar.bz2
terralloc-d2c266dd1dfe9ca3497e9b8966ac0086c3d4da62.zip
basic.frag -> version 400 to avoid compile erros on Intel
-rw-r--r--shaders/basic.frag6
1 files changed, 3 insertions, 3 deletions
diff --git a/shaders/basic.frag b/shaders/basic.frag
index 61e57bf..273efdc 100644
--- a/shaders/basic.frag
+++ b/shaders/basic.frag
@@ -1,4 +1,4 @@
-#version 150
+#version 400
#extension GL_ARB_explicit_attrib_location : enable
#extension GL_ARB_explicit_uniform_location : enable
@@ -24,7 +24,7 @@ in vec4 position ;
flat in int texidx ;
-vec3 sample(float xc,float yc) {
+vec3 sample_tex(float xc,float yc) {
vec3 color = vec3(0);
for ( int i = 0 ; i < 8 ; ++ i ) {
vec4 tmp = texture2D(textures[i], texcoord + vec2(xc,yc)) ;
@@ -78,7 +78,7 @@ void main() {
down = normalize(cross( normal, right ) );
vec3 newNorm = calNormChange(normal,down,right) ;
- vec3 color = sample(0,0) ;
+ vec3 color = sample_tex(0,0) ;
float prod = dot( normalize(-newNorm), normalize(vec3(lightPos - position)));
vec3 intensity = vec3(prod,prod,max(prod,0.4)) ;