Skip to content
Browse files

Slight cleanup

  • Loading branch information...
1 parent 0d6dedf commit 7591d77498308976477bcaf5a07a8950bba096a0 stegu committed Mar 25, 2011
Showing with 17 additions and 19 deletions.
  1. +2 −0 benchmark/Makefile
  2. +7 −10 benchmark/Win32/Makefile
  3. +8 −9 src/noise4D.glsl
View
2 benchmark/Makefile
@@ -7,6 +7,7 @@ default:
@echo "make [ Linux | MacOSX | Win32 | clean | clean-Win32]"
clean:
+ cd common ; make clean
cd Linux ; make clean
cd MacOSX ; make clean
@@ -23,4 +24,5 @@ Win32:
cd $@ && $(WINMAKE) && $(WINMAKE)
clean-Win32:
+ cd common && $(WINMAKE) clean
cd Win32 && $(WINMAKE) clean
View
17 benchmark/Win32/Makefile
@@ -9,31 +9,28 @@ LINKOBJ = noisebench.o
LIBS = -L$(MINGW32)/lib -mwindows -lglfw -lopengl32 -lglu32 -mconsole -g3
INCS = -I. -I$(MINGW32)/include
CFLAGS = $(INCS) -Wall -O3 -ffast-math -g3
-RM = del
-CP = copy
-CAT = type
EXECNAME = noisebench.exe
OUTPUTFILE = ashimanoise.log
all: $(EXECNAME)
clean:
- ${RM} $(OBJ) $(EXECNAME) $(SHADERS) $(OUTPUTFILE) $(SRC)
+ del $(OBJ) $(EXECNAME) $(SHADERS) $(OUTPUTFILE) $(SRC)
GLSL-ashimanoise.vert:
- ${CP} ..\common\GLSL-ashimanoise.vert .
+ copy ..\common\GLSL-ashimanoise.vert .
GLSL-ashimanoise2D.frag:
- ${CP} ..\common\GLSL-ashimanoise2D.frag .
+ copy ..\common\GLSL-ashimanoise2D.frag .
GLSL-ashimanoise3D.frag:
- ${CP} ..\common\GLSL-ashimanoise3D.frag .
+ copy ..\common\GLSL-ashimanoise3D.frag .
GLSL-ashimanoise4D.frag:
- ${CP} ..\common\GLSL-ashimanoise4D.frag .
+ copy ..\common\GLSL-ashimanoise4D.frag .
$(SRC):
- ${CP} ..\common\$(SRC) .
+ copy ..\common\$(SRC) .
$(OBJ): $(SRC)
$(CC) -c $(SRC) -o $(OBJ) $(CFLAGS)
@@ -43,4 +40,4 @@ $(EXECNAME): $(OBJ) $(SHADERS)
run: $(EXECNAME)
./$(EXECNAME)
- $(CAT) $(OUTPUTFILE)
+ type $(OUTPUTFILE)
View
17 src/noise4D.glsl
@@ -41,18 +41,17 @@ float simplexNoise(vec4 v)
i0.x = dot( isX, vec3( 1.0 ) );
i0.yzw = 1.0 - isX;
- vec2 isY = step( x0.zw, x0.yy );
- i0.y += dot( isY, vec2( 1.0 ) );
- i0.zw += 1.0 - isY;
+ vec3 isYZ = step( x0.zww, x0.yyz );
+ i0.y += dot( isYZ.xy, vec2( 1.0 ) );
+ i0.zw += 1.0 - isYZ.xy;
- float isZ = step( x0.w, x0.z ); // Could be folded into the vec2 step() above
- i0.z += isZ;
- i0.w += 1.0 - isZ;
+ i0.z += isYZ.z;
+ i0.w += 1.0 - isYZ.z;
// i0 now contains the unique values 0,1,2,3 in each channel
- vec4 i1 = clamp( i0, 0.0, 1.0 );
- vec4 i2 = clamp( --i0, 0.0, 1.0 );
- vec4 i3 = clamp( --i0, 0.0, 1.0 );
+ vec4 i3 = clamp( i0, 0.0, 1.0 );
+ vec4 i2 = clamp( i0-1.0, 0.0, 1.0 );
+ vec4 i1 = clamp( i0-2.0, 0.0, 1.0 );
#else
// Force existance of strict total ordering in sort.
vec4 q0 = floor(x0 * 1024.0) + vec4( 0.0, 1.0/4.0, 2.0/4.0 , 3.0/4.0);

0 comments on commit 7591d77

Please sign in to comment.
Something went wrong with that request. Please try again.