Browse Source

Rearanging the SSAO and a few other things

Panagiotis Christopoulos Charitos 16 years ago
parent
commit
231f8ad0f7

+ 78 - 77
build/debug/Makefile

@@ -5,8 +5,8 @@ PHFLAGS = $(CFLAGS) -x c++-header
 LFLAGS = $(COMMONFLAGS) -rdynamic -L../../../bullet_svn/src/BulletSoftBody -L../../../bullet_svn/src/BulletDynamics -L../../../bullet_svn/src/BulletCollision -L../../../bullet_svn/src/LinearMath -Wl,-Bstatic -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -lGLEW -lSDL_image -lGLU -Wl,-Bdynamic -lSDL -lGL -ljpeg -lpng -ltiff
 EXECUTABLE = AnKi.bin
 INCPATH = -I../../src/math/ -I../../src/tokenizer/ -I../../src/uncategorized/ -I../../src/ -I../../src/renderer/ -I../../src/scene/ -I../../src/ui/ -I../../src/resources/ -I../../src/utility/ -I../../src/controllers/ -I../../../bullet_svn/src/ 
-SOURCES = ../../src/tokenizer//Scanner.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//map.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//particles.cpp ../../src//main.cpp ../../src/renderer//Dbg.cpp ../../src/renderer//BulletDebuger.cpp ../../src/renderer//Shadows.cpp ../../src/renderer//Hdr.cpp ../../src/renderer//Ssao.cpp ../../src/renderer//Lscatt.cpp ../../src/renderer//Bs2.cpp ../../src/renderer//Ms.cpp ../../src/renderer//Pps.cpp ../../src/renderer//Earlyz.cpp ../../src/renderer//Bs.cpp ../../src/renderer//Is.cpp ../../src/renderer//Renderer.cpp ../../src/scene//SkelNode.cpp ../../src/scene//Light.cpp ../../src/scene//SkelModelNode.cpp ../../src/scene//Scene.cpp ../../src/scene//MeshNode.cpp ../../src/scene//Camera.cpp ../../src/scene//Node.cpp ../../src/ui//Ui.cpp ../../src/resources//LightProps.cpp ../../src/resources//SkelAnim.cpp ../../src/resources//Mesh.cpp ../../src/resources//ShaderProg.cpp ../../src/resources//Material.cpp ../../src/resources//ShaderParser.cpp ../../src/resources//Extension.cpp ../../src/resources//Skeleton.cpp ../../src/resources//Texture.cpp ../../src/resources//Resource.cpp ../../src/utility//Input.cpp ../../src/utility//App.cpp ../../src/utility//Common.cpp ../../src/utility//Util.cpp ../../src/controllers//SkelAnimCtrl.cpp ../../src/controllers//Controller.cpp 
-OBJECTS = Scanner.o collision.o skybox.o map.o memory.o particles.o main.o Dbg.o BulletDebuger.o Shadows.o Hdr.o Ssao.o Lscatt.o Bs2.o Ms.o Pps.o Earlyz.o Bs.o Is.o Renderer.o SkelNode.o Light.o SkelModelNode.o Scene.o MeshNode.o Camera.o Node.o Ui.o LightProps.o SkelAnim.o Mesh.o ShaderProg.o Material.o ShaderParser.o Extension.o Skeleton.o Texture.o Resource.o Input.o App.o Common.o Util.o SkelAnimCtrl.o Controller.o 
+SOURCES = ../../src/tokenizer//Scanner.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//map.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//particles.cpp ../../src//main.cpp ../../src/renderer//MsEarlyz.cpp ../../src/renderer//PpsSsao.cpp ../../src/renderer//Dbg.cpp ../../src/renderer//BulletDebuger.cpp ../../src/renderer//PpsHdr.cpp ../../src/renderer//PpsLscatt.cpp ../../src/renderer//Bs2.cpp ../../src/renderer//Ms.cpp ../../src/renderer//Pps.cpp ../../src/renderer//Bs.cpp ../../src/renderer//IsShadows.cpp ../../src/renderer//Is.cpp ../../src/renderer//Renderer.cpp ../../src/scene//SkelNode.cpp ../../src/scene//Light.cpp ../../src/scene//SkelModelNode.cpp ../../src/scene//Scene.cpp ../../src/scene//MeshNode.cpp ../../src/scene//Camera.cpp ../../src/scene//Node.cpp ../../src/ui//Ui.cpp ../../src/resources//LightProps.cpp ../../src/resources//SkelAnim.cpp ../../src/resources//Mesh.cpp ../../src/resources//ShaderProg.cpp ../../src/resources//Material.cpp ../../src/resources//ShaderParser.cpp ../../src/resources//Extension.cpp ../../src/resources//Skeleton.cpp ../../src/resources//Texture.cpp ../../src/resources//Resource.cpp ../../src/utility//Input.cpp ../../src/utility//App.cpp ../../src/utility//Common.cpp ../../src/utility//Util.cpp ../../src/controllers//SkelAnimCtrl.cpp ../../src/controllers//Controller.cpp 
+OBJECTS = Scanner.o collision.o skybox.o map.o memory.o particles.o main.o MsEarlyz.o PpsSsao.o Dbg.o BulletDebuger.o PpsHdr.o PpsLscatt.o Bs2.o Ms.o Pps.o Bs.o IsShadows.o Is.o Renderer.o SkelNode.o Light.o SkelModelNode.o Scene.o MeshNode.o Camera.o Node.o Ui.o LightProps.o SkelAnim.o Mesh.o ShaderProg.o Material.o ShaderParser.o Extension.o Skeleton.o Texture.o Resource.o Input.o App.o Common.o Util.o SkelAnimCtrl.o Controller.o 
 PRECOMPILED_HEADERS = 
 
 all: $(PRECOMPILED_HEADERS) $(SOURCES) $(EXECUTABLE)
@@ -253,10 +253,55 @@ main.o: ../../src//main.cpp ../../src/utility/Common.h \
  ../../../bullet_svn/src/BulletDynamics/Dynamics/btActionInterface.h \
  ../../../bullet_svn/src/BulletDynamics/Dynamics/btRigidBody.h \
  ../../src/renderer/BulletDebuger.h \
- ../../../bullet_svn/src/LinearMath/btIDebugDraw.h
+ ../../../bullet_svn/src/LinearMath/btIDebugDraw.h \
+ ../../src/resources/ShaderParser.h
 	@echo Compiling ../../src//main.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src//main.cpp -o main.o
 
+MsEarlyz.o: ../../src/renderer//MsEarlyz.cpp \
+ ../../src/renderer//Renderer.h ../../src/utility/Common.h \
+ ../../src/uncategorized/memory.h ../../src/math/Math.h \
+ ../../src/math/Vec2.h ../../src/math/MathForwardDecls.h \
+ ../../src/math/Vec2.inl.h ../../src/math/MathDfltHeader.h \
+ ../../src/math/Vec3.h ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
+ ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
+ ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
+ ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
+ ../../src/math/Euler.inl.h ../../src/math/Mat3.h \
+ ../../src/math/Mat3.inl.h ../../src/math/Mat4.h \
+ ../../src/math/Mat4.inl.h ../../src/math/MathFuncs.h \
+ ../../src/math/MathFuncs.inl.h ../../src/resources/ShaderProg.h \
+ ../../src/resources/Resource.h ../../src/utility/Util.h \
+ ../../src/utility/Common.h ../../src/scene/Camera.h \
+ ../../src/uncategorized/collision.h ../../src/scene/Node.h \
+ ../../src/resources/Resource.h ../../src/resources/Texture.h \
+ ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
+ ../../src/renderer//Fbo.h
+	@echo Compiling ../../src/renderer//MsEarlyz.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//MsEarlyz.cpp -o MsEarlyz.o
+
+PpsSsao.o: ../../src/renderer//PpsSsao.cpp ../../src/renderer//Renderer.h \
+ ../../src/utility/Common.h ../../src/uncategorized/memory.h \
+ ../../src/math/Math.h ../../src/math/Vec2.h \
+ ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
+ ../../src/math/MathDfltHeader.h ../../src/math/Vec3.h \
+ ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
+ ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
+ ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
+ ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
+ ../../src/math/Euler.inl.h ../../src/math/Mat3.h \
+ ../../src/math/Mat3.inl.h ../../src/math/Mat4.h \
+ ../../src/math/Mat4.inl.h ../../src/math/MathFuncs.h \
+ ../../src/math/MathFuncs.inl.h ../../src/resources/ShaderProg.h \
+ ../../src/resources/Resource.h ../../src/utility/Util.h \
+ ../../src/utility/Common.h ../../src/scene/Camera.h \
+ ../../src/uncategorized/collision.h ../../src/scene/Node.h \
+ ../../src/resources/Resource.h ../../src/resources/Texture.h \
+ ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
+ ../../src/renderer//Fbo.h
+	@echo Compiling ../../src/renderer//PpsSsao.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//PpsSsao.cpp -o PpsSsao.o
+
 Dbg.o: ../../src/renderer//Dbg.cpp ../../src/renderer//Renderer.h \
  ../../src/utility/Common.h ../../src/uncategorized/memory.h \
  ../../src/math/Math.h ../../src/math/Vec2.h \
@@ -437,30 +482,7 @@ BulletDebuger.o: ../../src/renderer//BulletDebuger.cpp \
 	@echo Compiling ../../src/renderer//BulletDebuger.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//BulletDebuger.cpp -o BulletDebuger.o
 
-Shadows.o: ../../src/renderer//Shadows.cpp ../../src/renderer//Renderer.h \
- ../../src/utility/Common.h ../../src/uncategorized/memory.h \
- ../../src/math/Math.h ../../src/math/Vec2.h \
- ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
- ../../src/math/MathDfltHeader.h ../../src/math/Vec3.h \
- ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
- ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
- ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
- ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
- ../../src/math/Euler.inl.h ../../src/math/Mat3.h \
- ../../src/math/Mat3.inl.h ../../src/math/Mat4.h \
- ../../src/math/Mat4.inl.h ../../src/math/MathFuncs.h \
- ../../src/math/MathFuncs.inl.h ../../src/resources/ShaderProg.h \
- ../../src/resources/Resource.h ../../src/utility/Util.h \
- ../../src/utility/Common.h ../../src/scene/Camera.h \
- ../../src/uncategorized/collision.h ../../src/scene/Node.h \
- ../../src/resources/Texture.h ../../src/scene/Scene.h \
- ../../src/uncategorized/skybox.h ../../src/resources/Resource.h \
- ../../src/renderer//Fbo.h ../../src/resources/Material.h \
- ../../src/scene/MeshNode.h
-	@echo Compiling ../../src/renderer//Shadows.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Shadows.cpp -o Shadows.o
-
-Hdr.o: ../../src/renderer//Hdr.cpp ../../src/renderer//Renderer.h \
+PpsHdr.o: ../../src/renderer//PpsHdr.cpp ../../src/renderer//Renderer.h \
  ../../src/utility/Common.h ../../src/uncategorized/memory.h \
  ../../src/math/Math.h ../../src/math/Vec2.h \
  ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
@@ -479,37 +501,15 @@ Hdr.o: ../../src/renderer//Hdr.cpp ../../src/renderer//Renderer.h \
  ../../src/resources/Resource.h ../../src/resources/Texture.h \
  ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
  ../../src/renderer//Fbo.h
-	@echo Compiling ../../src/renderer//Hdr.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Hdr.cpp -o Hdr.o
+	@echo Compiling ../../src/renderer//PpsHdr.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//PpsHdr.cpp -o PpsHdr.o
 
-Ssao.o: ../../src/renderer//Ssao.cpp ../../src/renderer//Renderer.h \
- ../../src/utility/Common.h ../../src/uncategorized/memory.h \
- ../../src/math/Math.h ../../src/math/Vec2.h \
- ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
- ../../src/math/MathDfltHeader.h ../../src/math/Vec3.h \
- ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
- ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
- ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
- ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
- ../../src/math/Euler.inl.h ../../src/math/Mat3.h \
- ../../src/math/Mat3.inl.h ../../src/math/Mat4.h \
- ../../src/math/Mat4.inl.h ../../src/math/MathFuncs.h \
- ../../src/math/MathFuncs.inl.h ../../src/resources/ShaderProg.h \
- ../../src/resources/Resource.h ../../src/utility/Util.h \
- ../../src/utility/Common.h ../../src/scene/Camera.h \
- ../../src/uncategorized/collision.h ../../src/scene/Node.h \
- ../../src/resources/Resource.h ../../src/resources/Texture.h \
- ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
- ../../src/renderer//Fbo.h
-	@echo Compiling ../../src/renderer//Ssao.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Ssao.cpp -o Ssao.o
-
-Lscatt.o: ../../src/renderer//Lscatt.cpp ../../src/renderer//Renderer.h \
- ../../src/utility/Common.h ../../src/uncategorized/memory.h \
- ../../src/math/Math.h ../../src/math/Vec2.h \
- ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
- ../../src/math/MathDfltHeader.h ../../src/math/Vec3.h \
- ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
+PpsLscatt.o: ../../src/renderer//PpsLscatt.cpp \
+ ../../src/renderer//Renderer.h ../../src/utility/Common.h \
+ ../../src/uncategorized/memory.h ../../src/math/Math.h \
+ ../../src/math/Vec2.h ../../src/math/MathForwardDecls.h \
+ ../../src/math/Vec2.inl.h ../../src/math/MathDfltHeader.h \
+ ../../src/math/Vec3.h ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
  ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
  ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
  ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
@@ -523,8 +523,8 @@ Lscatt.o: ../../src/renderer//Lscatt.cpp ../../src/renderer//Renderer.h \
  ../../src/resources/Resource.h ../../src/resources/Texture.h \
  ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
  ../../src/renderer//Fbo.h
-	@echo Compiling ../../src/renderer//Lscatt.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Lscatt.cpp -o Lscatt.o
+	@echo Compiling ../../src/renderer//PpsLscatt.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//PpsLscatt.cpp -o PpsLscatt.o
 
 Bs2.o: ../../src/renderer//Bs2.cpp ../../src/renderer//Renderer.h \
  ../../src/utility/Common.h ../../src/uncategorized/memory.h \
@@ -594,7 +594,7 @@ Pps.o: ../../src/renderer//Pps.cpp ../../src/renderer//Renderer.h \
 	@echo Compiling ../../src/renderer//Pps.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Pps.cpp -o Pps.o
 
-Earlyz.o: ../../src/renderer//Earlyz.cpp ../../src/renderer//Renderer.h \
+Bs.o: ../../src/renderer//Bs.cpp ../../src/renderer//Renderer.h \
  ../../src/utility/Common.h ../../src/uncategorized/memory.h \
  ../../src/math/Math.h ../../src/math/Vec2.h \
  ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
@@ -610,18 +610,20 @@ Earlyz.o: ../../src/renderer//Earlyz.cpp ../../src/renderer//Renderer.h \
  ../../src/resources/Resource.h ../../src/utility/Util.h \
  ../../src/utility/Common.h ../../src/scene/Camera.h \
  ../../src/uncategorized/collision.h ../../src/scene/Node.h \
- ../../src/resources/Resource.h ../../src/resources/Texture.h \
  ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
- ../../src/renderer//Fbo.h
-	@echo Compiling ../../src/renderer//Earlyz.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Earlyz.cpp -o Earlyz.o
+ ../../src/resources/Texture.h ../../src/resources/Mesh.h \
+ ../../src/renderer/Vbo.h ../../src/resources/Resource.h \
+ ../../src/renderer//Fbo.h ../../src/scene/MeshNode.h \
+ ../../src/resources/Material.h
+	@echo Compiling ../../src/renderer//Bs.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Bs.cpp -o Bs.o
 
-Bs.o: ../../src/renderer//Bs.cpp ../../src/renderer//Renderer.h \
- ../../src/utility/Common.h ../../src/uncategorized/memory.h \
- ../../src/math/Math.h ../../src/math/Vec2.h \
- ../../src/math/MathForwardDecls.h ../../src/math/Vec2.inl.h \
- ../../src/math/MathDfltHeader.h ../../src/math/Vec3.h \
- ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
+IsShadows.o: ../../src/renderer//IsShadows.cpp \
+ ../../src/renderer//Renderer.h ../../src/utility/Common.h \
+ ../../src/uncategorized/memory.h ../../src/math/Math.h \
+ ../../src/math/Vec2.h ../../src/math/MathForwardDecls.h \
+ ../../src/math/Vec2.inl.h ../../src/math/MathDfltHeader.h \
+ ../../src/math/Vec3.h ../../src/math/Vec3.inl.h ../../src/math/Vec4.h \
  ../../src/math/Vec4.inl.h ../../src/math/Quat.h \
  ../../src/math/Quat.inl.h ../../src/math/Axisang.h \
  ../../src/math/Axisang.inl.h ../../src/math/Euler.h \
@@ -632,13 +634,12 @@ Bs.o: ../../src/renderer//Bs.cpp ../../src/renderer//Renderer.h \
  ../../src/resources/Resource.h ../../src/utility/Util.h \
  ../../src/utility/Common.h ../../src/scene/Camera.h \
  ../../src/uncategorized/collision.h ../../src/scene/Node.h \
- ../../src/scene/Scene.h ../../src/uncategorized/skybox.h \
- ../../src/resources/Texture.h ../../src/resources/Mesh.h \
- ../../src/renderer/Vbo.h ../../src/resources/Resource.h \
- ../../src/renderer//Fbo.h ../../src/scene/MeshNode.h \
- ../../src/resources/Material.h
-	@echo Compiling ../../src/renderer//Bs.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//Bs.cpp -o Bs.o
+ ../../src/resources/Texture.h ../../src/scene/Scene.h \
+ ../../src/uncategorized/skybox.h ../../src/resources/Resource.h \
+ ../../src/renderer//Fbo.h ../../src/resources/Material.h \
+ ../../src/scene/MeshNode.h
+	@echo Compiling ../../src/renderer//IsShadows.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//IsShadows.cpp -o IsShadows.o
 
 Is.o: ../../src/renderer//Is.cpp ../../src/renderer//Renderer.h \
  ../../src/utility/Common.h ../../src/uncategorized/memory.h \

+ 0 - 0
shaders/pps.glsl → shaders/Pps.glsl


+ 0 - 0
shaders/pps_hdr_generic.glsl → shaders/PpsHdr.glsl


+ 0 - 0
shaders/pps_lscatt.glsl → shaders/PpsLscatt.glsl


+ 0 - 0
shaders/pps_ssao.glsl → shaders/PpsSsao.glsl


+ 37 - 0
shaders/PpsSsaoBlur.glsl

@@ -0,0 +1,37 @@
+#pragma anki vertShaderBegins
+
+#pragma anki include "shaders/simple_vert.glsl"
+
+#pragma anki fragShaderBegins
+
+#pragma anki include "shaders/median_filter.glsl"
+
+varying vec2 texCoords;
+
+uniform sampler2D tex;
+
+void main()
+{
+	#if defined( _PPS_SSAO_PASS_0_ )
+		float offset = 1.0 / float(textureSize(tex,0).x);
+	#else
+		float offset = 1.0 / float(textureSize(tex,0).y);
+	#endif
+	const int KERNEL_SIZE = 5;
+	float kernel[KERNEL_SIZE] = float[]( 0.0 * offset, 
+	                                     -1.0 * offset, 1.0 * offset, 
+	                                     -2.0 * offset, 2.0 * offset/*,
+																			 -3.0 * offset, 3.0 * offset,
+																			 -4.0 * offset, 4.0 * offset*/ );
+
+	float factor = 0.0;
+	for( int i=0; i<KERNEL_SIZE; i++ )
+	{
+		#if defined( _PPS_SSAO_PASS_0_ )
+			factor += texture2D( tex, texCoords + vec2(kernel[i], 0.0) ).a;
+		#else
+			factor += texture2D( tex, texCoords + vec2(0.0, kernel[i]) ).a;
+		#endif		
+	}
+	gl_FragData[0].a = factor / float(KERNEL_SIZE);
+}

+ 0 - 0
shaders/pps_ssao_blur2.glsl → shaders/PpsSsaoBlur2.glsl


+ 0 - 27
shaders/pps_ssao_blur.glsl

@@ -1,27 +0,0 @@
-#pragma anki vertShaderBegins
-
-#pragma anki include "shaders/simple_vert.glsl"
-
-#pragma anki fragShaderBegins
-
-#pragma anki include "shaders/median_filter.glsl"
-
-varying vec2 texCoords;
-
-uniform sampler2D tex;
-
-void main()
-{
-	//gl_FragData[0].a = MedianAndBlurA( tex, texCoords );
-	float offset = 1.0 / float(textureSize(tex,0).x);
-	const int KERNEL_SIZE = 9;
-	float kernel[KERNEL_SIZE] = float[]( -3.0 * offset, -2.0 * offset, -1.0 * offset, 0.0 * offset, 1.0 * offset, 2.0 * offset,
-																				3.0 * offset, -4.0 * offset, 4.0 * offset );
-
-	float factor = 0.0;
-	for( int i=0; i<KERNEL_SIZE; i++ )
-	{
-		factor += texture2D( tex, texCoords + vec2(kernel[i], 0.0) ).a;
-	}
-	gl_FragData[0].a = factor / KERNEL_SIZE;
-}

+ 0 - 4
src/main.cpp

@@ -170,10 +170,6 @@ void initPhysics()
 //=====================================================================================================================================
 void init()
 {
-	ShaderParser par;
-	par.parseFile( "test.glsl" );
-
-
 	PRINT( "Engine initializing..." );
 
 	initPhysics();

+ 1 - 2
src/renderer/Is.cpp

@@ -215,7 +215,7 @@ void init()
 	spotLightNoShadowSProg.uniLocs.lightTex = spotLightNoShadowSProg.getUniVar("lightTex").getLoc();
 	spotLightNoShadowSProg.uniLocs.texProjectionMat = spotLightNoShadowSProg.getUniVar("texProjectionMat").getLoc();
 
-	spotLightShadowSProg.customLoad( "shaders/is_lp_spot_generic.glsl", "#define _SPOT_LIGHT_\n#define _SHADOW_\n" );
+	spotLightShadowSProg.customLoad( "shaders/is_lp_generic.glsl", "#define _SPOT_LIGHT_\n#define _SHADOW_\n" );
 	spotLightShadowSProg.uniLocs.msNormalFai = spotLightShadowSProg.getUniVar("msNormalFai").getLoc();
 	spotLightShadowSProg.uniLocs.msDiffuseFai = spotLightShadowSProg.getUniVar("msDiffuseFai").getLoc();
 	spotLightShadowSProg.uniLocs.msSpecularFai = spotLightShadowSProg.getUniVar("msSpecularFai").getLoc();
@@ -479,7 +479,6 @@ static void SpotLightPass( const Camera& cam, const SpotLight& light )
 
 	//** set texture matrix for shadowmap projection **
 	// Bias * P_light * V_light * inv( V_cam )
-	//const float mBias[] = {0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.0, 0.0, 0.0, 0.5, 0.0, 0.5, 0.5, 0.5, 1.0};
 	static Mat4 bias_m4( 0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0 );
 	Mat4 tex_projection_mat;
 	tex_projection_mat = bias_m4 * light.camera.getProjectionMatrix() * light.camera.getViewMatrix() * cam.transformationWspace;

+ 0 - 0
src/renderer/Shadows.cpp → src/renderer/IsShadows.cpp


+ 0 - 0
src/renderer/Earlyz.cpp → src/renderer/MsEarlyz.cpp


+ 5 - 17
src/renderer/Pps.cpp

@@ -21,16 +21,6 @@ static Fbo fbo; // yet another FBO
 Texture fai;
 
 // shader stuff
-/*static ShaderProg* sProg;
-
-namespace shdrVars
-{
-	int isFai;
-	int ppsSsaoFai;
-	int msNormalFai;
-	int hdrFai;
-	int lscattFai;
-}*/
 
 class PpsShaderProg: public ShaderProg
 {
@@ -76,7 +66,7 @@ void init()
 
 
 	// init the shader and it's vars
-	sProg.customLoad( "shaders/pps.glsl" );
+	sProg.customLoad( "shaders/Pps.glsl" );
 	sProg.bind();
 
 	sProg.uniLocs.isFai = sProg.getUniVar( "isFai" ).getLoc();
@@ -105,11 +95,9 @@ void init()
 }
 
 
-/*
-=======================================================================================================================================
-runStage                                                                                                                              =
-=======================================================================================================================================
-*/
+//=====================================================================================================================================
+// runStage                                                                                                                           =
+//=====================================================================================================================================
 void runStage( const Camera& cam )
 {
 	if( R::Pps::Ssao::enabled )
@@ -136,7 +124,7 @@ void runStage( const Camera& cam )
 
 	if( R::Pps::Ssao::enabled )
 	{
-		sProg.locTexUnit( sProg.uniLocs.ppsSsaoFai, R::Pps::Ssao::bluredFai2, 1 );
+		sProg.locTexUnit( sProg.uniLocs.ppsSsaoFai, R::Pps::Ssao::fai, 1 );
 	}
 
 	if( R::Pps::edgeaa::enabled )

+ 3 - 3
src/renderer/Hdr.cpp → src/renderer/PpsHdr.cpp

@@ -82,13 +82,13 @@ void init()
 	initFbos( pass2Fbo, fai, GL_RGB );
 
 	// init shaders
-	pass0SProg.customLoad( "shaders/pps_hdr_generic.glsl", "#define _PPS_HDR_PASS_0_\n" );
+	pass0SProg.customLoad( "shaders/PpsHdr.glsl", "#define _PPS_HDR_PASS_0_\n" );
 	pass0SProg.uniLocs.fai = pass0SProg.uniLocs.fai;
 
-	pass1SProg.customLoad( "shaders/pps_hdr_generic.glsl", "#define _PPS_HDR_PASS_1_\n" );
+	pass1SProg.customLoad( "shaders/PpsHdr.glsl", "#define _PPS_HDR_PASS_1_\n" );
 	pass1SProg.uniLocs.fai = pass1SProg.uniLocs.fai;
 
-	pass2SProg.customLoad( "shaders/pps_hdr_generic.glsl", "#define _PPS_HDR_PASS_2_\n" );
+	pass2SProg.customLoad( "shaders/PpsHdr.glsl", "#define _PPS_HDR_PASS_2_\n" );
 	pass2SProg.uniLocs.fai = pass2SProg.uniLocs.fai;
 }
 

+ 1 - 1
src/renderer/Lscatt.cpp → src/renderer/PpsLscatt.cpp

@@ -61,7 +61,7 @@ void init()
 
 
 	// init shaders
-	sProg.customLoad( "shaders/pps_lscatt.glsl" );
+	sProg.customLoad( "shaders/PpsLscatt.glsl" );
 	msDepthFaiUniLoc = sProg.getUniVar( "msDepthFai" ).getLoc();
 	isFaiUniLoc = sProg.getUniVar( "isFai" ).getLoc();
 }

+ 50 - 50
src/renderer/Ssao.cpp → src/renderer/PpsSsao.cpp

@@ -19,70 +19,70 @@ namespace Ssao {
 VARS                                                                                                                                  =
 =======================================================================================================================================
 */
-static Fbo fbo, blurFbo, blurFbo2; // yet another FBO
+static Fbo pass0Fbo, pass1Fbo, pass2Fbo;
 
 float renderingQuality = 0.20; // the renderingQuality of the SSAO fai. Chose low so it can blend
 bool enabled = true;
 
 static uint wwidth, wheight; // window width and height
 
-Texture fai, bluredFai, bluredFai2; // SSAO factor
+Texture pass0Fai, pass1Fai, fai;
 
-static ShaderProg* ssaoSProg, * blurSProg, * blurSProg2;
+static ShaderProg ssaoSProg, blurSProg, blurSProg2;
 
 static Texture* noise_map;
 
 
 //=====================================================================================================================================
-// InitBlurFBO                                                                                                                        =
+// initBlurFbos                                                                                                                       =
 //=====================================================================================================================================
-static void InitBlurFBO()
+static void initBlurFbos()
 {
 	// create FBO
-	blurFbo.create();
-	blurFbo.bind();
+	pass1Fbo.create();
+	pass1Fbo.bind();
 
 	// inform in what buffers we draw
-	blurFbo.setNumOfColorAttachements(1);
+	pass1Fbo.setNumOfColorAttachements(1);
 
 	// create the texes
-	bluredFai.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
-	//bluredFai.texParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-	//bluredFai.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+	pass1Fai.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
+	pass1Fai.texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+	pass1Fai.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 
 	// attach
-	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, bluredFai.getGlId(), 0 );
+	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, pass1Fai.getGlId(), 0 );
 
 	// test if success
-	if( !blurFbo.isGood() )
+	if( !pass1Fbo.isGood() )
 		FATAL( "Cannot create deferred shading post-processing stage SSAO blur FBO" );
 
 	// unbind
-	blurFbo.unbind();
+	pass1Fbo.unbind();
 
 
 
 	// create FBO
-	blurFbo2.create();
-	blurFbo2.bind();
+	pass2Fbo.create();
+	pass2Fbo.bind();
 
 	// inform in what buffers we draw
-	blurFbo2.setNumOfColorAttachements(1);
+	pass2Fbo.setNumOfColorAttachements(1);
 
 	// create the texes
-	bluredFai2.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
-	bluredFai2.texParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
-	bluredFai2.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+	fai.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
+	fai.texParameter( GL_TEXTURE_MAG_FILTER, GL_LINEAR );
+	fai.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 
 	// attach
-	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, bluredFai2.getGlId(), 0 );
+	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fai.getGlId(), 0 );
 
 	// test if success
-	if( !blurFbo2.isGood() )
+	if( !pass2Fbo.isGood() )
 		FATAL( "Cannot create deferred shading post-processing stage SSAO blur FBO" );
 
 	// unbind
-	blurFbo2.unbind();
+	pass2Fbo.unbind();
 }
 
 
@@ -98,33 +98,33 @@ void init()
 	wheight = R::Pps::Ssao::renderingQuality * R::h;
 
 	// create FBO
-	fbo.create();
-	fbo.bind();
+	pass0Fbo.create();
+	pass0Fbo.bind();
 
 	// inform in what buffers we draw
-	fbo.setNumOfColorAttachements(1);
+	pass0Fbo.setNumOfColorAttachements(1);
 
 	// create the texes
-	fai.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
-	//fai.texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
-	//fai.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
+	pass0Fai.createEmpty2D( wwidth, wheight, GL_ALPHA8, GL_ALPHA );
+	pass0Fai.texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
+	pass0Fai.texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
 
 	// attach
-	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, fai.getGlId(), 0 );
+	glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, pass0Fai.getGlId(), 0 );
 
 	// test if success
-	if( !fbo.isGood() )
+	if( !pass0Fbo.isGood() )
 		FATAL( "Cannot create deferred shading post-processing stage SSAO pass FBO" );
 
 	// unbind
-	fbo.unbind();
+	pass0Fbo.unbind();
 
 
 	// init shaders
-	ssaoSProg = rsrc::shaders.load( "shaders/pps_ssao.glsl" );
+	ssaoSProg.customLoad( "shaders/PpsSsao.glsl" );
 
 	// load noise map and disable temporaly the texture compression and enable mipmaping
-	bool tex_compr = R::textureCompression;
+	bool texCompr = R::textureCompression;
 	bool mipmaping = R::mipmaping;
 	R::textureCompression = false;
 	R::mipmaping = true;
@@ -133,13 +133,13 @@ void init()
 	noise_map->texParameter( GL_TEXTURE_WRAP_T, GL_REPEAT );
 	//noise_map->texParameter( GL_TEXTURE_MAG_FILTER, GL_NEAREST );
 	//noise_map->texParameter( GL_TEXTURE_MIN_FILTER, GL_NEAREST );
-	R::textureCompression = tex_compr;
+	R::textureCompression = texCompr;
 	R::mipmaping = mipmaping;
 
 	// blur FBO
-	InitBlurFBO();
-	blurSProg = rsrc::shaders.load( "shaders/pps_ssao_blur.glsl" );
-	blurSProg2 = rsrc::shaders.load( "shaders/pps_ssao_blur2.glsl" );
+	initBlurFbos();
+	blurSProg.customLoad( "shaders/PpsSsaoBlur.glsl", "#define _PPS_SSAO_PASS_0_\n" );
+	blurSProg2.customLoad( "shaders/PpsSsaoBlur.glsl", "#define _PPS_SSAO_PASS_1_\n" );
 }
 
 
@@ -150,7 +150,7 @@ runPass
 */
 void runPass( const Camera& cam )
 {
-	fbo.bind();
+	pass0Fbo.bind();
 
 	R::setViewport( 0, 0, wwidth, wheight );
 
@@ -158,24 +158,24 @@ void runPass( const Camera& cam )
 	glDisable( GL_DEPTH_TEST );
 
 	// fill SSAO FAI
-	ssaoSProg->bind();
-	glUniform2fv( ssaoSProg->getUniVar("camerarange").getLoc(), 1, &(Vec2(cam.getZNear(), cam.getZFar()))[0] );
-	ssaoSProg->locTexUnit( ssaoSProg->getUniVar("msDepthFai").getLoc(), R::Ms::depthFai, 0 );
-	ssaoSProg->locTexUnit( ssaoSProg->getUniVar("noiseMap").getLoc(), *noise_map, 1 );
-	ssaoSProg->locTexUnit( ssaoSProg->getUniVar("msNormalFai").getLoc(), R::Ms::normalFai, 2 );
+	ssaoSProg.bind();
+	glUniform2fv( ssaoSProg.getUniVar("camerarange").getLoc(), 1, &(Vec2(cam.getZNear(), cam.getZFar()))[0] );
+	ssaoSProg.locTexUnit( ssaoSProg.getUniVar("msDepthFai").getLoc(), R::Ms::depthFai, 0 );
+	ssaoSProg.locTexUnit( ssaoSProg.getUniVar("noiseMap").getLoc(), *noise_map, 1 );
+	ssaoSProg.locTexUnit( ssaoSProg.getUniVar("msNormalFai").getLoc(), R::Ms::normalFai, 2 );
 	R::DrawQuad( 0 ); // Draw quad
 
 
 	// second pass. blur
-	blurFbo.bind();
-	blurSProg->bind();
-	blurSProg->locTexUnit( blurSProg->getUniVar("tex").getLoc(), fai, 0 );
+	pass1Fbo.bind();
+	blurSProg.bind();
+	blurSProg.locTexUnit( blurSProg.getUniVar("tex").getLoc(), pass0Fai, 0 );
 	R::DrawQuad( 0 ); // Draw quad
 
 	// third pass. blur
-	blurFbo2.bind();
-	blurSProg2->bind();
-	blurSProg2->locTexUnit( blurSProg2->getUniVar("tex").getLoc(), bluredFai, 0 );
+	pass2Fbo.bind();
+	blurSProg2.bind();
+	blurSProg2.locTexUnit( blurSProg2.getUniVar("tex").getLoc(), pass1Fai, 0 );
 	R::DrawQuad( 0 ); // Draw quad
 
 

+ 2 - 2
src/renderer/Renderer.h

@@ -125,9 +125,9 @@ namespace Pps
 		extern bool enabled;
 		extern void init();
 		extern void runPass( const Camera& cam );
+		extern Texture pass0Fai;
+		extern Texture pass1Fai;
 		extern Texture fai;
-		extern Texture bluredFai;
-		extern Texture bluredFai2;
 		extern float renderingQuality;
 	}