Modifications in testbed application

This commit is contained in:
Daniel Chappuis 2015-08-11 22:28:16 +02:00
parent 06e68baa39
commit bd3fc98fba
4 changed files with 5 additions and 7 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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

View File

@ -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);