diff --git a/testbed/common/Box.cpp b/testbed/common/Box.cpp index 1111f083..dc5e9d94 100644 --- a/testbed/common/Box.cpp +++ b/testbed/common/Box.cpp @@ -188,6 +188,8 @@ Box::Box(const openglframework::Vector3& size, const openglframework::Vector3& p rp3d::Quaternion initOrientation = rp3d::Quaternion::identity(); rp3d::Transform transform(initPosition, initOrientation); + mPreviousTransform = transform; + // Create a rigid body in the dynamics world rp3d::RigidBody* body = world->createRigidBody(transform); diff --git a/testbed/scenes/cubes/CubesScene.cpp b/testbed/scenes/cubes/CubesScene.cpp index 0898801f..c4652972 100644 --- a/testbed/scenes/cubes/CubesScene.cpp +++ b/testbed/scenes/cubes/CubesScene.cpp @@ -129,7 +129,6 @@ CubesScene::~CubesScene() { // Update the physics world (take a simulation step) void CubesScene::updatePhysics() { - // Update the physics engine parameters mDynamicsWorld->setIsGratityEnabled(mEngineSettings.isGravityEnabled); rp3d::Vector3 gravity(mEngineSettings.gravity.x, mEngineSettings.gravity.y, diff --git a/testbed/shaders/phong.frag b/testbed/shaders/phong.frag index cbf7f0e4..73c76ba6 100644 --- a/testbed/shaders/phong.frag +++ b/testbed/shaders/phong.frag @@ -69,7 +69,6 @@ void main() { float diffuseFactor = max(dot(N, L0), 0.0); vec3 diffuse = light0DiffuseColor * diffuseFactor * textureColor; - // Compute shadow factor float shadow = 1.0; if (isShadowEnabled) { @@ -80,7 +79,6 @@ void main() { shadowMapUV.z -= shadowBias; vec4 shadowMapCoordsOverW = shadowMapUV / shadowMapUV.w; - /* // PCF Shadow Mapping for (float i=-1; i<=1; i++) { for (float j=-1; j<=1; j++) { @@ -91,14 +89,13 @@ void main() { } } shadow /= 9.0; - */ - + /* float distanceInShadowMap = texture(shadowMapSampler, shadowMapCoordsOverW.xy).r + bias; if (shadowMapCoords.w > 0) { shadow = distanceInShadowMap < shadowMapCoordsOverW.z ? 0.5 : 1.0; } - + */ } // Compute the final color diff --git a/testbed/src/SceneDemo.cpp b/testbed/src/SceneDemo.cpp index 596644a9..7fe881b9 100644 --- a/testbed/src/SceneDemo.cpp +++ b/testbed/src/SceneDemo.cpp @@ -166,7 +166,7 @@ void SceneDemo::render() { mPhongShader.setVector3Uniform("light0DiffuseColor", Vector3(diffCol.r, diffCol.g, diffCol.b)); mPhongShader.setIntUniform("shadowMapSampler", textureUnit); mPhongShader.setIntUniform("isShadowEnabled", mIsShadowMappingEnabled); - //mPhongShader.setVector2Uniform("shadowMapDimension", Vector2(SHADOWMAP_WIDTH, SHADOWMAP_HEIGHT)); + mPhongShader.setVector2Uniform("shadowMapDimension", Vector2(SHADOWMAP_WIDTH, SHADOWMAP_HEIGHT)); // Set the viewport to render the scene glViewport(mViewportX, mViewportY, mViewportWidth, mViewportHeight);