2
0
Panagiotis Christopoulos Charitos 16 жил өмнө
parent
commit
356de235cb

+ 3 - 3
shaders/PpsSsaoBlur.glsl

@@ -17,11 +17,11 @@ void main()
 	#else
 		float offset = 1.0 / float(textureSize(tex,0).y);
 	#endif
-	const int KERNEL_SIZE = 5;
+	const int KERNEL_SIZE = 7;
 	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,
+	                                     -2.0 * offset, 2.0 * offset,
+																			 -3.0 * offset, 3.0 * offset/*,
 																			 -4.0 * offset, 4.0 * offset*/ );
 
 	float factor = 0.0;

+ 0 - 27
shaders/PpsSsaoBlur2.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).y);
-	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(0.0, kernel[i]) ).a;
-	}
-	gl_FragData[0].a = factor / KERNEL_SIZE;
-}

+ 16 - 16
src/Main.cpp

@@ -38,7 +38,7 @@ App* app;
 
 // map (hard coded)
 Camera* mainCam;
-MeshNode* floor__,* sarge,* horse;
+MeshNode* floor__,* sarge,* horse,* crate;
 SkelModelNode* imp;
 PointLight* point_lights[10];
 SpotLight* spot_lights[2];
@@ -66,9 +66,9 @@ btSequentialImpulseConstraintSolver* sol;
 btDiscreteDynamicsWorld* dynamicsWorld;
 BulletDebuger debugDrawer;
 
-#define ARRAY_SIZE_X 1
-#define ARRAY_SIZE_Y 1
-#define ARRAY_SIZE_Z 1
+#define ARRAY_SIZE_X 5
+#define ARRAY_SIZE_Y 5
+#define ARRAY_SIZE_Z 5
 
 #define MAX_PROXIES (ARRAY_SIZE_X*ARRAY_SIZE_Y*ARRAY_SIZE_Z + 1024)
 
@@ -148,7 +148,10 @@ void initPhysics()
 
 
 					//using motionstate is recommended, it provides interpolation capabilities, and only synchronizes 'active' objects
-					MotionState* myMotionState = new MotionState(startTransform, floor__);
+					MeshNode* crate = new MeshNode;
+					crate->init( "models/crate0/crate0.mesh" );
+					crate->scaleLspace = 1.11;
+					MotionState* myMotionState = new MotionState(startTransform, crate);
 					btRigidBody::btRigidBodyConstructionInfo rbInfo(mass,myMotionState,colShape,localInertia);
 					btRigidBody* body = new btRigidBody(rbInfo);
 
@@ -174,8 +177,6 @@ void init()
 {
 	PRINT( "Engine initializing..." );
 
-	initPhysics();
-
 	srand( unsigned(time(NULL)) );
 	mathSanityChecks();
 
@@ -232,9 +233,9 @@ void init()
 	imp->meshNodes[0]->meshSkelCtrl->skelNode->skelAnimCtrl->step = 0.8;
 
 	// crate
-	MeshNode* crate = new MeshNode;
+	/*crate = new MeshNode;
 	crate->init( "models/crate0/crate0.mesh" );
-	crate->scaleLspace = 1.0;
+	crate->scaleLspace = 1.0;*/
 
 
 	//
@@ -245,8 +246,10 @@ void init()
 																	 "textures/env/hellsky4_right.tga", "textures/env/hellsky4_up.tga", "textures/env/hellsky4_down.tga" };
 	app->scene->skybox.load( skybox_fnames );
 
+
+	initPhysics();
+
 	PRINT( "Engine initialization ends (" << App::getTicks()-ticks << ")" );
-	cerr.flush();
 }
 
 
@@ -335,12 +338,9 @@ int main( int /*argc*/, char* /*argv*/[] )
 		if( I::keys[SDLK_F11] ) app->togleFullScreen();
 		if( I::keys[SDLK_F12] == 1 ) R::takeScreenshot("gfx/screenshot.jpg");
 
-		/*char str[128];
-		if( R::framesNum < 1000 )
-			sprintf( str, "capt/%06d.jpg", R::framesNum );
-		else
-			sprintf( str, "capt2/%06d.jpg", R::framesNum );
-		R::takeScreenshot(str);*/
+		char str[128];
+		sprintf( str, "capt/%06d.jpg", R::framesNum );
+		R::takeScreenshot(str);
 
 		// std stuff follow
 		SDL_GL_SwapBuffers();

+ 3 - 1
src/Physics/MotionState.h

@@ -19,7 +19,9 @@ class MotionState: public btMotionState
 		MotionState( const btTransform& initialPos, Node* node_ ):
 			mPos1( initialPos ),
 			node( node_ )
-		{}
+		{
+			DEBUG_ERR( node_==NULL );
+		}
 
 		virtual ~MotionState()
 		{}

+ 1 - 1
src/Renderer/PpsSsao.cpp

@@ -21,7 +21,7 @@ VARS
 */
 static Fbo pass0Fbo, pass1Fbo, pass2Fbo;
 
-float renderingQuality = 0.20; // the renderingQuality of the SSAO fai. Chose low so it can blend
+float renderingQuality = 1.0; // the renderingQuality of the SSAO fai. Chose low so it can blend
 bool enabled = true;
 
 static uint wwidth, wheight; // window width and height

+ 1 - 1
src/Util/App.cpp

@@ -11,7 +11,7 @@ App::App()
 	activeCam = NULL;
 
 	windowW = 1280;
-	windowH = 800;
+	windowH = 720;
 
 	timerTick = 1000/40; // in ms. 1000/Hz
 	uint time = 0;