summaryrefslogtreecommitdiff
path: root/progs/glsl
diff options
context:
space:
mode:
Diffstat (limited to 'progs/glsl')
-rw-r--r--progs/glsl/.gitignore3
-rw-r--r--progs/glsl/CH11-toyball.frag.txt7
-rw-r--r--progs/glsl/CH11-toyball.vert.txt7
-rw-r--r--progs/glsl/Makefile6
4 files changed, 15 insertions, 8 deletions
diff --git a/progs/glsl/.gitignore b/progs/glsl/.gitignore
index 622e0417a8..b63693bbb5 100644
--- a/progs/glsl/.gitignore
+++ b/progs/glsl/.gitignore
@@ -1,10 +1,13 @@
+bitmap
brick
bump
deriv
extfuncs.h
mandelbrot
noise
+points
readtex.c
readtex.h
texdemo1
+trirast
toyball
diff --git a/progs/glsl/CH11-toyball.frag.txt b/progs/glsl/CH11-toyball.frag.txt
index 90ec1c27fc..f3cac62fb3 100644
--- a/progs/glsl/CH11-toyball.frag.txt
+++ b/progs/glsl/CH11-toyball.frag.txt
@@ -49,14 +49,15 @@ void main()
inorout += dot(distance, vec4(1.0));
distance.x = dot(p, HalfSpace4);
- distance.y = StripeWidth - abs(p.z);
+// distance.y = StripeWidth - abs(p.z);
+ distance.y = StripeWidth - abs(p.y);
distance = smoothstep(-FWidth, FWidth, distance);
inorout += distance.x;
inorout = clamp(inorout, 0.0, 1.0);
- surfColor = mix(Yellow, Red, inorout);
- surfColor = mix(surfColor, Blue, distance.y);
+ surfColor = mix(Yellow, Blue, distance.y);
+ surfColor = mix(surfColor, Red, inorout);
// normal = point on surface for sphere at (0,0,0)
normal = p;
diff --git a/progs/glsl/CH11-toyball.vert.txt b/progs/glsl/CH11-toyball.vert.txt
index b7da3ac839..a3ee1b0377 100644
--- a/progs/glsl/CH11-toyball.vert.txt
+++ b/progs/glsl/CH11-toyball.vert.txt
@@ -14,10 +14,11 @@ uniform vec4 BallCenter; // ball center in modelling coordinates
void main()
{
-//orig: ECposition = gl_ModelViewMatrix * gl_Vertex;
+ ECposition = gl_ModelViewMatrix * gl_Vertex;
- ECposition = gl_TextureMatrix[0] * gl_Vertex;
- ECposition = gl_ModelViewMatrix * ECposition;
+// ECposition = gl_TextureMatrix[0] * gl_Vertex;
+// ECposition = gl_MultiTexCoord0 * gl_Vertex;
+// ECposition = gl_ModelViewMatrix * ECposition;
ECballCenter = gl_ModelViewMatrix * BallCenter;
gl_Position = ftransform();
diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile
index 8b44239b43..fe2943d88d 100644
--- a/progs/glsl/Makefile
+++ b/progs/glsl/Makefile
@@ -7,6 +7,8 @@ INCDIR = $(TOP)/include
LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
+
PROGS = \
bitmap \
brick \
@@ -28,7 +30,7 @@ PROGS = \
# make executable from .c file:
.c: $(LIB_DEP)
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(APP_LIB_DEPS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@
##### TARGETS #####
@@ -64,7 +66,7 @@ points.c: extfuncs.h
toyball.c: extfuncs.h
texdemo1: texdemo1.o readtex.o
- $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o $(APP_LIB_DEPS) -o $@
+ $(CC) -I$(INCDIR) $(CFLAGS) $(LDFLAGS) texdemo1.o readtex.o $(LIBS) -o $@
texdemo1.o: texdemo1.c readtex.h extfuncs.h
$(CC) -c -I$(INCDIR) $(CFLAGS) texdemo1.c