From 251048bbd0e78d8ed7d61e13b4c7c5f8fb8a9189 Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 9 Mar 2015 13:58:48 +0100 Subject: [PATCH 1/9] modified starting sunhight + sunrise functions --- data/levels/Level1.xml | 2 +- data/levels/scripts/sunUpdate.lua | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/data/levels/Level1.xml b/data/levels/Level1.xml index ebde9c3..ded32c5 100644 --- a/data/levels/Level1.xml +++ b/data/levels/Level1.xml @@ -13079,7 +13079,7 @@ -1.0 - 1.5 + -6 1.0 1.0 1.0 diff --git a/data/levels/scripts/sunUpdate.lua b/data/levels/scripts/sunUpdate.lua index 9160ad9..4bddcd1 100644 --- a/data/levels/scripts/sunUpdate.lua +++ b/data/levels/scripts/sunUpdate.lua @@ -13,9 +13,16 @@ function trigger(objectToChange) timeDiff = maxTimeDiff end timeDiff = timeDiff/maxTimeDiff - local x = 1 - 0.3 * timeDiff - local y = math.sqrt(timeDiff) * 1.0 - 0.1 - local z = 0.7 * timeDiff + local x = 10 + local y = -18 + math.sqrt(timeDiff) * 29 + local z = -8 + timeDiff * 15 level:setSunDirection(x,y,z) end end + + + --local x = 0.7 + 0.3 * timeDiff + --local y = math.sqrt(timeDiff) * 2.2 - 1.5 + --local z = -0.7 - 0.7 * timeDiff + --start 1,-6,-2 + --ziel 10,10,10 From 95de9295e7045d173828570df0308db39a9edece Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 9 Mar 2015 14:40:29 +0100 Subject: [PATCH 2/9] reduced shadow amount --- data/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/config.xml b/data/config.xml index b389f19..8fc6972 100644 --- a/data/config.xml +++ b/data/config.xml @@ -7,7 +7,7 @@ 150.0 -10 +5 data/levels/Compositions.xml From c2d669e5b39b1f60ec98eb51f9bf2444399c96e1 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 14:59:22 +0100 Subject: [PATCH 3/9] Fixing waterPlane not being rendered last, leading to incorrect alpha. --- level.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/level.cc b/level.cc index f9abdcb..ec7eaf7 100644 --- a/level.cc +++ b/level.cc @@ -19,8 +19,8 @@ Level::~Level() { } for(unsigned int i = 0; irender(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); - waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); } else { objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs); } } + if (lightingPass) { + waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); + } } void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) { From 0a75dd030a988d707a84df2e3cb168848bce4e00 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 15:16:18 +0100 Subject: [PATCH 4/9] Chaging executable name to game name. --- CMakeLists.txt | 6 +++--- run.sh | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index caf8bbb..0ccb164 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6) add_subdirectory(converter) # project/binary name: -PROJECT(MarbleRaceGroupC) +PROJECT(saxum) # ACGL setup SET(ACGL_OPENGL_SUPPORT CORE_32) @@ -146,5 +146,5 @@ SET(HEADER_FILES ${HEADER_FILES} ${HEADER_FILES_LUA_BRIDGE}) SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/lua/src/liblua.a) -ADD_EXECUTABLE(MarbleRaceGroupC ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES}) -TARGET_LINK_LIBRARIES(MarbleRaceGroupC ${LIBRARIES} ${CMAKE_DL_LIBS}) +ADD_EXECUTABLE(saxum ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES}) +TARGET_LINK_LIBRARIES(saxum ${LIBRARIES} ${CMAKE_DL_LIBS}) diff --git a/run.sh b/run.sh index 8bd84f1..43fe41a 100755 --- a/run.sh +++ b/run.sh @@ -2,5 +2,5 @@ if ./build.sh then - cd binaries; ./MarbleRaceGroupC + cd binaries; ./saxum fi From abb8c981bc2f49140724f6ee15eb0573b8fde5d2 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 15:43:12 +0100 Subject: [PATCH 5/9] Changed a few parameters corresponding with the sunrise. --- data/levels/Level1.xml | 18 +++++++++--------- data/shader/phong.fsh | 6 +++--- data/shader/skydome.fsh | 4 ++-- graphics.cc | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/data/levels/Level1.xml b/data/levels/Level1.xml index 01de205..09f77db 100644 --- a/data/levels/Level1.xml +++ b/data/levels/Level1.xml @@ -13057,23 +13057,23 @@ - 0.10 - 0.14 - 0.14 + 0.57 + 0.80 + 0.98 1.0 - 0.60 - 0.14 - 0.14 + 0.88 + 0.38 + 0.38 1.0 - 0.05 - 0.07 - 0.34 + 0.09 + 0.1 + 0.24 1.0 diff --git a/data/shader/phong.fsh b/data/shader/phong.fsh index 507e19a..7562e38 100644 --- a/data/shader/phong.fsh +++ b/data/shader/phong.fsh @@ -92,11 +92,11 @@ vec4 fogColor(float dot) { if(dot<0.0) { dayFactor = 0.0; } - else if(dot>0.51) { + else if(dot>1.0) { dayFactor = 1.0; } else { - dayFactor = sin(3*dot); + dayFactor = sin(1.5*dot); } if (dot <0.0) { return mix(fogColorNight, fogColorRise, riseFactor); @@ -155,7 +155,7 @@ void main() if(length(directionalLightVector)>0.0f) { vec3 directionalVector = normalize(directionalLightVector); sunAngle = dot(vec3(0.0, 1.0, 0.0), directionalVector); - if ( sunAngle > -0.5) { + if ( sunAngle > -0.7) { float directionalVisibility = 1.0f; if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) { if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) { diff --git a/data/shader/skydome.fsh b/data/shader/skydome.fsh index ce5174e..45f2e81 100644 --- a/data/shader/skydome.fsh +++ b/data/shader/skydome.fsh @@ -35,11 +35,11 @@ vec4 fogColor(float dot) { if(dot<0.0) { dayFactor = 0.0; } - else if(dot>0.77) { + else if(dot>1.0) { dayFactor = 1.0; } else { - dayFactor = sin(2*dot); + dayFactor = sin(1.5*dot); } if (dot <0.0) { return mix(fogColorNight, fogColorRise, riseFactor); diff --git a/graphics.cc b/graphics.cc index acf473f..f860c90 100644 --- a/graphics.cc +++ b/graphics.cc @@ -348,7 +348,7 @@ void Graphics::render(double time) for (unsigned int i = 0; ibind(); glClear(GL_DEPTH_BUFFER_BIT); - if (sunAngle > -0.5f) { + if (sunAngle > -0.7f) { float projection_size = 0.0f; switch(i) { case 0: From f3887390a919b8f08291ac7d956ff09903733ce6 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 15:43:44 +0100 Subject: [PATCH 6/9] Made sunrise last longer. --- data/levels/scripts/sunUpdate.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/levels/scripts/sunUpdate.lua b/data/levels/scripts/sunUpdate.lua index 4bddcd1..ef7b2d2 100644 --- a/data/levels/scripts/sunUpdate.lua +++ b/data/levels/scripts/sunUpdate.lua @@ -7,7 +7,7 @@ function trigger(objectToChange) return end - local maxTimeDiff = 20 + local maxTimeDiff = 30 local timeDiff = os.clock()- global.sunStartTime if(timeDiff > maxTimeDiff)then timeDiff = maxTimeDiff From caf5d3cf2239b8606d204fc8d937547ec84adb92 Mon Sep 17 00:00:00 2001 From: Jasper Date: Mon, 9 Mar 2015 15:45:49 +0100 Subject: [PATCH 7/9] changed ambient factors --- data/levels/Compositions.xml | 24 ++++++++++++------------ data/levels/Level1.xml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/data/levels/Compositions.xml b/data/levels/Compositions.xml index 443a8e1..3dd1df3 100644 --- a/data/levels/Compositions.xml +++ b/data/levels/Compositions.xml @@ -540,7 +540,7 @@ marbleSmooth.obj marbleTexture.png - 0.1 + 0.13 0.5 0.5 3.0 @@ -555,7 +555,7 @@ block.obj blockTexture_small.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -571,7 +571,7 @@ column.obj columnTexture2.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -584,7 +584,7 @@ torch.obj torchTexture2.png - 0.1 + 0.13 0.3 0.7 10.0 @@ -598,7 +598,7 @@ switchInner.obj switchInnerTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -626,7 +626,7 @@ switchOuter.obj switchOuterTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -638,7 +638,7 @@ simpleWall.obj simpleWallTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -654,7 +654,7 @@ gate.obj gateTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -670,7 +670,7 @@ movableBlock.obj movableBlockTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -686,7 +686,7 @@ brazier.obj brazierTexture.png - 0.1 + 0.13 0.6 0.4 1.0 @@ -699,7 +699,7 @@ hint.obj hintTexture.png - 0.1 + 0.13 0.6 0.4 2.0 @@ -712,7 +712,7 @@ exit.obj exitTexture.png - 0.1 + 0.13 0.6 0.4 2.0 diff --git a/data/levels/Level1.xml b/data/levels/Level1.xml index 01de205..d8f4bc1 100644 --- a/data/levels/Level1.xml +++ b/data/levels/Level1.xml @@ -13089,7 +13089,7 @@ seamlessTerrain.png - 0.1 + 0.13 0.8 0.2 3.0 From 7ef0fddd1f4ccdb2095141c873a14b3b08a12bc7 Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 16:00:07 +0100 Subject: [PATCH 8/9] Changed how fast the marble is dying and spawning. --- physics.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics.cc b/physics.cc index b984192..17bca66 100644 --- a/physics.cc +++ b/physics.cc @@ -85,7 +85,7 @@ void Physics::takeUpdateStep(float timeDiff) if(sinking) { btVector3 currentPos = playerBall->getCenterOfMassPosition(); - currentPos -= btVector3(0,0.35f*timeDiff,0); + currentPos -= btVector3(0,0.8f*timeDiff,0); float damp = playerBall->getAngularDamping(); playerBall->setDamping(playerBall->getLinearDamping(),0.9); world->stepSimulation(timeDiff); @@ -106,7 +106,7 @@ void Physics::takeUpdateStep(float timeDiff) else { btVector3 currentPos = playerBall->getCenterOfMassPosition(); - currentPos += btVector3(0,0.9f*timeDiff,0); + currentPos += btVector3(0,3.0f*timeDiff,0); world->stepSimulation(timeDiff); playerBall->setCenterOfMassTransform(btTransform(playerBall->getOrientation(),currentPos)); cameraBody->setCenterOfMassTransform(btTransform(btQuaternion(0,0,0,1),camPos)); From 3ae3c84a39fca735c46418a3a8850b51c1026b4b Mon Sep 17 00:00:00 2001 From: Fabian Klemp Date: Mon, 9 Mar 2015 16:01:03 +0100 Subject: [PATCH 9/9] Changed a few material parameters. --- data/levels/Compositions.xml | 8 ++++---- data/levels/Level1.xml | 2 +- loader.cc | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/data/levels/Compositions.xml b/data/levels/Compositions.xml index 3dd1df3..491c720 100644 --- a/data/levels/Compositions.xml +++ b/data/levels/Compositions.xml @@ -629,7 +629,7 @@ 0.13 0.6 0.4 - 2.0 + 1.0 None true @@ -641,7 +641,7 @@ 0.13 0.6 0.4 - 2.0 + 1.0 Box 1.2 6 @@ -702,7 +702,7 @@ 0.13 0.6 0.4 - 2.0 + 1.0 TriangleMesh 0.555 0.5 @@ -715,7 +715,7 @@ 0.13 0.6 0.4 - 2.0 + 1.0 TriangleMesh 0.555 0.5 diff --git a/data/levels/Level1.xml b/data/levels/Level1.xml index 74c5b5f..7c87d8f 100644 --- a/data/levels/Level1.xml +++ b/data/levels/Level1.xml @@ -13092,7 +13092,7 @@ 0.13 0.8 0.2 - 3.0 + 1.0 diff --git a/loader.cc b/loader.cc index e2a3bf6..4a8ee97 100644 --- a/loader.cc +++ b/loader.cc @@ -145,7 +145,7 @@ void Loader::load(std::string filePath, Level* level, std::string compositionsPa water_vao->bind(); water_vao->setMode(GL_TRIANGLES); water_vao->attachAllAttributes(water_ab); - Material water_material = Material(waterTexture, 0.1f, 0.2f, 0.8f, 5.0f, true); + Material water_material = Material(waterTexture, 0.13f, 0.5f, 0.5f, 10.0f, true); Object* water_object = new Object(water_vao, water_material, glm::vec3(0.0f, 0.0f, 0.0f), glm::vec3(0.0f, 0.0f, 0.0f), true); level->setWaterPlane(water_object); }