Merge branch 'master' of github.com:Faerbit/swp

This commit is contained in:
Jasper 2015-03-09 15:46:10 +01:00
commit a78d97e3e1
8 changed files with 24 additions and 22 deletions

View File

@ -3,7 +3,7 @@ CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
add_subdirectory(converter) add_subdirectory(converter)
# project/binary name: # project/binary name:
PROJECT(MarbleRaceGroupC) PROJECT(saxum)
# ACGL setup # ACGL setup
SET(ACGL_OPENGL_SUPPORT CORE_32) 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) SET (LIBRARIES ${LIBRARIES} ${CMAKE_SOURCE_DIR}/extern/lua/src/liblua.a)
ADD_EXECUTABLE(MarbleRaceGroupC ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES}) ADD_EXECUTABLE(saxum ${SOURCE_FILES} ${HEADER_FILES} ${SHADER_FILES} ${README_FILES})
TARGET_LINK_LIBRARIES(MarbleRaceGroupC ${LIBRARIES} ${CMAKE_DL_LIBS}) TARGET_LINK_LIBRARIES(saxum ${LIBRARIES} ${CMAKE_DL_LIBS})

View File

@ -13057,23 +13057,23 @@
</ambientLight> </ambientLight>
<fogColourDay> <fogColourDay>
<rColour>0.10</rColour> <rColour>0.57</rColour>
<gColour>0.14</gColour> <gColour>0.80</gColour>
<bColour>0.14</bColour> <bColour>0.98</bColour>
<alpha>1.0</alpha> <alpha>1.0</alpha>
</fogColourDay> </fogColourDay>
<fogColourRise> <fogColourRise>
<rColour>0.60</rColour> <rColour>0.88</rColour>
<gColour>0.14</gColour> <gColour>0.38</gColour>
<bColour>0.14</bColour> <bColour>0.38</bColour>
<alpha>1.0</alpha> <alpha>1.0</alpha>
</fogColourRise> </fogColourRise>
<fogColourNight> <fogColourNight>
<rColour>0.05</rColour> <rColour>0.09</rColour>
<gColour>0.07</gColour> <gColour>0.1</gColour>
<bColour>0.34</bColour> <bColour>0.24</bColour>
<alpha>1.0</alpha> <alpha>1.0</alpha>
</fogColourNight> </fogColourNight>

View File

@ -7,7 +7,7 @@ function trigger(objectToChange)
return return
end end
local maxTimeDiff = 20 local maxTimeDiff = 30
local timeDiff = os.clock()- global.sunStartTime local timeDiff = os.clock()- global.sunStartTime
if(timeDiff > maxTimeDiff)then if(timeDiff > maxTimeDiff)then
timeDiff = maxTimeDiff timeDiff = maxTimeDiff

View File

@ -92,11 +92,11 @@ vec4 fogColor(float dot) {
if(dot<0.0) { if(dot<0.0) {
dayFactor = 0.0; dayFactor = 0.0;
} }
else if(dot>0.51) { else if(dot>1.0) {
dayFactor = 1.0; dayFactor = 1.0;
} }
else { else {
dayFactor = sin(3*dot); dayFactor = sin(1.5*dot);
} }
if (dot <0.0) { if (dot <0.0) {
return mix(fogColorNight, fogColorRise, riseFactor); return mix(fogColorNight, fogColorRise, riseFactor);
@ -155,7 +155,7 @@ void main()
if(length(directionalLightVector)>0.0f) { if(length(directionalLightVector)>0.0f) {
vec3 directionalVector = normalize(directionalLightVector); vec3 directionalVector = normalize(directionalLightVector);
sunAngle = dot(vec3(0.0, 1.0, 0.0), directionalVector); sunAngle = dot(vec3(0.0, 1.0, 0.0), directionalVector);
if ( sunAngle > -0.5) { if ( sunAngle > -0.7) {
float directionalVisibility = 1.0f; float directionalVisibility = 1.0f;
if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) { if (distanceToBorder(shadowCoord1.xy) <= 0.5 && distanceToBorder(shadowCoord1.xy) > 0.2) {
if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) { if (distanceToBorder(shadowCoord0.xy) <= 0.5 && distanceToBorder(shadowCoord0.xy) > 0.2) {

View File

@ -35,11 +35,11 @@ vec4 fogColor(float dot) {
if(dot<0.0) { if(dot<0.0) {
dayFactor = 0.0; dayFactor = 0.0;
} }
else if(dot>0.77) { else if(dot>1.0) {
dayFactor = 1.0; dayFactor = 1.0;
} }
else { else {
dayFactor = sin(2*dot); dayFactor = sin(1.5*dot);
} }
if (dot <0.0) { if (dot <0.0) {
return mix(fogColorNight, fogColorRise, riseFactor); return mix(fogColorNight, fogColorRise, riseFactor);

View File

@ -348,7 +348,7 @@ void Graphics::render(double time)
for (unsigned int i = 0; i<framebuffer_directional.size(); i++) { for (unsigned int i = 0; i<framebuffer_directional.size(); i++) {
framebuffer_directional.at(i)->bind(); framebuffer_directional.at(i)->bind();
glClear(GL_DEPTH_BUFFER_BIT); glClear(GL_DEPTH_BUFFER_BIT);
if (sunAngle > -0.5f) { if (sunAngle > -0.7f) {
float projection_size = 0.0f; float projection_size = 0.0f;
switch(i) { switch(i) {
case 0: case 0:

View File

@ -19,8 +19,8 @@ Level::~Level() {
} }
for(unsigned int i = 0; i<objects.size(); i++) { for(unsigned int i = 0; i<objects.size(); i++) {
delete(objects.at(i)); delete(objects.at(i));
delete(waterPlane);
} }
delete(waterPlane);
} }
void Level::load() { void Level::load() {
@ -60,12 +60,14 @@ void Level::render(ACGL::OpenGL::SharedShaderProgram shader, bool lightingPass,
for(unsigned int i = 0; i<objects.size(); i++) { for(unsigned int i = 0; i<objects.size(); i++) {
if (lightingPass) { if (lightingPass) {
objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs); objects.at(i)->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
waterPlane->render(shader, lightingPass, true, viewProjectionMatrix, shadowVPs);
} }
else { else {
objects.at(i)->render(shader, lightingPass, false, viewProjectionMatrix, shadowVPs); 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) { void Level::update(float runTimeSinceLastUpdate, float runTime, glm::vec2 mouseDelta, bool wPressed, bool aPressed, bool sPressed, bool dPressed,bool kPressed, bool lPressed) {

2
run.sh
View File

@ -2,5 +2,5 @@
if ./build.sh if ./build.sh
then then
cd binaries; ./MarbleRaceGroupC cd binaries; ./saxum
fi fi