From 9dd46b67557766041f044638331bef3a04fec972 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 1 Dec 2014 11:41:14 +1100 Subject: [PATCH 01/40] Try to copy the animated kart mesh. --- src/graphics/irr_driver.cpp | 58 +++++++++++++++++++++++++++++++++++++ src/graphics/irr_driver.hpp | 1 + src/karts/kart_model.cpp | 7 +++-- 3 files changed, 63 insertions(+), 3 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index ffeb1f93c..e795fba23 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -67,6 +67,7 @@ #include "utils/vs.hpp" #include +#include "../lib/irrlicht/source/Irrlicht/CSkinnedMesh.h" /* Build-time check that the Irrlicht we're building against works for us. * Should help prevent distros building against an incompatible library. @@ -1000,6 +1001,63 @@ scene::IMesh *IrrDriver::getMesh(const std::string &filename) return am->getMesh(0); } // getMesh +// ---------------------------------------------------------------------------- +/** Create a skinned mesh which has copied all meshbuffers and joints of the + * original mesh. Note, that this will not copy any other information like + * joints data. + * \param mesh Original mesh + * \return Newly created skinned mesh. You should call drop() when you don't + * need it anymore. + */ +scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig) +{ + using namespace scene; + CSkinnedMesh *mesh = dynamic_cast(orig); + if (!mesh) + { + Log::error("copyAnimatedMesh", "Given mesh was not a skinned mesh."); + return NULL; + } + + ISkinnedMesh* skinned_mesh = m_scene_manager->createSkinnedMesh(); + + for (u32 i = 0; i < mesh->getMeshBuffers().size(); i++) + { + SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); + *buffer = *(mesh->getMeshBuffers()[i]); + } + + for (u32 j = 0; j < mesh->getAllJoints().size(); ++j) + { + ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); + *joint = *(mesh->getAllJoints()[j]); + } + + // fix children pointers (they still have old pointers) + core::array & new_joints = skinned_mesh->getAllJoints(); + core::array & old_joints = mesh->getAllJoints(); + for (u32 i = 0; i < new_joints.size(); ++i) + { + ISkinnedMesh::SJoint * joint = new_joints[i]; + for (u32 c = 0; c < joint->Children.size(); ++c) + { + // the child is one of the oldJoints and must be replaced by the newjoint on the same index + for (u32 k = 0; k < old_joints.size(); ++k) + { + if (joint->Children[c] == old_joints[k]) + { + joint->Children[c] = new_joints[k]; + break; + } + } // k < old_joints.size + } // c < joint->Children.size() + } // i < new_joints.size() + + skinned_mesh->finalize(); + + return skinned_mesh; +} // copyAnimatedMesh + // ---------------------------------------------------------------------------- /** Sets the material flags in this mesh depending on the settings in * material_manager. diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index e4f3c201f..75de00d89 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -457,6 +457,7 @@ public: void setAllMaterialFlags(scene::IMesh *mesh) const; scene::IAnimatedMesh *getAnimatedMesh(const std::string &name); scene::IMesh *getMesh(const std::string &name); + scene::IAnimatedMesh *copyAnimatedMesh(scene::IAnimatedMesh *orig); video::ITexture *applyMask(video::ITexture* texture, const std::string& mask_path); void displayFPS(); diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index b6965ca0f..0d18fc89e 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -260,7 +260,7 @@ KartModel::~KartModel() #endif } // ~KartModel - + // ---------------------------------------------------------------------------- /** This function returns a copy of this object. The memory is allocated * here, but needs to be managed (esp. freed) by the calling function. @@ -280,7 +280,7 @@ KartModel* KartModel::makeCopy() km->m_kart_height = m_kart_height; km->m_kart_highest_point= m_kart_highest_point; km->m_kart_lowest_point = m_kart_lowest_point; - km->m_mesh = m_mesh; + km->m_mesh = irr_driver->copyAnimatedMesh(m_mesh); km->m_model_filename = m_model_filename; km->m_animation_speed = m_animation_speed; km->m_current_animation = AF_DEFAULT; @@ -894,7 +894,8 @@ void KartModel::update(float dt, float rotation_dt, float steer, float speed) m_animated_node->setCurrentFrame(frame); } // update //----------------------------------------------------------------------------- -void KartModel::attachHat(){ +void KartModel::attachHat() +{ m_hat_node = NULL; if(m_hat_name.size()>0) { From c3f5294c27c166006210a534796fe6f54d05c0a1 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 1 Dec 2014 12:00:43 +1100 Subject: [PATCH 02/40] Changed line endings. --- src/graphics/irr_driver.cpp | 104 ++++++++++++++++++------------------ 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index e795fba23..f10627175 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1002,60 +1002,60 @@ scene::IMesh *IrrDriver::getMesh(const std::string &filename) } // getMesh // ---------------------------------------------------------------------------- -/** Create a skinned mesh which has copied all meshbuffers and joints of the - * original mesh. Note, that this will not copy any other information like - * joints data. - * \param mesh Original mesh - * \return Newly created skinned mesh. You should call drop() when you don't - * need it anymore. - */ +/** Create a skinned mesh which has copied all meshbuffers and joints of the + * original mesh. Note, that this will not copy any other information like + * joints data. + * \param mesh Original mesh + * \return Newly created skinned mesh. You should call drop() when you don't + * need it anymore. + */ scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig) { - using namespace scene; - CSkinnedMesh *mesh = dynamic_cast(orig); - if (!mesh) - { - Log::error("copyAnimatedMesh", "Given mesh was not a skinned mesh."); - return NULL; - } - - ISkinnedMesh* skinned_mesh = m_scene_manager->createSkinnedMesh(); - - for (u32 i = 0; i < mesh->getMeshBuffers().size(); i++) - { - SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); - *buffer = *(mesh->getMeshBuffers()[i]); - } - - for (u32 j = 0; j < mesh->getAllJoints().size(); ++j) - { - ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); - *joint = *(mesh->getAllJoints()[j]); - } - - // fix children pointers (they still have old pointers) - core::array & new_joints = skinned_mesh->getAllJoints(); - core::array & old_joints = mesh->getAllJoints(); - for (u32 i = 0; i < new_joints.size(); ++i) - { - ISkinnedMesh::SJoint * joint = new_joints[i]; - for (u32 c = 0; c < joint->Children.size(); ++c) - { - // the child is one of the oldJoints and must be replaced by the newjoint on the same index - for (u32 k = 0; k < old_joints.size(); ++k) - { - if (joint->Children[c] == old_joints[k]) - { - joint->Children[c] = new_joints[k]; - break; - } - } // k < old_joints.size - } // c < joint->Children.size() - } // i < new_joints.size() - - skinned_mesh->finalize(); - - return skinned_mesh; + using namespace scene; + CSkinnedMesh *mesh = dynamic_cast(orig); + if (!mesh) + { + Log::error("copyAnimatedMesh", "Given mesh was not a skinned mesh."); + return NULL; + } + + ISkinnedMesh* skinned_mesh = m_scene_manager->createSkinnedMesh(); + + for (u32 i = 0; i < mesh->getMeshBuffers().size(); i++) + { + SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); + *buffer = *(mesh->getMeshBuffers()[i]); + } + + for (u32 j = 0; j < mesh->getAllJoints().size(); ++j) + { + ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); + *joint = *(mesh->getAllJoints()[j]); + } + + // fix children pointers (they still have old pointers) + core::array & new_joints = skinned_mesh->getAllJoints(); + core::array & old_joints = mesh->getAllJoints(); + for (u32 i = 0; i < new_joints.size(); ++i) + { + ISkinnedMesh::SJoint * joint = new_joints[i]; + for (u32 c = 0; c < joint->Children.size(); ++c) + { + // the child is one of the oldJoints and must be replaced by the newjoint on the same index + for (u32 k = 0; k < old_joints.size(); ++k) + { + if (joint->Children[c] == old_joints[k]) + { + joint->Children[c] = new_joints[k]; + break; + } + } // k < old_joints.size + } // c < joint->Children.size() + } // i < new_joints.size() + + skinned_mesh->finalize(); + + return skinned_mesh; } // copyAnimatedMesh // ---------------------------------------------------------------------------- From 60cde7e63dfa9d81d3ac1fc7aa8f38a68162713a Mon Sep 17 00:00:00 2001 From: hiker Date: Thu, 4 Dec 2014 16:43:57 +1100 Subject: [PATCH 03/40] Added option to disable peer verification in curl. This might help on some platforms (osx) with authentication problems. --- src/config/user_config.hpp | 9 ++++++++- src/online/http_request.cpp | 10 +++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index 4a6f0b16f..15d9fe2d7 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -749,8 +749,9 @@ namespace UserConfigParams PARAM_PREFIX BoolUserConfigParam m_always_show_login_screen PARAM_DEFAULT( BoolUserConfigParam(false, "always_show_login_screen", "Always show the login screen even if last player's session was saved.")); - // ---- Online gameplay related + + // ---- Online gameplay related PARAM_PREFIX GroupUserConfigParam m_online_group PARAM_DEFAULT( GroupUserConfigParam("OnlinePlay", "Everything related to online play.") ); @@ -767,6 +768,12 @@ namespace UserConfigParams &m_online_group, "Version of the server API to use.")); + PARAM_PREFIX BoolUserConfigParam m_verify_peer + PARAM_DEFAULT(BoolUserConfigParam(1, "verify-peer", &m_online_group, + "If curl should check peer address. Should always be enabled," + "unless there are authentication problems.")); + + // ---- Addon server related entries PARAM_PREFIX GroupUserConfigParam m_addon_group PARAM_DEFAULT( GroupUserConfigParam("AddonAndNews", diff --git a/src/online/http_request.cpp b/src/online/http_request.cpp index ee2040889..2c4a3de27 100644 --- a/src/online/http_request.cpp +++ b/src/online/http_request.cpp @@ -186,7 +186,15 @@ namespace Online Log::error("HTTPRequest", "Error %d: '%s'.", error, curl_easy_strerror(error)); } - curl_easy_setopt(m_curl_session, CURLOPT_SSL_VERIFYPEER, 1L); + + // In case that there are authentication problems (e.g. on osx) + // disable peer verification. Not ideal, but still better than + // no encryption. + if (UserConfigParams::m_verify_peer) + curl_easy_setopt(m_curl_session, CURLOPT_SSL_VERIFYPEER, 1L); + else + curl_easy_setopt(m_curl_session, CURLOPT_SSL_VERIFYPEER, 0L); + curl_easy_setopt(m_curl_session, CURLOPT_SSL_VERIFYHOST, 0L); } } // prepareOperation From 23b781e7dd735256ed8824e503e496fdca56ca93 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Fri, 5 Dec 2014 00:09:15 +0100 Subject: [PATCH 04/40] Move glossmap formula to getspecular shader --- data/shaders/diffuseenvmap.frag | 2 +- data/shaders/instanced_normalmap.frag | 2 +- data/shaders/instanced_object_pass1.frag | 2 +- data/shaders/instanced_objectref_pass1.frag | 2 +- data/shaders/normalmap.frag | 2 +- data/shaders/object_pass1.frag | 2 +- data/shaders/objectref_pass1.frag | 2 +- data/shaders/utils/getSpecular.frag | 5 +++-- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/data/shaders/diffuseenvmap.frag b/data/shaders/diffuseenvmap.frag index 037071648..2bee625db 100644 --- a/data/shaders/diffuseenvmap.frag +++ b/data/shaders/diffuseenvmap.frag @@ -52,7 +52,7 @@ void main(void) float specval = texture(ntex, uv).z; // From http://graphics.cs.williams.edu/papers/EnvMipReport2013/ int texSize = textureSize(tex, 0).x; - float lodval = clamp(log2(texSize * sqrt(3.)) - .5 * log2(specval + 1.), 0., 10.); + float lodval = clamp(log2(texSize * sqrt(3.)) - (5. * specval + 1.), 0., 10.); vec4 specular = textureLod(tex, sampleDirection, lodval); Spec = max(specular, vec4(0.)); } diff --git a/data/shaders/instanced_normalmap.frag b/data/shaders/instanced_normalmap.frag index e5181a28d..41be51f59 100644 --- a/data/shaders/instanced_normalmap.frag +++ b/data/shaders/instanced_normalmap.frag @@ -31,5 +31,5 @@ void main() vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent - TS_normal.z * Frag_normal; EncodedNormal.xy = 0.5 * EncodeNormal(normalize(FragmentNormal)) + 0.5; - EncodedNormal.z = exp2(10. * gloss + 1.); + EncodedNormal.z = gloss; } diff --git a/data/shaders/instanced_object_pass1.frag b/data/shaders/instanced_object_pass1.frag index bf76fbf22..1eb768038 100644 --- a/data/shaders/instanced_object_pass1.frag +++ b/data/shaders/instanced_object_pass1.frag @@ -19,5 +19,5 @@ void main(void) float glossmap = texture(glosstex, uv).x; #endif EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5; - EncodedNormal.z = exp2(10. * glossmap + 1.); + EncodedNormal.z = glossmap; } diff --git a/data/shaders/instanced_objectref_pass1.frag b/data/shaders/instanced_objectref_pass1.frag index ef1d5fd5f..da7c3b2a6 100644 --- a/data/shaders/instanced_objectref_pass1.frag +++ b/data/shaders/instanced_objectref_pass1.frag @@ -24,6 +24,6 @@ void main() { if (col.a < 0.5) discard; EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5; - EncodedNormal.z = exp2(10. * glossmap + 1.); + EncodedNormal.z = glossmap; } diff --git a/data/shaders/normalmap.frag b/data/shaders/normalmap.frag index e7ba8efe4..5430a9617 100644 --- a/data/shaders/normalmap.frag +++ b/data/shaders/normalmap.frag @@ -25,5 +25,5 @@ void main() vec3 FragmentNormal = TS_normal.x * Frag_tangent + TS_normal.y * Frag_bitangent - TS_normal.z * Frag_normal; EncodedNormal.xy = 0.5 * EncodeNormal(normalize(FragmentNormal)) + 0.5; - EncodedNormal.z = exp2(10. * (1. - alpha) + 1.); + EncodedNormal.z = 1. - alpha; } diff --git a/data/shaders/object_pass1.frag b/data/shaders/object_pass1.frag index d593b8d2d..172c8484b 100644 --- a/data/shaders/object_pass1.frag +++ b/data/shaders/object_pass1.frag @@ -19,5 +19,5 @@ void main(void) { float glossmap = texture(tex, uv).x; EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5; - EncodedNormal.z = exp2(10. * glossmap + 1.); + EncodedNormal.z = glossmap; } diff --git a/data/shaders/objectref_pass1.frag b/data/shaders/objectref_pass1.frag index 882752f07..bf6da0bf6 100644 --- a/data/shaders/objectref_pass1.frag +++ b/data/shaders/objectref_pass1.frag @@ -24,6 +24,6 @@ void main() { discard; float glossmap = texture(glosstex, uv).x; EncodedNormal.xy = 0.5 * EncodeNormal(normalize(nor)) + 0.5; - EncodedNormal.z = exp2(10. * glossmap + 1.); + EncodedNormal.z = glossmap; } diff --git a/data/shaders/utils/getSpecular.frag b/data/shaders/utils/getSpecular.frag index 629cec7b8..85ed5e761 100644 --- a/data/shaders/utils/getSpecular.frag +++ b/data/shaders/utils/getSpecular.frag @@ -2,10 +2,11 @@ vec3 getSpecular(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness) { + float exponentroughness = exp2(10. * roughness + 1.); // Half Light View direction vec3 H = normalize(eyedir + lightdir); float NdotH = max(0., dot(normal, H)); - float normalisationFactor = (roughness + 2.) / 8.; + float normalisationFactor = (exponentroughness + 2.) / 8.; vec3 FresnelSchlick = color + (1.0f - color) * pow(1.0f - max(0., (dot(eyedir, H))), 5); - return max(pow(NdotH, roughness) * FresnelSchlick * normalisationFactor, vec3(0.)); + return max(pow(NdotH, exponentroughness) * FresnelSchlick * normalisationFactor, vec3(0.)); } \ No newline at end of file From fd2da4085b93386d2abc9a68a63fe51f8f1508d7 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Fri, 5 Dec 2014 00:20:16 +0100 Subject: [PATCH 05/40] Rename some shader to improve their meaning --- data/shaders/{diffuseenvmap.frag => IBL.frag} | 0 data/shaders/gi.frag | 1 - data/shaders/pointlight.frag | 4 ++-- data/shaders/sunlight.frag | 4 ++-- data/shaders/sunlightshadow.frag | 4 ++-- .../utils/{getSpecular.frag => SpecularBRDF.frag} | 5 ++--- src/graphics/post_processing.cpp | 6 +++--- src/graphics/shaders.cpp | 10 +++++----- src/graphics/shaders.hpp | 4 ++-- 9 files changed, 18 insertions(+), 20 deletions(-) rename data/shaders/{diffuseenvmap.frag => IBL.frag} (100%) rename data/shaders/utils/{getSpecular.frag => SpecularBRDF.frag} (76%) diff --git a/data/shaders/diffuseenvmap.frag b/data/shaders/IBL.frag similarity index 100% rename from data/shaders/diffuseenvmap.frag rename to data/shaders/IBL.frag diff --git a/data/shaders/gi.frag b/data/shaders/gi.frag index e90f88d92..9ab0f9dfd 100644 --- a/data/shaders/gi.frag +++ b/data/shaders/gi.frag @@ -9,7 +9,6 @@ uniform sampler3D SHR; uniform sampler3D SHG; uniform sampler3D SHB; -uniform float R_wcs = 10.; uniform vec3 extents; uniform mat4 RHMatrix; uniform mat4 InvRHMatrix; diff --git a/data/shaders/pointlight.frag b/data/shaders/pointlight.frag index c479ec7ce..cabadc0b5 100644 --- a/data/shaders/pointlight.frag +++ b/data/shaders/pointlight.frag @@ -10,7 +10,7 @@ out vec4 Diffuse; out vec4 Specular; vec3 DecodeNormal(vec2 n); -vec3 getSpecular(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); +vec3 SpecularBRDF(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); vec4 getPosFromUVDepth(vec3 uvDepth, mat4 InverseProjectionMatrix); void main() @@ -38,5 +38,5 @@ void main() float NdotL = max(0., dot(norm, L)); Diffuse = vec4(NdotL * light_col * att, 1.); - Specular = vec4(getSpecular(norm, eyedir, L, light_col, roughness) * NdotL * att, 1.); + Specular = vec4(SpecularBRDF(norm, eyedir, L, light_col, roughness) * NdotL * att, 1.); } diff --git a/data/shaders/sunlight.frag b/data/shaders/sunlight.frag index e3bcc8942..e7503241e 100644 --- a/data/shaders/sunlight.frag +++ b/data/shaders/sunlight.frag @@ -13,7 +13,7 @@ out vec4 Diff; out vec4 Spec; vec3 DecodeNormal(vec2 n); -vec3 getSpecular(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); +vec3 SpecularBRDF(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); vec4 getPosFromUVDepth(vec3 uvDepth, mat4 InverseProjectionMatrix); vec3 getMostRepresentativePoint(vec3 direction, vec3 R, float angularRadius) @@ -52,7 +52,7 @@ void main() { vec3 R = reflect(-eyedir, norm); vec3 Lightdir = getMostRepresentativePoint(direction, R, angle); - vec3 Specular = getSpecular(norm, eyedir, Lightdir, col, roughness) * NdotL; + vec3 Specular = SpecularBRDF(norm, eyedir, Lightdir, col, roughness) * NdotL; vec3 outcol = NdotL * col; diff --git a/data/shaders/sunlightshadow.frag b/data/shaders/sunlightshadow.frag index f903148c2..c60665e63 100644 --- a/data/shaders/sunlightshadow.frag +++ b/data/shaders/sunlightshadow.frag @@ -16,7 +16,7 @@ out vec4 Diff; out vec4 Spec; vec3 DecodeNormal(vec2 n); -vec3 getSpecular(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); +vec3 SpecularBRDF(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness); vec4 getPosFromUVDepth(vec3 uvDepth, mat4 InverseProjectionMatrix); vec3 getMostRepresentativePoint(vec3 direction, vec3 R, float angularRadius) @@ -66,7 +66,7 @@ void main() { vec3 R = reflect(-eyedir, norm); vec3 Lightdir = getMostRepresentativePoint(direction, R, angle); - vec3 Specular = getSpecular(norm, eyedir, Lightdir, col, roughness) * NdotL; + vec3 Specular = SpecularBRDF(norm, eyedir, Lightdir, col, roughness) * NdotL; vec3 outcol = NdotL * col; diff --git a/data/shaders/utils/getSpecular.frag b/data/shaders/utils/SpecularBRDF.frag similarity index 76% rename from data/shaders/utils/getSpecular.frag rename to data/shaders/utils/SpecularBRDF.frag index 85ed5e761..2795b3f48 100644 --- a/data/shaders/utils/getSpecular.frag +++ b/data/shaders/utils/SpecularBRDF.frag @@ -1,6 +1,5 @@ - - -vec3 getSpecular(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness) +// Blinn Phong with emulated fresnel factor +vec3 SpecularBRDF(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float roughness) { float exponentroughness = exp2(10. * roughness + 1.); // Half Light View direction diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 123da79ba..9d8dcf0b0 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -228,12 +228,12 @@ void PostProcessing::renderEnvMap(const float *bSHCoeff, const float *gSHCoeff, glBlendEquation(GL_FUNC_ADD); glBlendFunc(GL_ONE, GL_ONE); - glUseProgram(FullScreenShader::EnvMapShader::getInstance()->Program); + glUseProgram(FullScreenShader::IBLShader::getInstance()->Program); glBindVertexArray(SharedObject::FullScreenQuadVAO); - FullScreenShader::EnvMapShader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), irr_driver->getDepthStencilTexture(), skybox); + FullScreenShader::IBLShader::getInstance()->SetTextureUnits(irr_driver->getRenderTargetTexture(RTT_NORMAL_AND_DEPTH), irr_driver->getDepthStencilTexture(), skybox); core::matrix4 TVM = irr_driver->getViewMatrix().getTransposed(); - FullScreenShader::EnvMapShader::getInstance()->setUniforms(TVM, std::vector(bSHCoeff, bSHCoeff + 9), std::vector(gSHCoeff, gSHCoeff + 9), std::vector(rSHCoeff, rSHCoeff + 9)); + FullScreenShader::IBLShader::getInstance()->setUniforms(TVM, std::vector(bSHCoeff, bSHCoeff + 9), std::vector(gSHCoeff, gSHCoeff + 9), std::vector(rSHCoeff, rSHCoeff + 9)); glDrawArrays(GL_TRIANGLES, 0, 3); glBindVertexArray(0); diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index f7c8b8e24..3706f140e 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1426,7 +1426,7 @@ namespace LightShader Program = LoadProgram(OBJECT, GL_VERTEX_SHADER, file_manager->getAsset("shaders/pointlight.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/decodeNormal.frag").c_str(), - GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getSpecular.frag").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/SpecularBRDF.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/pointlight.frag").c_str()); @@ -1625,7 +1625,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/decodeNormal.frag").c_str(), - GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getSpecular.frag").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/SpecularBRDF.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/sunlight.frag").c_str()); @@ -1633,13 +1633,13 @@ namespace FullScreenShader AssignUniforms("direction", "col"); } - EnvMapShader::EnvMapShader() + IBLShader::IBLShader() { Program = LoadProgram(OBJECT, GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/decodeNormal.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(), - GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/diffuseenvmap.frag").c_str()); + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/IBL.frag").c_str()); AssignUniforms("TransposeViewMatrix", "blueLmn[0]", "greenLmn[0]", "redLmn[0]"); AssignSamplerNames(Program, 0, "ntex", 1, "dtex", 2, "tex"); } @@ -1649,7 +1649,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/decodeNormal.frag").c_str(), - GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getSpecular.frag").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/SpecularBRDF.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/sunlightshadow.frag").c_str()); diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index 518f7fad0..2251cbb65 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -411,10 +411,10 @@ public: SunLightShader(); }; -class EnvMapShader : public ShaderHelperSingleton, std::vector, std::vector >, public TextureRead +class IBLShader : public ShaderHelperSingleton, std::vector, std::vector >, public TextureRead { public: - EnvMapShader(); + IBLShader(); }; class ShadowedSunLightShader : public ShaderHelperSingleton, public TextureRead From 4079c18050482f48f024eec01f0443cd124e7bf3 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Fri, 5 Dec 2014 01:38:54 +0100 Subject: [PATCH 06/40] Update graphic restriction This should fix bug #1519 --- data/graphical_restrictions.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/data/graphical_restrictions.xml b/data/graphical_restrictions.xml index 47a63b0cc..54dcd4198 100644 --- a/data/graphical_restrictions.xml +++ b/data/graphical_restrictions.xml @@ -3,6 +3,7 @@ + From c2d7356d05e4227d059cba58c520e5e2109caac8 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 2 Dec 2014 00:26:37 +0100 Subject: [PATCH 07/40] Refactor IBL gen code --- src/graphics/IBL.cpp | 206 +++++++++++++++++++++++++++++++ src/graphics/IBL.hpp | 17 +++ src/graphics/render_skybox.cpp | 214 ++++++--------------------------- 3 files changed, 258 insertions(+), 179 deletions(-) create mode 100644 src/graphics/IBL.cpp create mode 100644 src/graphics/IBL.hpp diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp new file mode 100644 index 000000000..ac354d11b --- /dev/null +++ b/src/graphics/IBL.cpp @@ -0,0 +1,206 @@ +#include "IBL.hpp" +#include "gl_headers.hpp" +#include + +static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z) +{ + switch (face) + { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + x = 1.; + y = -i; + z = -j; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + x = -1.; + y = -i; + z = j; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + x = j; + y = 1.; + z = i; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + x = j; + y = -1; + z = -i; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + x = j; + y = -i; + z = 1; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + x = -j; + y = -i; + z = -1; + break; + } + + float norm = sqrt(x * x + y * y + z * z); + x /= norm, y /= norm, z /= norm; + return; +} + + +static void getYml(GLenum face, size_t width, size_t height, + float *Y00, + float *Y1minus1, float *Y10, float *Y11, + float *Y2minus2, float *Y2minus1, float *Y20, float *Y21, float *Y22) +{ + for (unsigned i = 0; i < width; i++) + { + for (unsigned j = 0; j < height; j++) + { + float x, y, z; + float fi = float(i), fj = float(j); + fi /= width, fj /= height; + fi = 2 * fi - 1, fj = 2 * fj - 1; + getXYZ(face, fi, fj, x, y, z); + + // constant part of Ylm + float c00 = 0.282095f; + float c1minus1 = 0.488603f; + float c10 = 0.488603f; + float c11 = 0.488603f; + float c2minus2 = 1.092548f; + float c2minus1 = 1.092548f; + float c21 = 1.092548f; + float c20 = 0.315392f; + float c22 = 0.546274f; + + size_t idx = i * height + j; + + Y00[idx] = c00; + Y1minus1[idx] = c1minus1 * y; + Y10[idx] = c10 * z; + Y11[idx] = c11 * x; + Y2minus2[idx] = c2minus2 * x * y; + Y2minus1[idx] = c2minus1 * y * z; + Y21[idx] = c21 * x * z; + Y20[idx] = c20 * (3 * z * z - 1); + Y22[idx] = c22 * (x * x - y * y); + } + } +} + + +static void projectSH(Color *CubemapFace[6], size_t edge_size, + float *Y00[], + float *Y1minus1[], float *Y10[], float *Y11[], + float *Y2minus2[], float *Y2minus1[], float * Y20[], float *Y21[], float *Y22[], + float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff + ) +{ + for (unsigned i = 0; i < 9; i++) + { + blueSHCoeff[i] = 0; + greenSHCoeff[i] = 0; + redSHCoeff[i] = 0; + } + + float wh = float(edge_size * edge_size); + for (unsigned face = 0; face < 6; face++) + { + for (unsigned i = 0; i < edge_size; i++) + { + for (unsigned j = 0; j < edge_size; j++) + { + size_t idx = i * edge_size + j; + float fi = float(i), fj = float(j); + fi /= edge_size, fj /= edge_size; + fi = 2 * fi - 1, fj = 2 * fj - 1; + + + float d = sqrt(fi * fi + fj * fj + 1); + + // Constant obtained by projecting unprojected ref values + float solidangle = 2.75f / (wh * pow(d, 1.5f)); + // pow(., 2.2) to convert from srgb + float b = CubemapFace[face][edge_size * i + j].Blue; + float g = CubemapFace[face][edge_size * i + j].Green; + float r = CubemapFace[face][edge_size * i + j].Red; + + blueSHCoeff[0] += b * Y00[face][idx] * solidangle; + blueSHCoeff[1] += b * Y1minus1[face][idx] * solidangle; + blueSHCoeff[2] += b * Y10[face][idx] * solidangle; + blueSHCoeff[3] += b * Y11[face][idx] * solidangle; + blueSHCoeff[4] += b * Y2minus2[face][idx] * solidangle; + blueSHCoeff[5] += b * Y2minus1[face][idx] * solidangle; + blueSHCoeff[6] += b * Y20[face][idx] * solidangle; + blueSHCoeff[7] += b * Y21[face][idx] * solidangle; + blueSHCoeff[8] += b * Y22[face][idx] * solidangle; + + greenSHCoeff[0] += g * Y00[face][idx] * solidangle; + greenSHCoeff[1] += g * Y1minus1[face][idx] * solidangle; + greenSHCoeff[2] += g * Y10[face][idx] * solidangle; + greenSHCoeff[3] += g * Y11[face][idx] * solidangle; + greenSHCoeff[4] += g * Y2minus2[face][idx] * solidangle; + greenSHCoeff[5] += g * Y2minus1[face][idx] * solidangle; + greenSHCoeff[6] += g * Y20[face][idx] * solidangle; + greenSHCoeff[7] += g * Y21[face][idx] * solidangle; + greenSHCoeff[8] += g * Y22[face][idx] * solidangle; + + + redSHCoeff[0] += r * Y00[face][idx] * solidangle; + redSHCoeff[1] += r * Y1minus1[face][idx] * solidangle; + redSHCoeff[2] += r * Y10[face][idx] * solidangle; + redSHCoeff[3] += r * Y11[face][idx] * solidangle; + redSHCoeff[4] += r * Y2minus2[face][idx] * solidangle; + redSHCoeff[5] += r * Y2minus1[face][idx] * solidangle; + redSHCoeff[6] += r * Y20[face][idx] * solidangle; + redSHCoeff[7] += r * Y21[face][idx] * solidangle; + redSHCoeff[8] += r * Y22[face][idx] * solidangle; + } + } + } +} + +void SphericalHarmonics(Color *CubemapFace[6], size_t edge_size, float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff) +{ + float *Y00[6]; + float *Y1minus1[6]; + float *Y10[6]; + float *Y11[6]; + float *Y2minus2[6]; + float *Y2minus1[6]; + float *Y20[6]; + float *Y21[6]; + float *Y22[6]; + + for (unsigned face = 0; face < 6; face++) + { + Y00[face] = new float[edge_size * edge_size]; + Y1minus1[face] = new float[edge_size * edge_size]; + Y10[face] = new float[edge_size * edge_size]; + Y11[face] = new float[edge_size * edge_size]; + Y2minus2[face] = new float[edge_size * edge_size]; + Y2minus1[face] = new float[edge_size * edge_size]; + Y20[face] = new float[edge_size * edge_size]; + Y21[face] = new float[edge_size * edge_size]; + Y22[face] = new float[edge_size * edge_size]; + + getYml(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, edge_size, edge_size, Y00[face], Y1minus1[face], Y10[face], Y11[face], Y2minus2[face], Y2minus1[face], Y20[face], Y21[face], Y22[face]); + } + + projectSH(CubemapFace, edge_size, + Y00, + Y1minus1, Y10, Y11, + Y2minus2, Y2minus1, Y20, Y21, Y22, + blueSHCoeff, greenSHCoeff, redSHCoeff + ); + + for (unsigned face = 0; face < 6; face++) + { + delete[] Y00[face]; + delete[] Y1minus1[face]; + delete[] Y10[face]; + delete[] Y11[face]; + delete[] Y2minus2[face]; + delete[] Y2minus1[face]; + delete[] Y20[face]; + delete[] Y21[face]; + delete[] Y22[face]; + } +} \ No newline at end of file diff --git a/src/graphics/IBL.hpp b/src/graphics/IBL.hpp new file mode 100644 index 000000000..09ddd7d35 --- /dev/null +++ b/src/graphics/IBL.hpp @@ -0,0 +1,17 @@ +#ifndef IBL_HPP +#define IBL_HPP + +struct Color +{ + float Red; + float Green; + float Blue; +}; + +/** Generate the 9 first SH coefficients for each color channel +using the cubemap provided by CubemapFace. +* \param textures sequence of 6 square textures. +* \param row/columns count of textures. +*/ +void SphericalHarmonics(Color *CubemapFace[6], size_t edge_size, float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff); +#endif \ No newline at end of file diff --git a/src/graphics/render_skybox.cpp b/src/graphics/render_skybox.cpp index 5adc255b0..2a9fc4412 100644 --- a/src/graphics/render_skybox.cpp +++ b/src/graphics/render_skybox.cpp @@ -1,3 +1,4 @@ +#include "graphics/IBL.hpp" #include "graphics/irr_driver.hpp" #include "graphics/shaders.hpp" #include "modes/world.hpp" @@ -6,88 +7,6 @@ #define MAX2(a, b) ((a) > (b) ? (a) : (b)) #define MIN2(a, b) ((a) > (b) ? (b) : (a)) -static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z) -{ - switch (face) - { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - x = 1.; - y = -i; - z = -j; - break; - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - x = -1.; - y = -i; - z = j; - break; - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: - x = j; - y = 1.; - z = i; - break; - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: - x = j; - y = -1; - z = -i; - break; - case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: - x = j; - y = -i; - z = 1; - break; - case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: - x = -j; - y = -i; - z = -1; - break; - } - - float norm = sqrt(x * x + y * y + z * z); - x /= norm, y /= norm, z /= norm; - return; -} - -static void getYml(GLenum face, size_t width, size_t height, - float *Y00, - float *Y1minus1, float *Y10, float *Y11, - float *Y2minus2, float *Y2minus1, float *Y20, float *Y21, float *Y22) -{ - for (unsigned i = 0; i < width; i++) - { - for (unsigned j = 0; j < height; j++) - { - float x, y, z; - float fi = float(i), fj = float(j); - fi /= width, fj /= height; - fi = 2 * fi - 1, fj = 2 * fj - 1; - getXYZ(face, fi, fj, x, y, z); - - // constant part of Ylm - float c00 = 0.282095f; - float c1minus1 = 0.488603f; - float c10 = 0.488603f; - float c11 = 0.488603f; - float c2minus2 = 1.092548f; - float c2minus1 = 1.092548f; - float c21 = 1.092548f; - float c20 = 0.315392f; - float c22 = 0.546274f; - - size_t idx = i * height + j; - - Y00[idx] = c00; - Y1minus1[idx] = c1minus1 * y; - Y10[idx] = c10 * z; - Y11[idx] = c11 * x; - Y2minus2[idx] = c2minus2 * x * y; - Y2minus1[idx] = c2minus1 * y * z; - Y21[idx] = c21 * x * z; - Y20[idx] = c20 * (3 * z * z - 1); - Y22[idx] = c22 * (x * x - y * y); - } - } -} - static float getTexelValue(unsigned i, unsigned j, size_t width, size_t height, float *Coeff, float *Y00, float *Y1minus1, float *Y10, float *Y11, float *Y2minus2, float * Y2minus1, float * Y20, float *Y21, float *Y22) { @@ -130,77 +49,6 @@ static void unprojectSH(float *output[], size_t width, size_t height, } } -static void projectSH(float *color[], size_t width, size_t height, - float *Y00[], - float *Y1minus1[], float *Y10[], float *Y11[], - float *Y2minus2[], float *Y2minus1[], float * Y20[], float *Y21[], float *Y22[], - float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff - ) -{ - for (unsigned i = 0; i < 9; i++) - { - blueSHCoeff[i] = 0; - greenSHCoeff[i] = 0; - redSHCoeff[i] = 0; - } - float wh = float(width * height); - for (unsigned face = 0; face < 6; face++) - { - for (unsigned i = 0; i < width; i++) - { - for (unsigned j = 0; j < height; j++) - { - size_t idx = i * height + j; - float fi = float(i), fj = float(j); - fi /= width, fj /= height; - fi = 2 * fi - 1, fj = 2 * fj - 1; - - - float d = sqrt(fi * fi + fj * fj + 1); - - // Constant obtained by projecting unprojected ref values - float solidangle = 2.75f / (wh * pow(d, 1.5f)); - // pow(., 2.2) to convert from srgb - float b = pow(color[face][4 * height * i + 4 * j] / 255.f, 2.2f); - float g = pow(color[face][4 * height * i + 4 * j + 1] / 255.f, 2.2f); - float r = pow(color[face][4 * height * i + 4 * j + 2] / 255.f, 2.2f); - - assert(b >= 0.); - - blueSHCoeff[0] += b * Y00[face][idx] * solidangle; - blueSHCoeff[1] += b * Y1minus1[face][idx] * solidangle; - blueSHCoeff[2] += b * Y10[face][idx] * solidangle; - blueSHCoeff[3] += b * Y11[face][idx] * solidangle; - blueSHCoeff[4] += b * Y2minus2[face][idx] * solidangle; - blueSHCoeff[5] += b * Y2minus1[face][idx] * solidangle; - blueSHCoeff[6] += b * Y20[face][idx] * solidangle; - blueSHCoeff[7] += b * Y21[face][idx] * solidangle; - blueSHCoeff[8] += b * Y22[face][idx] * solidangle; - - greenSHCoeff[0] += g * Y00[face][idx] * solidangle; - greenSHCoeff[1] += g * Y1minus1[face][idx] * solidangle; - greenSHCoeff[2] += g * Y10[face][idx] * solidangle; - greenSHCoeff[3] += g * Y11[face][idx] * solidangle; - greenSHCoeff[4] += g * Y2minus2[face][idx] * solidangle; - greenSHCoeff[5] += g * Y2minus1[face][idx] * solidangle; - greenSHCoeff[6] += g * Y20[face][idx] * solidangle; - greenSHCoeff[7] += g * Y21[face][idx] * solidangle; - greenSHCoeff[8] += g * Y22[face][idx] * solidangle; - - - redSHCoeff[0] += r * Y00[face][idx] * solidangle; - redSHCoeff[1] += r * Y1minus1[face][idx] * solidangle; - redSHCoeff[2] += r * Y10[face][idx] * solidangle; - redSHCoeff[3] += r * Y11[face][idx] * solidangle; - redSHCoeff[4] += r * Y2minus2[face][idx] * solidangle; - redSHCoeff[5] += r * Y2minus1[face][idx] * solidangle; - redSHCoeff[6] += r * Y20[face][idx] * solidangle; - redSHCoeff[7] += r * Y21[face][idx] * solidangle; - redSHCoeff[8] += r * Y22[face][idx] * solidangle; - } - } - } -} static void displayCoeff(float *SHCoeff) { @@ -210,7 +58,7 @@ static void displayCoeff(float *SHCoeff) } // Only for 9 coefficients -static void testSH(unsigned char *color[6], size_t width, size_t height, +/*static void testSH(unsigned char *color[6], size_t width, size_t height, float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff) { float *Y00[6]; @@ -250,7 +98,7 @@ static void testSH(unsigned char *color[6], size_t width, size_t height, getYml(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, width, height, Y00[face], Y1minus1[face], Y10[face], Y11[face], Y2minus2[face], Y2minus1[face], Y20[face], Y21[face], Y22[face]); } - /* blueSHCoeff[0] = 0.54, + blueSHCoeff[0] = 0.54, blueSHCoeff[1] = .6, blueSHCoeff[2] = -.27, blueSHCoeff[3] = .01, blueSHCoeff[4] = -.12, blueSHCoeff[5] = -.47, blueSHCoeff[6] = -.15, blueSHCoeff[7] = .14, blueSHCoeff[8] = -.3; greenSHCoeff[0] = .44, @@ -267,12 +115,12 @@ static void testSH(unsigned char *color[6], size_t width, size_t height, printf("Red:\n"); displayCoeff(redSHCoeff);*/ - projectSH(testoutput, width, height, +/* projectSH(testoutput, width, height, Y00, Y1minus1, Y10, Y11, Y2minus2, Y2minus1, Y20, Y21, Y22, blueSHCoeff, greenSHCoeff, redSHCoeff - ); + );*/ //printf("Blue:\n"); //displayCoeff(blueSHCoeff); @@ -319,7 +167,7 @@ static void testSH(unsigned char *color[6], size_t width, size_t height, printf("Red:\n"); displayCoeff(redSHCoeff); - printf("\nAfter projection\n\n");*/ + printf("\nAfter projection\n\n"); @@ -346,7 +194,7 @@ static void testSH(unsigned char *color[6], size_t width, size_t height, delete[] Y21[face]; delete[] Y22[face]; } -} +}*/ void swapPixels(char *old_img, char *new_img, unsigned stride, unsigned old_i, unsigned old_j, unsigned new_i, unsigned new_j) { @@ -356,6 +204,7 @@ void swapPixels(char *old_img, char *new_img, unsigned stride, unsigned old_i, u new_img[4 * (stride * new_i + new_j) + 3] = old_img[4 * (stride * old_i + old_j) + 3]; } + /** Generate an opengl cubemap texture from 6 2d textures. Out of legacy the sequence of textures maps to : - 1st texture maps to GL_TEXTURE_CUBE_MAP_POSITIVE_Y @@ -440,16 +289,18 @@ void IrrDriver::generateDiffuseCoefficients() m_SH_dirty = false; const unsigned texture_permutation[] = { 2, 3, 0, 1, 5, 4 }; + unsigned sh_w = 0, sh_h = 0; + unsigned char *sh_rgba[6]; + if (SphericalHarmonicsTextures.size() == 6) { - unsigned sh_w = 0, sh_h = 0; + for (unsigned i = 0; i < 6; i++) { sh_w = MAX2(sh_w, SphericalHarmonicsTextures[i]->getOriginalSize().Width); sh_h = MAX2(sh_h, SphericalHarmonicsTextures[i]->getOriginalSize().Height); } - unsigned char *sh_rgba[6]; for (unsigned i = 0; i < 6; i++) sh_rgba[i] = new unsigned char[sh_w * sh_h * 4]; for (unsigned i = 0; i < 6; i++) @@ -468,10 +319,6 @@ void IrrDriver::generateDiffuseCoefficients() delete image; } - testSH(sh_rgba, sh_w, sh_h, blueSHCoeff, greenSHCoeff, redSHCoeff); - - for (unsigned i = 0; i < 6; i++) - delete[] sh_rgba[i]; } else { @@ -480,7 +327,6 @@ void IrrDriver::generateDiffuseCoefficients() video::SColor ambient = m_scene_manager->getAmbientLight().toSColor(); - unsigned char *sh_rgba[6]; for (unsigned i = 0; i < 6; i++) { sh_rgba[i] = new unsigned char[sh_w * sh_h * 4]; @@ -493,9 +339,31 @@ void IrrDriver::generateDiffuseCoefficients() sh_rgba[i][j + 3] = 255; } } + } - testSH(sh_rgba, sh_w, sh_h, blueSHCoeff, greenSHCoeff, redSHCoeff); + // Convert to float texture + Color *FloatTexCube[6]; + for (unsigned i = 0; i < 6; i++) + { + FloatTexCube[i] = new Color[sh_w * sh_h]; + for (unsigned j = 0; j < sh_w * sh_h; j++) + { + FloatTexCube[i][j].Blue = powf(float(0xFF & sh_rgba[i][4 * j]) / 255.f, 2.2f); + FloatTexCube[i][j].Green = powf(float(0xFF & sh_rgba[i][4 * j + 1]) / 255.f, 2.2f); + FloatTexCube[i][j].Red = powf(float(0xFF & sh_rgba[i][4 * j + 2]) / 255.f, 2.2f); + } + } + SphericalHarmonics(FloatTexCube, sh_w, blueSHCoeff, greenSHCoeff, redSHCoeff); + + for (unsigned i = 0; i < 6; i++) + { + delete[] sh_rgba[i]; + delete[] FloatTexCube[i]; + } + + if (SphericalHarmonicsTextures.size() != 6) + { // Diffuse env map is x 0.25, compensate for (unsigned i = 0; i < 9; i++) { @@ -503,19 +371,7 @@ void IrrDriver::generateDiffuseCoefficients() greenSHCoeff[i] *= 4; redSHCoeff[i] *= 4; } - - for (unsigned i = 0; i < 6; i++) - delete[] sh_rgba[i]; } - - /*for (unsigned i = 0; i < 6; i++) - { - glBindTexture(GL_TEXTURE_CUBE_MAP, ConvolutedSkyboxCubeMap); - glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_SRGB_ALPHA, w, h, 0, GL_BGRA, GL_UNSIGNED_BYTE, (GLvoid*)rgba[i]); - } - - glBindTexture(GL_TEXTURE_CUBE_MAP, 0);*/ - } void IrrDriver::renderSkybox(const scene::ICameraSceneNode *camera) From 8f3b8cf4482cec4350d4eaf477c665431b83e909 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 2 Dec 2014 17:38:21 +0100 Subject: [PATCH 08/40] Implement specular IBL properly --- data/shaders/IBL.frag | 5 +- .../shaders/importance_sampling_specular.frag | 30 +++++ src/graphics/IBL.cpp | 106 ++++++++++++++++++ src/graphics/IBL.hpp | 4 + src/graphics/irr_driver.cpp | 5 + src/graphics/irr_driver.hpp | 1 + src/graphics/render_lighting.cpp | 2 +- src/graphics/render_skybox.cpp | 5 +- src/graphics/shaders.cpp | 12 ++ src/graphics/shaders.hpp | 6 + 10 files changed, 170 insertions(+), 6 deletions(-) create mode 100644 data/shaders/importance_sampling_specular.frag diff --git a/data/shaders/IBL.frag b/data/shaders/IBL.frag index 2bee625db..a638c3629 100644 --- a/data/shaders/IBL.frag +++ b/data/shaders/IBL.frag @@ -50,9 +50,8 @@ void main(void) sampleDirection = (InverseViewMatrix * vec4(sampleDirection, 0.)).xyz; float specval = texture(ntex, uv).z; - // From http://graphics.cs.williams.edu/papers/EnvMipReport2013/ - int texSize = textureSize(tex, 0).x; - float lodval = clamp(log2(texSize * sqrt(3.)) - (5. * specval + 1.), 0., 10.); + // Assume 8 level of lod (ie 256x256 texture) + float lodval = 8. * (1. - specval); vec4 specular = textureLod(tex, sampleDirection, lodval); Spec = max(specular, vec4(0.)); } diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag new file mode 100644 index 000000000..51549aa6f --- /dev/null +++ b/data/shaders/importance_sampling_specular.frag @@ -0,0 +1,30 @@ +uniform samplerCube tex; +uniform float samples[2048]; +uniform float ViewportSize; + +uniform mat4 PermutationMatrix; + +out vec4 FragColor; + +void main(void) +{ + vec2 uv = gl_FragCoord.xy / ViewportSize; + vec3 RayDir = 2. * vec3(uv, 1.) - 1.; + RayDir = normalize((PermutationMatrix * vec4(RayDir, 0.)).xyz); + + vec4 FinalColor = vec4(0.); + vec3 up = (RayDir.y < .99) ? vec3(0., 1., 0.) : vec3(0., 0., 1.); + vec3 Tangent = normalize(cross(up, RayDir)); + vec3 Bitangent = cross(RayDir, Tangent); + + for (int i = 0; i < 1024; i++) + { + float Theta = samples[2 * i]; + float Phi = samples[2 * i + 1]; + + vec3 sampleDir = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; + FinalColor += textureLod(tex, sampleDir, 0.); + } + + FragColor = FinalColor / 1024.; +} diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp index ac354d11b..71e7b854e 100644 --- a/src/graphics/IBL.cpp +++ b/src/graphics/IBL.cpp @@ -1,6 +1,8 @@ #include "IBL.hpp" #include "gl_headers.hpp" +#include "shaders.hpp" #include +#include static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z) { @@ -203,4 +205,108 @@ void SphericalHarmonics(Color *CubemapFace[6], size_t edge_size, float *blueSHCo delete[] Y21[face]; delete[] Y22[face]; } +} + +// From http://http.developer.nvidia.com/GPUGems3/gpugems3_ch20.html +/** Returns the index-th pair from Hammersley set of pseudo random set. + Hammersley set is a uniform distribution between 0 and 1 for 2 components. + We use the natural indexation on the set to avoid storing the whole set. + \param index of the pair + \param size of the set. */ +std::pair HammersleySequence(int index, int samples) +{ + float InvertedBinaryRepresentation = 0.; + for (size_t i = 0; i < 32; i++) + { + InvertedBinaryRepresentation += ((index >> i) & 0x1) * powf(.5, (float) (i + 1.)); + } + return std::make_pair(float(index) / float(samples), InvertedBinaryRepresentation); +} + + +/** Returns a pseudo random (theta, phi) generated from a probability density function modeled after Phong function. + \param a pseudo random float pair from a uniform density function between 0 and 1. + \param exponent from the Phong formula. */ +std::pair ImportanceSamplingPhong(std::pair Seeds, float exponent) +{ + return std::make_pair(acosf(powf(Seeds.first, 1.f / (exponent + 1.f))), 2.f * 3.14f * Seeds.second); +} + +static +core::matrix4 getPermutationMatrix(size_t indexX, float valX, size_t indexY, float valY, size_t indexZ, float valZ) +{ + core::matrix4 resultMat; + float *M = resultMat.pointer(); + memset(M, 0, 16 * sizeof(float)); + assert(indexX < 4); + assert(indexY < 4); + assert(indexZ < 4); + M[indexX] = valX; + M[4 + indexY] = valY; + M[8 + indexZ] = valZ; + return resultMat; +} + +GLuint generateSpecularCubemap(GLuint probe) +{ + GLuint cubemap_texture; + + glGenTextures(1, &cubemap_texture); + glBindTexture(GL_TEXTURE_CUBE_MAP, cubemap_texture); + size_t cubemap_size = 256; + for (int i = 0; i < 6; i++) + glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGBA16F, cubemap_size, cubemap_size, 0, GL_BGRA, GL_FLOAT, 0); + glGenerateMipmap(GL_TEXTURE_CUBE_MAP); + + GLuint fbo; + glGenFramebuffers(1, &fbo); + glBindFramebuffer(GL_FRAMEBUFFER, fbo); + glViewport(0, 0, cubemap_size, cubemap_size); + GLenum bufs[] = { GL_COLOR_ATTACHMENT0 }; + glDrawBuffers(1, bufs); + glUseProgram(UtilShader::SpecularIBLGenerator::getInstance()->Program); + glBindVertexArray(SharedObject::FullScreenQuadVAO); + + glDisable(GL_BLEND); + glDisable(GL_DEPTH_TEST); + glDisable(GL_CULL_FACE); + + core::matrix4 M[6] = { + getPermutationMatrix(2, -1., 1, -1., 0, 1.), + getPermutationMatrix(2, 1., 1, -1., 0, -1.), + getPermutationMatrix(0, 1., 2, 1., 1, 1.), + getPermutationMatrix(0, 1., 2, -1., 1, -1.), + getPermutationMatrix(0, 1., 1, -1., 2, 1.), + getPermutationMatrix(0, -1., 1, -1., 2, -1.), + }; + + for (unsigned level = 0; level < 8; level++) + { + // Blinn Phong can be approximated by Phong with 4x the specular coefficient + // See http://seblagarde.wordpress.com/2012/03/29/relationship-between-phong-and-blinn-lighting-model/ + float roughness = (8 - level) * 4 * pow(2., 10.) / 8.; + float viewportSize = 1 << (8 - level); + + std::vector Samples; + for (unsigned i = 0; i < 1024; i++) + { + std::pair sample = ImportanceSamplingPhong(HammersleySequence(i, 1024), roughness); + Samples.push_back(sample.first); + Samples.push_back(sample.second); + } + + for (unsigned face = 0; face < 6; face++) + { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, cubemap_texture, level); + GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER); + assert(status == GL_FRAMEBUFFER_COMPLETE); + + UtilShader::SpecularIBLGenerator::getInstance()->SetTextureUnits(probe); + UtilShader::SpecularIBLGenerator::getInstance()->setUniforms(M[face], Samples, viewportSize); + glDrawArrays(GL_TRIANGLES, 0, 3); + } + } + + glDeleteFramebuffers(1, &fbo); + return cubemap_texture; } \ No newline at end of file diff --git a/src/graphics/IBL.hpp b/src/graphics/IBL.hpp index 09ddd7d35..24cdac36e 100644 --- a/src/graphics/IBL.hpp +++ b/src/graphics/IBL.hpp @@ -1,6 +1,8 @@ #ifndef IBL_HPP #define IBL_HPP +#include "gl_headers.hpp" + struct Color { float Red; @@ -14,4 +16,6 @@ using the cubemap provided by CubemapFace. * \param row/columns count of textures. */ void SphericalHarmonics(Color *CubemapFace[6], size_t edge_size, float *blueSHCoeff, float *greenSHCoeff, float *redSHCoeff); + +GLuint generateSpecularCubemap(GLuint probe); #endif \ No newline at end of file diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index df502a7e3..35b8163ae 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1365,6 +1365,7 @@ scene::ISceneNode *IrrDriver::addSkyBox(const std::vector &tex SkyboxTextures = texture; SphericalHarmonicsTextures = sphericalHarmonics; SkyboxCubeMap = 0; + SkyboxSpecularProbe = 0; m_SH_dirty = true; return m_scene_manager->addSkyBoxSceneNode(texture[0], texture[1], texture[2], texture[3], @@ -1377,8 +1378,12 @@ void IrrDriver::suppressSkyBox() SphericalHarmonicsTextures.clear(); m_SH_dirty = true; if ((SkyboxCubeMap) && (!ProfileWorld::isNoGraphics())) + { glDeleteTextures(1, &SkyboxCubeMap); + glDeleteTextures(1, &SkyboxSpecularProbe); + } SkyboxCubeMap = 0; + SkyboxSpecularProbe = 0; } // ---------------------------------------------------------------------------- diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 843b43cd0..60a8b2154 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -254,6 +254,7 @@ private: public: GLuint SkyboxCubeMap; + GLuint SkyboxSpecularProbe; /** A simple class to store video resolutions. */ class VideoMode { diff --git a/src/graphics/render_lighting.cpp b/src/graphics/render_lighting.cpp index 1262f0881..ca5e45061 100644 --- a/src/graphics/render_lighting.cpp +++ b/src/graphics/render_lighting.cpp @@ -155,7 +155,7 @@ void IrrDriver::renderLights(unsigned pointlightcount, bool hasShadow) { ScopedGPUTimer timer(irr_driver->getGPUTimer(Q_ENVMAP)); - m_post_processing->renderEnvMap(blueSHCoeff, greenSHCoeff, redSHCoeff, SkyboxCubeMap); + m_post_processing->renderEnvMap(blueSHCoeff, greenSHCoeff, redSHCoeff, SkyboxSpecularProbe); } // Render sunlight if and only if track supports shadow diff --git a/src/graphics/render_skybox.cpp b/src/graphics/render_skybox.cpp index 2a9fc4412..c408636d5 100644 --- a/src/graphics/render_skybox.cpp +++ b/src/graphics/render_skybox.cpp @@ -280,6 +280,7 @@ void IrrDriver::generateSkyboxCubemap() assert(SkyboxTextures.size() == 6); SkyboxCubeMap = generateCubeMapFromTextures(SkyboxTextures); + SkyboxSpecularProbe = generateSpecularCubemap(SkyboxCubeMap); } void IrrDriver::generateDiffuseCoefficients() @@ -322,8 +323,8 @@ void IrrDriver::generateDiffuseCoefficients() } else { - int sh_w = 16; - int sh_h = 16; + sh_w = 16; + sh_h = 16; video::SColor ambient = m_scene_manager->getAmbientLight().toSColor(); diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 3706f140e..1b67a5546 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -889,6 +889,18 @@ unsigned getGLSLVersion() return irr_driver->getGLSLVersion(); } +namespace UtilShader +{ + SpecularIBLGenerator::SpecularIBLGenerator() + { + Program = LoadProgram(OBJECT, + GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/importance_sampling_specular.frag").c_str()); + AssignUniforms("PermutationMatrix", "samples[0]", "ViewportSize"); + AssignSamplerNames(Program, 0, "tex"); + } +} + namespace MeshShader { // Solid Normal and depth pass shaders diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index 2251cbb65..97ba49c41 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -48,6 +48,12 @@ public: static void init(); static void setUniforms(const irr::video::SColor &); }; + +class SpecularIBLGenerator : public ShaderHelperSingleton, float >, public TextureRead +{ +public: + SpecularIBLGenerator(); +}; } From 1e2656dc887c282f9673d5b2b0507139cd4dd759 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Fri, 5 Dec 2014 17:48:56 +0100 Subject: [PATCH 09/40] Use clamp instead of max(0, dot(normalized, normalized)) Should help GLSL compiler to optimize them. --- data/shaders/grass_pass2.frag | 2 +- data/shaders/instanced_grass_pass2.frag | 2 +- data/shaders/pointlight.frag | 2 +- data/shaders/sunlight.frag | 2 +- data/shaders/sunlightshadow.frag | 2 +- data/shaders/utils/SpecularBRDF.frag | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/shaders/grass_pass2.frag b/data/shaders/grass_pass2.frag index ac5586321..0f881c161 100644 --- a/data/shaders/grass_pass2.frag +++ b/data/shaders/grass_pass2.frag @@ -35,7 +35,7 @@ void main(void) vec3 eyedir = normalize(xpos.xyz); // Inspired from http://http.developer.nvidia.com/GPUGems3/gpugems3_ch16.html - float fEdotL = max(0., dot(SunDir, eyedir)); + float fEdotL = clamp(dot(SunDir, eyedir), 0., 1.); float fPowEdotL = pow(fEdotL, 4.); float fLdotNBack = max(0., - dot(nor, SunDir) * 0.6 + 0.4); diff --git a/data/shaders/instanced_grass_pass2.frag b/data/shaders/instanced_grass_pass2.frag index b06742743..dace65097 100644 --- a/data/shaders/instanced_grass_pass2.frag +++ b/data/shaders/instanced_grass_pass2.frag @@ -41,7 +41,7 @@ void main(void) vec3 eyedir = normalize(xpos.xyz); // Inspired from http://http.developer.nvidia.com/GPUGems3/gpugems3_ch16.html - float fEdotL = max(0., dot(SunDir, eyedir)); + float fEdotL = clamp(dot(SunDir, eyedir), 0., 1.); float fPowEdotL = pow(fEdotL, 4.); float fLdotNBack = max(0., - dot(nor, SunDir) * 0.6 + 0.4); diff --git a/data/shaders/pointlight.frag b/data/shaders/pointlight.frag index cabadc0b5..66a0b8449 100644 --- a/data/shaders/pointlight.frag +++ b/data/shaders/pointlight.frag @@ -35,7 +35,7 @@ void main() // Light Direction vec3 L = -normalize(xpos.xyz - light_pos); - float NdotL = max(0., dot(norm, L)); + float NdotL = clamp(dot(norm, L), 0., 1.); Diffuse = vec4(NdotL * light_col * att, 1.); Specular = vec4(SpecularBRDF(norm, eyedir, L, light_col, roughness) * NdotL * att, 1.); diff --git a/data/shaders/sunlight.frag b/data/shaders/sunlight.frag index e7503241e..e911e4d7e 100644 --- a/data/shaders/sunlight.frag +++ b/data/shaders/sunlight.frag @@ -46,7 +46,7 @@ void main() { // Normalized on the cpu vec3 L = direction; - float NdotL = max(0., dot(norm, L)); + float NdotL = clamp(dot(norm, L), 0., 1.); float angle = 3.14 * sunangle / 180.; vec3 R = reflect(-eyedir, norm); diff --git a/data/shaders/sunlightshadow.frag b/data/shaders/sunlightshadow.frag index c60665e63..b375be90c 100644 --- a/data/shaders/sunlightshadow.frag +++ b/data/shaders/sunlightshadow.frag @@ -60,7 +60,7 @@ void main() { // Normalized on the cpu vec3 L = direction; - float NdotL = max(0., dot(norm, L)); + float NdotL = clamp(dot(norm, L), 0., 1.); float angle = 3.14 * sunangle / 180.; vec3 R = reflect(-eyedir, norm); diff --git a/data/shaders/utils/SpecularBRDF.frag b/data/shaders/utils/SpecularBRDF.frag index 2795b3f48..79b2a18cb 100644 --- a/data/shaders/utils/SpecularBRDF.frag +++ b/data/shaders/utils/SpecularBRDF.frag @@ -4,8 +4,8 @@ vec3 SpecularBRDF(vec3 normal, vec3 eyedir, vec3 lightdir, vec3 color, float rou float exponentroughness = exp2(10. * roughness + 1.); // Half Light View direction vec3 H = normalize(eyedir + lightdir); - float NdotH = max(0., dot(normal, H)); + float NdotH = clamp(dot(normal, H), 0., 1.); float normalisationFactor = (exponentroughness + 2.) / 8.; - vec3 FresnelSchlick = color + (1.0f - color) * pow(1.0f - max(0., (dot(eyedir, H))), 5); + vec3 FresnelSchlick = color + (1.0f - color) * pow(1.0f - clamp(dot(eyedir, H), 0., 1.), 5); return max(pow(NdotH, exponentroughness) * FresnelSchlick * normalisationFactor, vec3(0.)); } \ No newline at end of file From f05618b3b91b47dfc7fa11a02dd615692f69d922 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Fri, 5 Dec 2014 19:17:52 -0500 Subject: [PATCH 10/40] Add possibility to specify non-translated texts in GUI XML files, and use it for debug strings that should not be translated --- data/gui/debug_slider.stkgui | 12 ++++++------ data/gui/main.stkgui | 12 ++++++------ src/guiengine/engine.cpp | 2 +- src/guiengine/screen_loader.cpp | 7 +++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/data/gui/debug_slider.stkgui b/data/gui/debug_slider.stkgui index 270f892b7..a0285405c 100644 --- a/data/gui/debug_slider.stkgui +++ b/data/gui/debug_slider.stkgui @@ -2,37 +2,37 @@
-
-
-
-
-
-
diff --git a/data/gui/main.stkgui b/data/gui/main.stkgui index 788b48e71..11769b286 100644 --- a/data/gui/main.stkgui +++ b/data/gui/main.stkgui @@ -40,17 +40,17 @@ + raw_text="TEST: GPWin" label_location="hover"/> + raw_text="TEST: GPLose" label_location="hover"/> + raw_text="TEST: Unlocked" label_location="hover"/> + raw_text="TEST: Unlocked 2" label_location="hover"/> + raw_text="TEST: Intro" label_location="hover"/> + raw_text="TEST: Outro" label_location="hover"/> Name in XML files: \c "text" + Name in XML files: \c "text" or "raw_text" ("text" is translated, "raw_text" is not) gives text (a label) to the widget where supported. Ribbon-grids give a special meaning to this parameter, see ribbon-grid docs above. diff --git a/src/guiengine/screen_loader.cpp b/src/guiengine/screen_loader.cpp index 1c1c5a23e..4126806cc 100644 --- a/src/guiengine/screen_loader.cpp +++ b/src/guiengine/screen_loader.cpp @@ -232,6 +232,13 @@ if(prop_name != NULL) widget.m_properties[prop_flag] = core::stringc(prop_name). widget.m_is_text_rtl = (translations->isRTLLanguage() && widget.m_text != text); } + const wchar_t* raw_text = xml->getAttributeValue(L"raw_text"); + + if (raw_text != NULL) + { + widget.m_text = raw_text; + } + if (parent != NULL) { widget.setParent(parent); From d3ba1ca28363ca548caefe532ddf51f653b34aed Mon Sep 17 00:00:00 2001 From: auria Date: Fri, 5 Dec 2014 19:26:09 -0500 Subject: [PATCH 11/40] Update strings --- data/po/supertuxkart.pot | 1007 +++++++++++++++++++------------------- 1 file changed, 491 insertions(+), 516 deletions(-) diff --git a/data/po/supertuxkart.pot b/data/po/supertuxkart.pot index 47511a371..69e3f768f 100644 --- a/data/po/supertuxkart.pot +++ b/data/po/supertuxkart.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: supertuxkart\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-11-25 15:04+1100\n" +"POT-Creation-Date: 2014-12-05 19:20-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -74,6 +74,16 @@ msgstr "" msgid "%s is ready" msgstr "" +#: src/states_screens/online_profile_base.cpp:108 +#, c-format +msgid "%s's profile" +msgstr "" + +#: src/states_screens/create_server_screen.cpp:60 +#, c-format +msgid "%s's server" +msgstr "" + #: src/online/online_player_profile.cpp:401 #, c-format msgid "%s, %s and %s are now online." @@ -84,23 +94,15 @@ msgstr "" msgid "'%s' has been eliminated." msgstr "" -#: src/states_screens/online_profile_base.cpp:102 -msgid "'s profile" -msgstr "" - -#: src/states_screens/create_server_screen.cpp:60 -msgid "'s server" -msgstr "" - #. I18N: for empty highscores entries #. I18N: ./data/gui/track_info.stkgui -#: src/states_screens/track_info_screen.cpp:252 data/po/gui_strings.h:211 -#: data/po/gui_strings.h:214 data/po/gui_strings.h:217 +#: src/states_screens/track_info_screen.cpp:252 data/po/gui_strings.h:17 +#: data/po/gui_strings.h:20 data/po/gui_strings.h:23 msgid "(Empty)" msgstr "" #. I18N: ./data/gui/help4.stkgui -#: data/po/gui_strings.h:189 +#: data/po/gui_strings.h:954 msgid "(network play is not yet available)" msgstr "" @@ -114,13 +116,13 @@ msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: in the help screen -#: data/po/gui_strings.h:1128 +#: data/po/gui_strings.h:929 msgid "* Current key bindings can be seen/changed in menu Options" msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1232 +#: data/po/gui_strings.h:1012 msgid "" "* Most of these game modes can also be played in a Grand Prix fashion: " "instead of playing a single race, you play many in a row. The better you " @@ -130,12 +132,12 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:785 +#: data/po/gui_strings.h:826 msgid "* Restart STK to apply new settings" msgstr "" #. I18N: ./data/gui/options_input.stkgui -#: data/po/gui_strings.h:164 +#: data/po/gui_strings.h:1054 msgid "" "* Which config to use will be inferred from which 'Select' key is pressed to " "join the game." @@ -145,8 +147,10 @@ msgstr "" #. I18N: ./data/gui/online/profile_achievements.stkgui #. I18N: ./data/gui/online/profile_settings.stkgui #. I18N: ./data/gui/online/profile_friends.stkgui -#: data/po/gui_strings.h:295 data/po/gui_strings.h:310 -#: data/po/gui_strings.h:404 data/po/gui_strings.h:574 +#. I18N: ./data/gui/online/profile_achievements_tab.stkgui +#: data/po/gui_strings.h:403 data/po/gui_strings.h:481 +#: data/po/gui_strings.h:686 data/po/gui_strings.h:700 +#: data/po/gui_strings.h:726 msgid "..." msgstr "" @@ -177,7 +181,7 @@ msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1220 +#: data/po/gui_strings.h:1000 msgid "" "3 Strikes Battle: Only in multiplayer games. Hit others with weapons until " "they lose all their lives." @@ -196,13 +200,13 @@ msgid "9 months" msgstr "" #. I18N: ./data/gui/track_info.stkgui -#: data/po/gui_strings.h:208 +#: data/po/gui_strings.h:14 msgid "= Highscores =" msgstr "" #. I18N: ./data/gui/gp_info.stkgui #. I18N: In the grand prix info screen -#: data/po/gui_strings.h:126 +#: data/po/gui_strings.h:147 msgid "AI karts" msgstr "" @@ -212,7 +216,7 @@ msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: data/po/gui_strings.h:1006 +#: data/po/gui_strings.h:139 msgid "About" msgstr "" @@ -221,7 +225,7 @@ msgstr "" msgid "Accelerate" msgstr "" -#: src/tracks/track_object_presentation.cpp:942 +#: src/tracks/track_object_presentation.cpp:945 #, c-format msgid "" "Accelerate and press the <%s> key while turning to skid. Skidding for a " @@ -237,7 +241,7 @@ msgstr "" #. I18N: User info dialog #. I18N: ./data/gui/online/registration_terms.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:358 data/po/gui_strings.h:621 +#: data/po/gui_strings.h:504 data/po/gui_strings.h:575 msgid "Accept" msgstr "" @@ -245,19 +249,22 @@ msgstr "" #. I18N: In the recovery dialog #. I18N: ./data/gui/online/recovery_info.stkgui #. I18N: In the recovery dialog -#: data/po/gui_strings.h:479 data/po/gui_strings.h:563 +#: data/po/gui_strings.h:459 data/po/gui_strings.h:715 msgid "Account Recovery" msgstr "" #. I18N: ./data/gui/online/profile_settings.stkgui #. I18N: Section in the profile screen -#: src/states_screens/online_profile_base.cpp:95 data/po/gui_strings.h:408 +#: src/states_screens/online_profile_base.cpp:101 data/po/gui_strings.h:690 msgid "Account Settings" msgstr "" -#. I18N: ./data/gui/online/profile_achievements.stkgui +#. I18N: ./data/gui/main.stkgui +#. I18N: In the main screen +#. I18N: ./data/gui/online/profile_achievements_tab.stkgui #. I18N: Section in the profile screen -#: src/states_screens/online_profile_base.cpp:94 data/po/gui_strings.h:314 +#: src/states_screens/online_profile_base.cpp:100 data/po/gui_strings.h:131 +#: data/po/gui_strings.h:730 msgid "Achievements" msgstr "" @@ -267,13 +274,13 @@ msgstr "" #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:1305 +#: data/po/gui_strings.h:1125 msgid "Add" msgstr "" #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog -#: data/po/gui_strings.h:354 +#: data/po/gui_strings.h:500 msgid "Add Friend" msgstr "" @@ -284,7 +291,7 @@ msgstr "" #. I18N: ./data/gui/options_players.stkgui #. I18N: In the player configuration screen -#: data/po/gui_strings.h:948 +#: data/po/gui_strings.h:317 msgid "Add Player" msgstr "" @@ -295,7 +302,7 @@ msgstr "" #. I18N: ./data/gui/options_input.stkgui #. I18N: In the input configuration screen -#: data/po/gui_strings.h:161 +#: data/po/gui_strings.h:1051 msgid "Add a device" msgstr "" @@ -303,24 +310,24 @@ msgstr "" #. I18N: In the user screen #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: data/po/gui_strings.h:264 data/po/gui_strings.h:918 +#: data/po/gui_strings.h:198 data/po/gui_strings.h:287 msgid "Add user" msgstr "" -#. I18N: arena group name #. I18N: track group name #. I18N: kart group name +#. I18N: arena group name #. I18N: track group name -#. I18N: ./data/gui/easter_egg.stkgui -#. I18N: track group #. I18N: ./data/gui/arenas.stkgui #. I18N: track group -#: src/states_screens/arenas_screen.cpp:83 -#: src/states_screens/grand_prix_editor_screen.cpp:336 +#. I18N: ./data/gui/easter_egg.stkgui +#. I18N: track group #: src/states_screens/tracks_screen.cpp:154 +#: src/states_screens/grand_prix_editor_screen.cpp:336 #: src/states_screens/kart_selection.cpp:286 -#: src/states_screens/easter_egg_screen.cpp:145 data/po/gui_strings.h:288 -#: data/po/gui_strings.h:1067 +#: src/states_screens/arenas_screen.cpp:83 +#: src/states_screens/easter_egg_screen.cpp:145 data/po/gui_strings.h:1225 +#: data/po/gui_strings.h:1261 msgid "Add-Ons" msgstr "" @@ -330,35 +337,36 @@ msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: Main menu button -#: data/po/gui_strings.h:968 +#: data/po/gui_strings.h:115 msgid "Addons" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:721 +#: data/po/gui_strings.h:762 msgid "Advanced pipeline (lights, etc.)" msgstr "" -#. I18N: name of the tab that will show arenas from all groups -#. I18N: name of the tab that will show tracks from all groups -#. I18N: Time filters for add-ons #. I18N: name of the tab that will show tracks from all groups #. I18N: if all kart animations are enabled -#. I18N: ./data/gui/easter_egg.stkgui -#. I18N: track group +#. I18N: Time filters for add-ons +#. I18N: name of the tab that will show tracks from all groups +#. I18N: name of the tab that will show arenas from all groups +#. I18N: name of the tab that will show tracks from all groups #. I18N: ./data/gui/arenas.stkgui #. I18N: track group -#: src/states_screens/arenas_screen.cpp:75 -#: src/states_screens/grand_prix_editor_screen.cpp:333 +#. I18N: ./data/gui/easter_egg.stkgui +#. I18N: track group #: src/states_screens/tracks_screen.cpp:146 +#: src/states_screens/options_screen_video.cpp:412 +#: src/states_screens/grand_prix_editor_screen.cpp:333 #: src/states_screens/addons_screen.cpp:49 #: src/states_screens/kart_selection.cpp:278 -#: src/states_screens/easter_egg_screen.cpp:137 -#: src/states_screens/gp_info_screen.cpp:76 #: src/states_screens/edit_track_screen.cpp:147 -#: src/states_screens/options_screen_video.cpp:412 data/po/gui_strings.h:292 -#: data/po/gui_strings.h:1071 +#: src/states_screens/arenas_screen.cpp:75 +#: src/states_screens/easter_egg_screen.cpp:137 +#: src/states_screens/gp_info_screen.cpp:76 data/po/gui_strings.h:1229 +#: data/po/gui_strings.h:1265 msgid "All" msgstr "" @@ -366,7 +374,7 @@ msgstr "" #. I18N: In the track selection screen #. I18N: ./data/gui/easter_egg.stkgui #. I18N: Section in easter egg tracks selection screen -#: data/po/gui_strings.h:118 data/po/gui_strings.h:280 +#: data/po/gui_strings.h:375 data/po/gui_strings.h:1253 msgid "All Tracks" msgstr "" @@ -376,13 +384,13 @@ msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:807 +#: data/po/gui_strings.h:1073 msgid "Always show login screen" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:737 +#: data/po/gui_strings.h:778 msgid "Ambient Occlusion" msgstr "" @@ -397,13 +405,13 @@ msgid "An error occurred while trying to save your grand prix." msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1169 +#: data/po/gui_strings.h:358 msgid "Anchor - slows down greatly the kart in the first position." msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:777 +#: data/po/gui_strings.h:818 msgid "Animated Characters" msgstr "" @@ -415,7 +423,7 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:765 +#: data/po/gui_strings.h:806 msgid "Animated Scenery" msgstr "" @@ -450,7 +458,7 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:749 +#: data/po/gui_strings.h:790 msgid "Anti-aliasing" msgstr "" @@ -461,13 +469,13 @@ msgid "Anti-aliasing : %s" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui -#: data/po/gui_strings.h:788 +#: data/po/gui_strings.h:829 msgid "Apply" msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:660 +#: data/po/gui_strings.h:1213 msgid "Apply new resolution" msgstr "" @@ -476,50 +484,50 @@ msgstr "" msgid "Are you sure you want to permanently delete this configuration?" msgstr "" -#: src/states_screens/grand_prix_editor_screen.cpp:109 #: src/states_screens/edit_gp_screen.cpp:123 +#: src/states_screens/grand_prix_editor_screen.cpp:109 #, c-format msgid "Are you sure you want to remove '%s'?" msgstr "" -#. I18N: ./data/gui/addons_screen.stkgui -#. I18N: In the addons screen #. I18N: ./data/gui/arenas.stkgui #. I18N: Section in arena tracks selection screen -#: data/po/gui_strings.h:1051 data/po/gui_strings.h:1059 +#. I18N: ./data/gui/addons_screen.stkgui +#. I18N: In the addons screen +#: data/po/gui_strings.h:1217 data/po/gui_strings.h:1288 msgid "Arenas" msgstr "" #. I18N: ./data/gui/press_a_key_dialog.stkgui #. I18N: When configuring input -#: data/po/gui_strings.h:830 +#: data/po/gui_strings.h:1096 msgid "Assign nothing" msgstr "" #. I18N: ./data/gui/press_a_key_dialog.stkgui #. I18N: When configuring input -#: data/po/gui_strings.h:826 +#: data/po/gui_strings.h:1092 msgid "Assign to ESC key" msgstr "" #. I18N: ./data/grandprix/4_atworldsend.grandprix -#: data/po/gui_strings.h:8 data/po/gui_strings.h:1326 +#: data/po/gui_strings.h:2 data/po/gui_strings.h:1291 msgid "At World's End" msgstr "" #. I18N: ./data/gui/options_audio.stkgui #. I18N: Section in the settings menu -#: src/states_screens/options_screen_input2.cpp:86 -#: src/states_screens/options_screen_input.cpp:139 -#: src/states_screens/options_screen_ui.cpp:119 #: src/states_screens/user_screen.cpp:592 -#: src/states_screens/options_screen_video.cpp:136 data/po/gui_strings.h:51 +#: src/states_screens/options_screen_input2.cpp:86 +#: src/states_screens/options_screen_video.cpp:136 +#: src/states_screens/options_screen_input.cpp:139 +#: src/states_screens/options_screen_ui.cpp:119 data/po/gui_strings.h:221 msgid "Audio" msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: In the help menu -#: src/tracks/track_object_presentation.cpp:883 data/po/gui_strings.h:1112 +#: src/tracks/track_object_presentation.cpp:883 data/po/gui_strings.h:913 msgid "Avoid bananas!" msgstr "" @@ -541,22 +549,23 @@ msgstr "" msgid "Axis %d inverted" msgstr "" +#. I18N: name of buttons on gamepads #. I18N: ./data/gui/addons_loading.stkgui #. I18N: Add-on screen action #: src/states_screens/dialogs/addons_loading.cpp:284 -#: src/input/gamepad_config.cpp:203 data/po/gui_strings.h:102 +#: src/input/gamepad_config.cpp:216 data/po/gui_strings.h:1245 msgid "Back" msgstr "" #. I18N: ./data/gui/overworld_dialog.stkgui #. I18N: In the in-game dialog -#: data/po/gui_strings.h:847 +#: data/po/gui_strings.h:836 msgid "Back to Game" msgstr "" #. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: Race paused button -#: data/po/gui_strings.h:667 +#: data/po/gui_strings.h:859 msgid "Back to Race" msgstr "" @@ -566,13 +575,13 @@ msgstr "" #. I18N: ./data/gui/options_device.stkgui #. I18N: In the input configuration screen -#: data/po/gui_strings.h:714 +#: data/po/gui_strings.h:1152 msgid "Back to device list" msgstr "" #. I18N: ./data/gui/overworld_dialog.stkgui #. I18N: In the in-game dialog -#: data/po/gui_strings.h:863 +#: data/po/gui_strings.h:852 msgid "Back to menu" msgstr "" @@ -581,7 +590,7 @@ msgid "Back to the menu" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1175 +#: data/po/gui_strings.h:364 msgid "" "Basket Ball - bounces after the leader, and might squash and slow down karts " "down on the way." @@ -603,7 +612,7 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:729 +#: data/po/gui_strings.h:770 msgid "Bloom" msgstr "" @@ -613,17 +622,12 @@ msgstr "" msgid "Bloom : %s" msgstr "" -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1019 -msgid "Blue" -msgstr "" - #: src/states_screens/race_result_gui.cpp:959 msgid "Blue Team Wins" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1163 +#: data/po/gui_strings.h:352 msgid "" "Bowling Ball - bounces off walls. If you are looking back, it will be thrown " "backwards." @@ -635,51 +639,51 @@ msgid "Brake" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1154 +#: data/po/gui_strings.h:343 msgid "" "BubbleGum - protect yourself with a shield, or use while looking back to " "leave a sticky pink puddle behind you." msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1157 +#: data/po/gui_strings.h:346 msgid "" "Cake - thrown at the closest rival, best on short ranges and long straights." msgstr "" -#: src/addons/addons_manager.cpp:97 src/addons/news_manager.cpp:315 +#: src/addons/news_manager.cpp:315 src/addons/addons_manager.cpp:97 msgid "Can't access stkaddons server..." msgstr "" #. I18N: ./data/gui/edit_track.stkgui -#. I18N: ./data/gui/enter_player_name_dialog.stkgui -#. I18N: In the 'add new player' dialog #. I18N: ./data/gui/confirm_dialog.stkgui #. I18N: In a 'are you sure?' dialog #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the user screen -#. I18N: ./data/gui/online/server_info_dialog.stkgui -#. I18N: In the server info dialog -#. I18N: ./data/gui/online/create_server.stkgui -#. I18N: In the server creation screen -#. I18N: ./data/gui/online/register.stkgui -#. I18N: In the registration dialog -#. I18N: ./data/gui/online/recovery_input.stkgui -#. I18N: In the recovery dialog -#. I18N: ./data/gui/online/registration_terms.stkgui -#. I18N: In the registration dialog #. I18N: ./data/gui/confirm_resolution_dialog.stkgui #. I18N: In the 'confirm resolution' dialog, that's shown when switching resoluton #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: src/states_screens/dialogs/add_device_dialog.cpp:128 +#. I18N: ./data/gui/online/recovery_input.stkgui +#. I18N: In the recovery dialog +#. I18N: ./data/gui/online/registration_terms.stkgui +#. I18N: In the registration dialog +#. I18N: ./data/gui/online/create_server.stkgui +#. I18N: In the server creation screen +#. I18N: ./data/gui/online/register.stkgui +#. I18N: In the registration dialog +#. I18N: ./data/gui/online/server_info_dialog.stkgui +#. I18N: In the server info dialog +#. I18N: ./data/gui/enter_player_name_dialog.stkgui +#. I18N: In the 'add new player' dialog +#: src/states_screens/user_screen.cpp:83 #: src/states_screens/dialogs/addons_loading.cpp:227 -#: src/states_screens/user_screen.cpp:83 data/po/gui_strings.h:44 -#: data/po/gui_strings.h:87 data/po/gui_strings.h:205 -#: data/po/gui_strings.h:276 data/po/gui_strings.h:338 -#: data/po/gui_strings.h:435 data/po/gui_strings.h:475 -#: data/po/gui_strings.h:498 data/po/gui_strings.h:625 -#: data/po/gui_strings.h:699 data/po/gui_strings.h:930 +#: src/states_screens/dialogs/add_device_dialog.cpp:128 +#: data/po/gui_strings.h:87 data/po/gui_strings.h:95 data/po/gui_strings.h:210 +#: data/po/gui_strings.h:260 data/po/gui_strings.h:299 +#: data/po/gui_strings.h:478 data/po/gui_strings.h:579 +#: data/po/gui_strings.h:607 data/po/gui_strings.h:647 +#: data/po/gui_strings.h:663 data/po/gui_strings.h:1178 msgid "Cancel" msgstr "" @@ -698,49 +702,49 @@ msgstr "" #. I18N: ./data/gui/challenges.stkgui #. I18N: Title for challenges screen -#: data/po/gui_strings.h:891 +#: data/po/gui_strings.h:43 msgid "Challenges : Trophy Room" msgstr "" #. I18N: ./data/gui/online/profile_settings.stkgui -#: data/po/gui_strings.h:415 +#: data/po/gui_strings.h:697 msgid "Change" msgstr "" -#. I18N: ./data/gui/karts_online.stkgui -#. I18N: In the kart selection (player setup) screen #. I18N: ./data/gui/karts.stkgui #. I18N: In the kart selection (player setup) screen -#: data/po/gui_strings.h:1055 data/po/gui_strings.h:1082 +#. I18N: ./data/gui/karts_online.stkgui +#. I18N: In the kart selection (player setup) screen +#: data/po/gui_strings.h:1233 data/po/gui_strings.h:1249 msgid "Choose a Kart" msgstr "" #. I18N: ./data/gui/help1.stkgui -#: data/po/gui_strings.h:1104 +#: data/po/gui_strings.h:905 msgid "Click here to play the tutorial" msgstr "" -#. I18N: ./data/gui/online/vote_dialog.stkgui -#. I18N: Vote dialog -#. I18N: ./data/gui/online/notification_dialog.stkgui -#. I18N: User info dialog +#. I18N: ./data/gui/online/change_password.stkgui +#. I18N: In the change password dialog #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: In the login dialog +#. I18N: ./data/gui/online/vote_dialog.stkgui +#. I18N: Vote dialog +#. I18N: ./data/gui/online/notification_dialog.stkgui +#. I18N: User info dialog #. I18N: ./data/gui/online/recovery_info.stkgui #. I18N: In the recovery dialog -#. I18N: ./data/gui/online/change_password.stkgui -#. I18N: In the change password dialog -#: data/po/gui_strings.h:307 data/po/gui_strings.h:322 -#: data/po/gui_strings.h:370 data/po/gui_strings.h:401 -#: data/po/gui_strings.h:571 data/po/gui_strings.h:609 +#: data/po/gui_strings.h:455 data/po/gui_strings.h:516 +#: data/po/gui_strings.h:563 data/po/gui_strings.h:587 +#: data/po/gui_strings.h:671 data/po/gui_strings.h:723 msgid "Close" msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1108 +#: data/po/gui_strings.h:909 msgid "Collect blue boxes : they will give you weapons or other powerups" msgstr "" @@ -750,7 +754,7 @@ msgid "" "Collect gift boxes, and fire the weapon with <%s> to blow away these boxes!" msgstr "" -#: src/tracks/track_object_presentation.cpp:909 +#: src/tracks/track_object_presentation.cpp:912 msgid "Collect nitro bottles (we will use them after the curve)" msgstr "" @@ -760,7 +764,7 @@ msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1116 +#: data/po/gui_strings.h:917 msgid "" "Collecting nitro allows you to get speed boosts whenever you wish by " "pressing the appropriate key. You can see your current level of nitro in the " @@ -776,11 +780,11 @@ msgstr "" msgid "Completed achievement \"%s\"." msgstr "" -#. I18N: ./data/gui/online/register.stkgui -#. I18N: In the registration dialog #. I18N: ./data/gui/online/change_password.stkgui #. I18N: In the change password dialog -#: data/po/gui_strings.h:459 data/po/gui_strings.h:601 +#. I18N: ./data/gui/online/register.stkgui +#. I18N: In the registration dialog +#: data/po/gui_strings.h:447 data/po/gui_strings.h:631 msgid "Confirm" msgstr "" @@ -792,7 +796,7 @@ msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:819 +#: data/po/gui_strings.h:1085 msgid "Connect to the Internet" msgstr "" @@ -806,23 +810,23 @@ msgstr "" msgid "Contains no powerups, so only your driving skills matter!" msgstr "" -#. I18N: ./data/gui/feature_unlocked.stkgui -#. I18N: ./data/gui/tutorial_message_dialog.stkgui -#. I18N: Button in tutorial -#. I18N: ./data/gui/grand_prix_win.stkgui -#. I18N: ./data/gui/grand_prix_lose.stkgui #. I18N: ./data/gui/soccer_setup.stkgui #. I18N: In soccer setup screen +#. I18N: ./data/gui/tutorial_message_dialog.stkgui +#. I18N: Button in tutorial +#. I18N: ./data/gui/grand_prix_lose.stkgui +#. I18N: ./data/gui/feature_unlocked.stkgui +#. I18N: ./data/gui/grand_prix_win.stkgui #: src/states_screens/race_result_gui.cpp:175 -#: src/states_screens/dialogs/gp_info_dialog.cpp:212 data/po/gui_strings.h:90 -#: data/po/gui_strings.h:122 data/po/gui_strings.h:837 -#: data/po/gui_strings.h:1260 data/po/gui_strings.h:1289 +#: src/states_screens/dialogs/gp_info_dialog.cpp:212 data/po/gui_strings.h:69 +#: data/po/gui_strings.h:214 data/po/gui_strings.h:1103 +#: data/po/gui_strings.h:1109 data/po/gui_strings.h:1155 msgid "Continue" msgstr "" #. I18N: ./data/gui/gp_info.stkgui #. I18N: In the grand prix info screen -#: src/states_screens/gp_info_screen.cpp:142 data/po/gui_strings.h:146 +#: src/states_screens/gp_info_screen.cpp:142 data/po/gui_strings.h:167 msgid "Continue saved GP" msgstr "" @@ -834,17 +838,17 @@ msgstr "" #. I18N: Section in the settings menu #. I18N: ./data/gui/options_device.stkgui #. I18N: Section in the settings menu -#: src/states_screens/options_screen_ui.cpp:121 -#: src/states_screens/options_screen_audio.cpp:67 #: src/states_screens/user_screen.cpp:594 -#: src/states_screens/options_screen_video.cpp:139 data/po/gui_strings.h:153 -#: data/po/gui_strings.h:706 +#: src/states_screens/options_screen_audio.cpp:67 +#: src/states_screens/options_screen_video.cpp:139 +#: src/states_screens/options_screen_ui.cpp:121 data/po/gui_strings.h:1043 +#: data/po/gui_strings.h:1144 msgid "Controls" msgstr "" #. I18N: ./data/gui/gpeditor.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:875 +#: data/po/gui_strings.h:1024 msgid "Copy" msgstr "" @@ -860,25 +864,25 @@ msgstr "" #. I18N: ./data/gui/online/create_server.stkgui #. I18N: In the server creation screen -#: data/po/gui_strings.h:431 +#: data/po/gui_strings.h:603 msgid "Create" msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:535 +#: data/po/gui_strings.h:423 msgid "Create Server" msgstr "" #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:439 +#: data/po/gui_strings.h:611 msgid "Create User" msgstr "" #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:447 +#: data/po/gui_strings.h:619 msgid "Create online account" msgstr "" @@ -888,13 +892,13 @@ msgstr "" #. I18N: ./data/gui/credits.stkgui #. I18N: Title in credits screen -#: data/po/gui_strings.h:1182 +#: data/po/gui_strings.h:73 msgid "Credits" msgstr "" #. I18N: ./data/gui/online/change_password.stkgui #. I18N: In the change password dialog -#: data/po/gui_strings.h:593 +#: data/po/gui_strings.h:439 msgid "Current Password" msgstr "" @@ -913,29 +917,33 @@ msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:640 +#: data/po/gui_strings.h:1193 msgid "Custom settings..." msgstr "" -#: src/input/gamepad_config.cpp:186 src/input/gamepad_config.cpp:225 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:195 src/input/gamepad_config.cpp:253 msgid "DPad down" msgstr "" -#: src/input/gamepad_config.cpp:185 src/input/gamepad_config.cpp:227 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:193 src/input/gamepad_config.cpp:257 msgid "DPad left" msgstr "" -#: src/input/gamepad_config.cpp:184 src/input/gamepad_config.cpp:226 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:191 src/input/gamepad_config.cpp:255 msgid "DPad right" msgstr "" -#: src/input/gamepad_config.cpp:187 src/input/gamepad_config.cpp:224 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:197 src/input/gamepad_config.cpp:251 msgid "DPad up" msgstr "" #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog -#: data/po/gui_strings.h:362 +#: data/po/gui_strings.h:508 msgid "Decline" msgstr "" @@ -947,19 +955,19 @@ msgstr "" #. I18N: In the user screen #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: data/po/gui_strings.h:268 data/po/gui_strings.h:922 +#: data/po/gui_strings.h:202 data/po/gui_strings.h:291 msgid "Delete" msgstr "" #. I18N: ./data/gui/options_device.stkgui #. I18N: In the input configuration screen -#: src/states_screens/options_screen_input2.cpp:111 data/po/gui_strings.h:710 +#: src/states_screens/options_screen_input2.cpp:111 data/po/gui_strings.h:1148 msgid "Delete Configuration" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:757 +#: data/po/gui_strings.h:798 msgid "Depth of field" msgstr "" @@ -985,7 +993,7 @@ msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:803 +#: data/po/gui_strings.h:1069 msgid "Display FPS" msgstr "" @@ -1003,8 +1011,8 @@ msgstr "" msgid "Do you want to save your changes?" msgstr "" -#: src/karts/controller/network_player_controller.cpp:283 #: src/karts/controller/player_controller.cpp:340 +#: src/karts/controller/network_player_controller.cpp:283 msgid "Don't accelerate before go" msgstr "" @@ -1015,7 +1023,7 @@ msgstr "" #. I18N: ./data/gui/track_info.stkgui #. I18N: In the track info screen -#: data/po/gui_strings.h:229 +#: data/po/gui_strings.h:35 msgid "Drive in reverse" msgstr "" @@ -1029,13 +1037,13 @@ msgstr "" #. I18N: Menu item #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:879 data/po/gui_strings.h:1309 +#: data/po/gui_strings.h:1028 data/po/gui_strings.h:1129 msgid "Edit" msgstr "" #. I18N: ./data/gui/gpedit.stkgui #. I18N: Title in edit grand prix screen -#: data/po/gui_strings.h:1293 +#: data/po/gui_strings.h:1113 msgid "Edit Grand Prix" msgstr "" @@ -1046,7 +1054,7 @@ msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1228 +#: data/po/gui_strings.h:1008 msgid "Egg hunt: Explore tracks to find all hidden eggs." msgstr "" @@ -1060,11 +1068,11 @@ msgstr "" msgid "Eliminated" msgstr "" -#. I18N: ./data/gui/online/register.stkgui -#. I18N: In the registration dialog #. I18N: ./data/gui/online/recovery_input.stkgui #. I18N: In the recovery dialog -#: data/po/gui_strings.h:463 data/po/gui_strings.h:490 +#. I18N: ./data/gui/online/register.stkgui +#. I18N: In the registration dialog +#: data/po/gui_strings.h:470 data/po/gui_strings.h:635 msgid "Email" msgstr "" @@ -1088,7 +1096,7 @@ msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:815 +#: data/po/gui_strings.h:1081 msgid "Enable handicaped users" msgstr "" @@ -1096,8 +1104,8 @@ msgstr "" #. indicates a graphical feature is enabled #. I18N: ./data/gui/options_audio.stkgui #. I18N: In the audio options screen -#: src/states_screens/options_screen_video.cpp:407 data/po/gui_strings.h:59 -#: data/po/gui_strings.h:71 +#: src/states_screens/options_screen_video.cpp:407 data/po/gui_strings.h:229 +#: data/po/gui_strings.h:241 msgid "Enabled" msgstr "" @@ -1108,7 +1116,7 @@ msgstr "" #. I18N: ./data/gui/enter_player_name_dialog.stkgui #. I18N: In the 'add new player' dialog -#: data/po/gui_strings.h:79 +#: data/po/gui_strings.h:1170 msgid "Enter the new player's name" msgstr "" @@ -1117,7 +1125,7 @@ msgstr "" msgid "Error downloading news: '%s'." msgstr "" -#: src/states_screens/kart_selection.cpp:927 +#: src/states_screens/kart_selection.cpp:922 msgid "" "Everyone:\n" "Press 'Select' now to join the game!" @@ -1125,13 +1133,13 @@ msgstr "" #. I18N: ./data/gui/online/lobby.stkgui #. I18N: In the networking lobby -#: data/po/gui_strings.h:559 +#: data/po/gui_strings.h:532 msgid "Exit" msgstr "" #. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: Race paused button -#: data/po/gui_strings.h:691 +#: data/po/gui_strings.h:883 msgid "Exit Race" msgstr "" @@ -1143,7 +1151,7 @@ msgstr "" #. I18N: Difficulty #. I18N: ./data/gui/racesetup.stkgui #. I18N: Difficulty -#: data/po/gui_strings.h:30 data/po/gui_strings.h:1250 +#: data/po/gui_strings.h:394 data/po/gui_strings.h:748 msgid "Expert" msgstr "" @@ -1151,18 +1159,18 @@ msgstr "" msgid "Explore tracks to find all hidden eggs" msgstr "" -#: src/graphics/irr_driver.cpp:1837 +#: src/graphics/irr_driver.cpp:1839 #, c-format msgid "FPS: %d/%d/%d - PolyCount: %d Solid, %d Shadows - LightDist : %d" msgstr "" -#: src/graphics/irr_driver.cpp:1846 +#: src/graphics/irr_driver.cpp:1848 #, c-format msgid "FPS: %d/%d/%d - %d KTris" msgstr "" -#: src/states_screens/online_profile_achievements.cpp:126 -#: src/states_screens/online_profile_achievements.cpp:166 +#: src/states_screens/online_profile_achievements.cpp:128 +#: src/states_screens/online_profile_achievements.cpp:168 msgid "Fetching achievements" msgstr "" @@ -1181,7 +1189,7 @@ msgid "Fetching servers" msgstr "" #. I18N: ./data/gui/online/recovery_input.stkgui -#: data/po/gui_strings.h:482 +#: data/po/gui_strings.h:462 msgid "" "Fill in the username and email address you supplied at registration to be " "able to reset your password." @@ -1193,7 +1201,7 @@ msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:531 +#: data/po/gui_strings.h:419 msgid "Find Server" msgstr "" @@ -1204,7 +1212,7 @@ msgstr "" #. I18N: ./data/gui/help4.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:193 +#: data/po/gui_strings.h:958 msgid "" "First, you will need several input devices (having multiple gamepads or " "joysticks is the best way to play with several people). Go in the input " @@ -1225,7 +1233,7 @@ msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1216 +#: data/po/gui_strings.h:996 msgid "" "Follow the leader: Run for second place, as the last kart will be " "disqualified every time the counter hits zero. Beware : going in front of " @@ -1254,18 +1262,18 @@ msgid "Friend request declined!" msgstr "" #: src/states_screens/dialogs/user_info_dialog.cpp:158 -msgid "Friend request send!" +msgid "Friend request sent!" msgstr "" #. I18N: ./data/gui/online/profile_friends.stkgui #. I18N: Section in the profile screen -#: src/states_screens/online_profile_base.cpp:93 data/po/gui_strings.h:578 +#: src/states_screens/online_profile_base.cpp:99 data/po/gui_strings.h:704 msgid "Friends" msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:652 +#: data/po/gui_strings.h:1205 msgid "Fullscreen" msgstr "" @@ -1279,22 +1287,22 @@ msgstr "" msgid "Game Keys" msgstr "" -#. I18N: ./data/gui/help4.stkgui +#. I18N: ./data/gui/help2.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help1.stkgui #. I18N: Tab in help menu -#. I18N: ./data/gui/help2.stkgui +#. I18N: ./data/gui/help4.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help3.stkgui #. I18N: Tab in help menu -#: data/po/gui_strings.h:179 data/po/gui_strings.h:1097 -#: data/po/gui_strings.h:1143 data/po/gui_strings.h:1197 +#: data/po/gui_strings.h:332 data/po/gui_strings.h:898 +#: data/po/gui_strings.h:944 data/po/gui_strings.h:977 msgid "Game Modes" msgstr "" #. I18N: ./data/gui/soccer_setup.stkgui #. I18N: In soccer setup screen -#: data/po/gui_strings.h:1278 +#: data/po/gui_strings.h:58 msgid "Game type (Goals limit / Time limit)" msgstr "" @@ -1310,28 +1318,28 @@ msgstr "" msgid "Gamepad hat %d" msgstr "" -#. I18N: ./data/gui/help4.stkgui +#. I18N: ./data/gui/help2.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help1.stkgui #. I18N: Tab in help menu -#. I18N: ./data/gui/help2.stkgui +#. I18N: ./data/gui/help4.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help3.stkgui #. I18N: Tab in help menu -#: data/po/gui_strings.h:171 data/po/gui_strings.h:1089 -#: data/po/gui_strings.h:1135 data/po/gui_strings.h:1189 +#: data/po/gui_strings.h:324 data/po/gui_strings.h:890 +#: data/po/gui_strings.h:936 data/po/gui_strings.h:969 msgid "General" msgstr "" #. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: Race paused button -#: data/po/gui_strings.h:679 +#: data/po/gui_strings.h:871 msgid "Give Up Race" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:741 +#: data/po/gui_strings.h:782 msgid "Global illumination" msgstr "" @@ -1343,7 +1351,7 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:745 +#: data/po/gui_strings.h:786 msgid "Glow (outlines)" msgstr "" @@ -1361,19 +1369,19 @@ msgstr "" #. I18N: ./data/gui/tracks.stkgui #. I18N: In the track selection screen #: src/states_screens/dialogs/select_challenge.cpp:145 -#: data/po/gui_strings.h:114 +#: data/po/gui_strings.h:371 msgid "Grand Prix" msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: data/po/gui_strings.h:1002 +#: data/po/gui_strings.h:135 msgid "Grand Prix Editor" msgstr "" #. I18N: ./data/gui/gpeditor.stkgui #. I18N: Title in grand prix editor screen -#: data/po/gui_strings.h:867 +#: data/po/gui_strings.h:1016 msgid "Grand Prix editor" msgstr "" @@ -1383,30 +1391,25 @@ msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:636 +#: data/po/gui_strings.h:1189 msgid "Graphical Effects Level" msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: Section in the settings menu +#: src/states_screens/user_screen.cpp:591 #: src/states_screens/options_screen_input2.cpp:85 -#: src/states_screens/options_screen_input.cpp:138 -#: src/states_screens/options_screen_ui.cpp:118 #: src/states_screens/options_screen_audio.cpp:64 -#: src/states_screens/user_screen.cpp:591 data/po/gui_strings.h:632 +#: src/states_screens/options_screen_input.cpp:138 +#: src/states_screens/options_screen_ui.cpp:118 data/po/gui_strings.h:1185 msgid "Graphics" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui -#: data/po/gui_strings.h:717 +#: data/po/gui_strings.h:758 msgid "Graphics Settings" msgstr "" -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1016 -msgid "Green" -msgstr "" - #. I18N: Name of first guest player (without number) #: src/config/player_manager.cpp:392 msgid "Guest" @@ -1420,18 +1423,18 @@ msgstr "" #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: In the login dialog -#: data/po/gui_strings.h:389 +#: data/po/gui_strings.h:551 msgid "Guest Sign in" msgstr "" -#. I18N: ./data/gui/race_paused_dialog.stkgui -#. I18N: Race paused button -#. I18N: ./data/gui/overworld_dialog.stkgui -#. I18N: In the in-game dialog #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: data/po/gui_strings.h:687 data/po/gui_strings.h:859 -#: data/po/gui_strings.h:994 +#. I18N: ./data/gui/overworld_dialog.stkgui +#. I18N: In the in-game dialog +#. I18N: ./data/gui/race_paused_dialog.stkgui +#. I18N: Race paused button +#: data/po/gui_strings.h:123 data/po/gui_strings.h:848 +#: data/po/gui_strings.h:879 msgid "Help" msgstr "" @@ -1452,13 +1455,13 @@ msgstr "" #. I18N: ./data/gui/online/registration_terms.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:617 +#: data/po/gui_strings.h:571 msgid "I agree to the above terms and am 13 years or older. " msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1120 +#: data/po/gui_strings.h:921 msgid "" "If you see a button with a lock like this one, you need to complete a " "challenge to unlock it." @@ -1471,7 +1474,7 @@ msgstr "" #. I18N: ./data/gui/addons_loading.stkgui #. I18N: Add-on screen action -#: data/po/gui_strings.h:94 +#: data/po/gui_strings.h:1237 msgid "Install" msgstr "" @@ -1479,12 +1482,12 @@ msgstr "" #. I18N: Difficulty #. I18N: ./data/gui/racesetup.stkgui #. I18N: Difficulty -#: data/po/gui_strings.h:26 data/po/gui_strings.h:1246 +#: data/po/gui_strings.h:390 data/po/gui_strings.h:744 msgid "Intermediate" msgstr "" -#: src/states_screens/register_screen.cpp:347 #: src/states_screens/user_screen.cpp:277 +#: src/states_screens/register_screen.cpp:347 msgid "Internet access is disabled, please enable it in the options" msgstr "" @@ -1494,7 +1497,7 @@ msgstr "" #. I18N: ./data/gui/online/server_info_dialog.stkgui #. I18N: In the server info dialog -#: data/po/gui_strings.h:334 +#: data/po/gui_strings.h:659 msgid "Join" msgstr "" @@ -1504,13 +1507,13 @@ msgstr "" #. I18N: ./data/gui/addons_screen.stkgui #. I18N: In the addons screen -#: data/po/gui_strings.h:1043 +#: data/po/gui_strings.h:1280 msgid "Karts" msgstr "" #. I18N: ./data/gui/confirm_resolution_dialog.stkgui #. I18N: In the 'confirm resolution' dialog, that's shown when switching resoluton -#: data/po/gui_strings.h:695 +#: data/po/gui_strings.h:256 msgid "Keep this resolution" msgstr "" @@ -1557,37 +1560,45 @@ msgstr "" msgid "Left" msgstr "" -#: src/input/gamepad_config.cpp:201 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:212 msgid "Left bumper" msgstr "" -#: src/input/gamepad_config.cpp:205 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:220 msgid "Left thumb button" msgstr "" -#: src/input/gamepad_config.cpp:216 +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:235 msgid "Left thumb down" msgstr "" -#: src/input/gamepad_config.cpp:215 +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:233 msgid "Left thumb left" msgstr "" -#: src/input/gamepad_config.cpp:214 +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:231 msgid "Left thumb right" msgstr "" -#: src/input/gamepad_config.cpp:217 +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:237 msgid "Left thumb up" msgstr "" -#: src/input/gamepad_config.cpp:178 src/input/gamepad_config.cpp:218 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:179 src/input/gamepad_config.cpp:239 msgid "Left trigger" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:733 +#: data/po/gui_strings.h:774 msgid "Light shaft (God rays)" msgstr "" @@ -1603,34 +1614,34 @@ msgstr "" #. I18N: ./data/gui/online/lobby.stkgui #. I18N: In networking lobby -#: data/po/gui_strings.h:547 +#: data/po/gui_strings.h:520 msgid "Lobby" msgstr "" #. I18N: ./data/gui/online/lobby_settings.stkgui #. I18N: In the lobby settings screen -#: data/po/gui_strings.h:508 +#: data/po/gui_strings.h:675 msgid "Lobby Settings" msgstr "" #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:443 +#: data/po/gui_strings.h:615 msgid "Local Username" msgstr "" -#: src/states_screens/kart_selection.cpp:856 +#: src/states_screens/kart_selection.cpp:852 msgid "Locked" msgstr "" +#: src/states_screens/tracks_screen.cpp:282 +#: src/states_screens/race_setup_screen.cpp:214 +#: src/states_screens/kart_selection.cpp:857 +#: src/states_screens/kart_selection.cpp:1448 #: src/states_screens/arenas_screen.cpp:237 #: src/states_screens/arenas_screen.cpp:267 -#: src/states_screens/tracks_screen.cpp:282 -#: src/states_screens/kart_selection.cpp:861 -#: src/states_screens/kart_selection.cpp:1453 #: src/states_screens/easter_egg_screen.cpp:225 #: src/states_screens/easter_egg_screen.cpp:256 -#: src/states_screens/race_setup_screen.cpp:214 msgid "Locked : solve active challenges to gain access to more!" msgstr "" @@ -1638,11 +1649,11 @@ msgstr "" msgid "Locked!" msgstr "" -#. I18N: ./data/gui/online/guest_login.stkgui #. I18N: ./data/gui/user_screen.stkgui +#. I18N: ./data/gui/online/guest_login.stkgui #: src/states_screens/main_menu_screen.cpp:175 -#: src/states_screens/main_menu_screen.cpp:186 data/po/gui_strings.h:373 -#: data/po/gui_strings.h:894 +#: src/states_screens/main_menu_screen.cpp:186 data/po/gui_strings.h:263 +#: data/po/gui_strings.h:535 msgid "Login" msgstr "" @@ -1653,7 +1664,7 @@ msgstr "" #. I18N: ./data/gui/online/profile_friends.stkgui #. I18N: In the profile screen -#: data/po/gui_strings.h:582 +#: data/po/gui_strings.h:708 msgid "Look for more friends:" msgstr "" @@ -1661,13 +1672,13 @@ msgstr "" #. I18N: In the server creation screen #. I18N: ./data/gui/online/lobby_settings.stkgui #. I18N: In the lobby settings screen -#: data/po/gui_strings.h:427 data/po/gui_strings.h:516 +#: data/po/gui_strings.h:599 data/po/gui_strings.h:683 msgid "Max. number of players" msgstr "" #. I18N: ./data/gui/soccer_setup.stkgui #. I18N: In soccer setup screen -#: data/po/gui_strings.h:1274 +#: data/po/gui_strings.h:54 msgid "Maximum time (min.)" msgstr "" @@ -1683,7 +1694,7 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:753 +#: data/po/gui_strings.h:794 msgid "Motion blur" msgstr "" @@ -1707,48 +1718,48 @@ msgstr "" #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:1301 +#: data/po/gui_strings.h:1121 msgid "Move down" msgstr "" #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:1297 +#: data/po/gui_strings.h:1117 msgid "Move up" msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: Main menu button -#: data/po/gui_strings.h:960 +#: data/po/gui_strings.h:107 msgid "Multiplayer" msgstr "" -#. I18N: ./data/gui/help4.stkgui +#. I18N: ./data/gui/help2.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help1.stkgui #. I18N: Tab in help menu -#. I18N: ./data/gui/help2.stkgui +#. I18N: ./data/gui/help4.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help3.stkgui #. I18N: Tab in help menu -#: data/po/gui_strings.h:183 data/po/gui_strings.h:1101 -#: data/po/gui_strings.h:1147 data/po/gui_strings.h:1201 +#: data/po/gui_strings.h:336 data/po/gui_strings.h:902 +#: data/po/gui_strings.h:948 data/po/gui_strings.h:981 msgid "Multi­player" msgstr "" #. I18N: ./data/gui/options_audio.stkgui #. I18N: In the audio options screen -#: data/po/gui_strings.h:55 +#: data/po/gui_strings.h:225 msgid "Music" msgstr "" -#. I18N: ./data/gui/online/server_info_dialog.stkgui -#. I18N: In the server info dialog #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog -#: src/states_screens/online_profile_achievements.cpp:72 -#: src/states_screens/server_selection.cpp:91 data/po/gui_strings.h:330 -#: data/po/gui_strings.h:346 +#. I18N: ./data/gui/online/server_info_dialog.stkgui +#. I18N: In the server info dialog +#: src/states_screens/server_selection.cpp:91 +#: src/states_screens/online_profile_achievements.cpp:73 +#: data/po/gui_strings.h:492 data/po/gui_strings.h:655 msgid "Name" msgstr "" @@ -1768,13 +1779,13 @@ msgstr "" #. I18N: In the server creation screen #. I18N: ./data/gui/online/lobby_settings.stkgui #. I18N: In the lobby settings screen -#: data/po/gui_strings.h:423 data/po/gui_strings.h:512 +#: data/po/gui_strings.h:595 data/po/gui_strings.h:679 msgid "Name of the server" msgstr "" #. I18N: ./data/gui/gpeditor.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:871 +#: data/po/gui_strings.h:1020 msgid "New" msgstr "" @@ -1785,7 +1796,7 @@ msgstr "" #. I18N: ./data/gui/online/change_password.stkgui #. I18N: In the change password dialog -#: data/po/gui_strings.h:597 +#: data/po/gui_strings.h:443 msgid "New Password" msgstr "" @@ -1832,8 +1843,8 @@ msgid "No" msgstr "" #. I18N: if no kart animations are enabled -#: src/states_screens/gp_info_screen.cpp:75 #: src/states_screens/options_screen_video.cpp:416 +#: src/states_screens/gp_info_screen.cpp:75 msgid "None" msgstr "" @@ -1842,7 +1853,7 @@ msgstr "" msgid "Normal Race" msgstr "" -#: src/tracks/track_object_presentation.cpp:950 +#: src/tracks/track_object_presentation.cpp:953 msgid "" "Note that if you manage to skid for several seconds, you will receive a " "bonus speedup as a reward!" @@ -1852,7 +1863,7 @@ msgstr "" #. I18N: Difficulty #. I18N: ./data/gui/racesetup.stkgui #. I18N: Difficulty -#: data/po/gui_strings.h:22 data/po/gui_strings.h:1242 +#: data/po/gui_strings.h:386 data/po/gui_strings.h:740 msgid "Novice" msgstr "" @@ -1863,46 +1874,46 @@ msgstr "" #. I18N: ./data/gui/track_info.stkgui #. I18N: In the track info screen -#: data/po/gui_strings.h:225 +#: data/po/gui_strings.h:31 msgid "Number of AI karts" msgstr "" #. I18N: ./data/gui/soccer_setup.stkgui #. I18N: In soccer setup screen -#: data/po/gui_strings.h:1270 +#: data/po/gui_strings.h:50 msgid "Number of goals to win" msgstr "" #. I18N: ./data/gui/track_info.stkgui #. I18N: In the track info screen -#: data/po/gui_strings.h:221 +#: data/po/gui_strings.h:27 msgid "Number of laps" msgstr "" #. I18N: ./data/gui/edit_track.stkgui #. I18N: In the edit track screen -#: data/po/gui_strings.h:34 +#: data/po/gui_strings.h:77 msgid "Number of laps:" msgstr "" #. I18N: ./data/gui/edit_track.stkgui -#. I18N: ./data/gui/enter_player_name_dialog.stkgui -#. I18N: In the 'add new player' dialog #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the user screen +#. I18N: ./data/gui/user_screen.stkgui +#. I18N: In the user screen #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#. I18N: ./data/gui/user_screen.stkgui -#. I18N: In the user screen +#. I18N: ./data/gui/enter_player_name_dialog.stkgui +#. I18N: In the 'add new player' dialog #: src/states_screens/dialogs/message_dialog.cpp:95 -#: src/states_screens/dialogs/message_dialog.cpp:108 data/po/gui_strings.h:41 -#: data/po/gui_strings.h:83 data/po/gui_strings.h:260 -#: data/po/gui_strings.h:471 data/po/gui_strings.h:914 +#: src/states_screens/dialogs/message_dialog.cpp:108 data/po/gui_strings.h:84 +#: data/po/gui_strings.h:194 data/po/gui_strings.h:283 +#: data/po/gui_strings.h:643 data/po/gui_strings.h:1174 msgid "OK" msgstr "" #. I18N: ./data/grandprix/2_offthebeatentrack.grandprix -#: data/po/gui_strings.h:11 data/po/gui_strings.h:1329 +#: data/po/gui_strings.h:8 data/po/gui_strings.h:1297 msgid "Off the beaten track" msgstr "" @@ -1910,28 +1921,28 @@ msgstr "" msgid "Offline" msgstr "" +#. I18N: ./data/gui/main.stkgui +#. I18N: Main menu button #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the user screen #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#. I18N: ./data/gui/main.stkgui -#. I18N: Main menu button +#: src/states_screens/online_profile_friends.cpp:149 #: src/states_screens/main_menu_screen.cpp:170 -#: src/states_screens/main_menu_screen.cpp:185 -#: src/states_screens/online_profile_friends.cpp:149 data/po/gui_strings.h:244 -#: data/po/gui_strings.h:898 data/po/gui_strings.h:964 +#: src/states_screens/main_menu_screen.cpp:185 data/po/gui_strings.h:111 +#: data/po/gui_strings.h:178 data/po/gui_strings.h:267 msgid "Online" msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:523 +#: data/po/gui_strings.h:411 msgid "Online Multiplayer" msgstr "" #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:451 +#: data/po/gui_strings.h:623 msgid "Online Username" msgstr "" @@ -1947,53 +1958,53 @@ msgstr "" msgid "Only the Game Master may act at this point!" msgstr "" -#: src/tracks/track_object_presentation.cpp:929 +#: src/tracks/track_object_presentation.cpp:932 #, c-format msgid "Oops! When you're in trouble, press <%s> to be rescued" msgstr "" -#. I18N: ./data/gui/race_paused_dialog.stkgui -#. I18N: Race paused button -#. I18N: ./data/gui/overworld_dialog.stkgui -#. I18N: In the in-game dialog #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: data/po/gui_strings.h:683 data/po/gui_strings.h:855 -#: data/po/gui_strings.h:990 +#. I18N: ./data/gui/overworld_dialog.stkgui +#. I18N: In the in-game dialog +#. I18N: ./data/gui/race_paused_dialog.stkgui +#. I18N: Race paused button +#: data/po/gui_strings.h:119 data/po/gui_strings.h:844 +#: data/po/gui_strings.h:875 msgid "Options" msgstr "" #. I18N: ./data/gui/online/profile_overview.stkgui #. I18N: Section in the profile screen -#: data/po/gui_strings.h:299 +#: data/po/gui_strings.h:407 msgid "Overview" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1166 +#: data/po/gui_strings.h:355 msgid "Parachute - slows down all karts in a better position." msgstr "" #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the registration dialog -#. I18N: ./data/gui/online/register.stkgui -#. I18N: In the registration dialog #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: data/po/gui_strings.h:256 data/po/gui_strings.h:455 -#: data/po/gui_strings.h:910 +#. I18N: ./data/gui/online/register.stkgui +#. I18N: In the registration dialog +#: data/po/gui_strings.h:190 data/po/gui_strings.h:279 +#: data/po/gui_strings.h:627 msgid "Password" msgstr "" #. I18N: ./data/gui/online/profile_settings.stkgui #. I18N: In the online account settings screen -#: data/po/gui_strings.h:412 +#: data/po/gui_strings.h:694 msgid "Password :" msgstr "" #. I18N: ./data/gui/online/change_password.stkgui #. I18N: In the change password dialog -#: data/po/gui_strings.h:589 +#: data/po/gui_strings.h:435 msgid "Password Change" msgstr "" @@ -2016,14 +2027,14 @@ msgstr "" msgid "Pause Game" msgstr "" -#. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: ./data/gui/overworld_dialog.stkgui -#: data/po/gui_strings.h:663 data/po/gui_strings.h:843 +#. I18N: ./data/gui/race_paused_dialog.stkgui +#: data/po/gui_strings.h:832 data/po/gui_strings.h:855 msgid "Paused" msgstr "" -#: src/karts/controller/network_player_controller.cpp:281 #: src/karts/controller/player_controller.cpp:338 +#: src/karts/controller/network_player_controller.cpp:281 msgid "Penalty time!!" msgstr "" @@ -2032,7 +2043,7 @@ msgid "Pending" msgstr "" #. I18N: ./data/grandprix/1_penguinplayground.grandprix -#: data/po/gui_strings.h:2 data/po/gui_strings.h:1320 +#: data/po/gui_strings.h:5 data/po/gui_strings.h:1294 msgid "Penguin Playground" msgstr "" @@ -2041,7 +2052,7 @@ msgid "Performing vote" msgstr "" #. I18N: ./data/gui/tutorial.stkgui -#: data/po/gui_strings.h:1078 +#: data/po/gui_strings.h:252 msgid "Play all" msgstr "" @@ -2050,18 +2061,18 @@ msgstr "" #. I18N: ./data/gui/options_players.stkgui #. I18N: Section in the settings menu #: src/states_screens/options_screen_input2.cpp:88 -#: src/states_screens/options_screen_input.cpp:141 #: src/states_screens/server_selection.cpp:92 -#: src/states_screens/options_screen_ui.cpp:120 #: src/states_screens/options_screen_audio.cpp:66 -#: src/states_screens/options_screen_video.cpp:138 data/po/gui_strings.h:240 -#: data/po/gui_strings.h:937 +#: src/states_screens/options_screen_video.cpp:138 +#: src/states_screens/options_screen_input.cpp:141 +#: src/states_screens/options_screen_ui.cpp:120 data/po/gui_strings.h:174 +#: data/po/gui_strings.h:306 msgid "Players" msgstr "" #. I18N: ./data/gui/enter_gp_name_dialog.stkgui #. I18N: In the 'add new grand prix' dialog -#: data/po/gui_strings.h:106 +#: data/po/gui_strings.h:1162 msgid "Please enter the name of the grand prix" msgstr "" @@ -2074,54 +2085,54 @@ msgstr "" msgid "Please wait while addons are updated" msgstr "" -#: src/states_screens/main_menu_screen.cpp:553 +#: src/states_screens/main_menu_screen.cpp:557 msgid "Please wait while the add-ons are loading" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1160 +#: data/po/gui_strings.h:349 msgid "" "Plunger - throw straight to pull an opponent back, or throw while looking " "back to make one lose sight." msgstr "" -#: src/tracks/track_object_presentation.cpp:902 +#: src/tracks/track_object_presentation.cpp:904 #, c-format msgid "" -"Press to look behind, to fire the weapon with <%s> while pressing to " +"Press <%s> to look behind, and fire the weapon with <%s> while pressing <%s> " "to fire behind!" msgstr "" -#. I18N: ./data/gui/enter_gp_name_dialog.stkgui -#. I18N: In the 'add new grand prix' dialog #. I18N: ./data/gui/press_a_key_dialog.stkgui #. I18N: When configuring input -#: data/po/gui_strings.h:110 data/po/gui_strings.h:834 +#. I18N: ./data/gui/enter_gp_name_dialog.stkgui +#. I18N: In the 'add new grand prix' dialog +#: data/po/gui_strings.h:1100 data/po/gui_strings.h:1166 msgid "Press ESC to cancel" msgstr "" #. I18N: ./data/gui/press_a_key_dialog.stkgui -#: data/po/gui_strings.h:822 +#: data/po/gui_strings.h:1088 msgid "Press a key" msgstr "" #. I18N: ./data/gui/options_input.stkgui #. I18N: In the input configuration screen -#: data/po/gui_strings.h:157 +#: data/po/gui_strings.h:1047 msgid "Press enter or double-click on a device to configure it" msgstr "" #. I18N: ./data/gui/options_players.stkgui #. I18N: In the player configuration screen -#: data/po/gui_strings.h:944 +#: data/po/gui_strings.h:313 msgid "Press enter or double-click on a player to edit him/her" msgstr "" -#: src/states_screens/race_gui_overworld.cpp:464 +#: src/states_screens/race_gui_overworld.cpp:462 msgid "Press fire to play the tutorial" msgstr "" -#: src/states_screens/race_gui_overworld.cpp:534 +#: src/states_screens/race_gui_overworld.cpp:532 msgid "Press fire to start the challenge" msgstr "" @@ -2131,12 +2142,12 @@ msgid "" "mode, then click on Ok.Detailed instructions at supertuxkart.net/Wiimote" msgstr "" -#: src/states_screens/dialogs/addons_loading.cpp:358 +#: src/states_screens/dialogs/addons_loading.cpp:357 #, c-format msgid "Problems installing the addon '%s'." msgstr "" -#: src/states_screens/dialogs/addons_loading.cpp:397 +#: src/states_screens/dialogs/addons_loading.cpp:394 #, c-format msgid "Problems removing the addon '%s'." msgstr "" @@ -2147,11 +2158,11 @@ msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:539 +#: data/po/gui_strings.h:427 msgid "Profile" msgstr "" -#: src/states_screens/online_profile_achievements.cpp:78 +#: src/states_screens/online_profile_achievements.cpp:79 msgid "Progress" msgstr "" @@ -2163,13 +2174,13 @@ msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:527 +#: data/po/gui_strings.h:415 msgid "Quick Play" msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: data/po/gui_strings.h:1010 +#: data/po/gui_strings.h:143 msgid "Quit" msgstr "" @@ -2177,11 +2188,11 @@ msgstr "" msgid "Quit the server." msgstr "" +#. I18N: ./data/gui/soccer_setup.stkgui #. I18N: ./data/gui/select_challenge.stkgui #. I18N: ./data/gui/racesetup.stkgui -#. I18N: ./data/gui/soccer_setup.stkgui -#: data/po/gui_strings.h:14 data/po/gui_strings.h:1235 -#: data/po/gui_strings.h:1266 +#: data/po/gui_strings.h:46 data/po/gui_strings.h:378 +#: data/po/gui_strings.h:733 msgid "Race Setup" msgstr "" @@ -2197,8 +2208,8 @@ msgstr "" msgid "Random Grand Prix" msgstr "" -#: src/states_screens/kart_selection.cpp:842 -#: src/states_screens/kart_selection.cpp:1472 +#: src/states_screens/kart_selection.cpp:838 +#: src/states_screens/kart_selection.cpp:1466 msgid "Random Kart" msgstr "" @@ -2213,7 +2224,7 @@ msgstr "" #. I18N: ./data/gui/addons_screen.stkgui #. I18N: In addons screen, in the filtering bar, to enable a filter that will show only items with good rating -#: data/po/gui_strings.h:1039 +#: data/po/gui_strings.h:1276 msgid "Rating >=" msgstr "" @@ -2222,24 +2233,19 @@ msgstr "" msgid "Ready!" msgstr "" -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1013 -msgid "Red" -msgstr "" - #: src/states_screens/race_result_gui.cpp:955 msgid "Red Team Wins" msgstr "" #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: Tab in login menu -#: data/po/gui_strings.h:385 +#: data/po/gui_strings.h:547 msgid "Register" msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1208 +#: data/po/gui_strings.h:988 msgid "" "Regular Race: All blows allowed, so catch weapons and make clever use of " "them!" @@ -2254,13 +2260,13 @@ msgstr "" #. I18N: In the user screen #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: data/po/gui_strings.h:248 data/po/gui_strings.h:902 +#: data/po/gui_strings.h:182 data/po/gui_strings.h:271 msgid "Remember password" msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:656 +#: data/po/gui_strings.h:1209 msgid "Remember window location" msgstr "" @@ -2270,19 +2276,19 @@ msgstr "" #. I18N: Menu item #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:350 data/po/gui_strings.h:883 -#: data/po/gui_strings.h:1313 +#: data/po/gui_strings.h:496 data/po/gui_strings.h:1032 +#: data/po/gui_strings.h:1133 msgid "Remove" msgstr "" #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the user screen -#. I18N: ./data/gui/gpeditor.stkgui -#. I18N: Menu item #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen -#: data/po/gui_strings.h:272 data/po/gui_strings.h:887 -#: data/po/gui_strings.h:926 +#. I18N: ./data/gui/gpeditor.stkgui +#. I18N: Menu item +#: data/po/gui_strings.h:206 data/po/gui_strings.h:295 +#: data/po/gui_strings.h:1036 msgid "Rename" msgstr "" @@ -2308,7 +2314,7 @@ msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:648 +#: data/po/gui_strings.h:1201 msgid "Resolution" msgstr "" @@ -2318,19 +2324,19 @@ msgstr "" #. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: Race paused button -#: data/po/gui_strings.h:675 +#: data/po/gui_strings.h:867 msgid "Restart Race" msgstr "" #. I18N: ./data/gui/gp_info.stkgui #. I18N: In the grand prix info screen -#: data/po/gui_strings.h:130 +#: data/po/gui_strings.h:151 msgid "Reverse" msgstr "" #. I18N: ./data/gui/edit_track.stkgui #. I18N: In the edit track screen -#: data/po/gui_strings.h:38 +#: data/po/gui_strings.h:81 msgid "Reverse:" msgstr "" @@ -2343,64 +2349,61 @@ msgstr "" msgid "Right" msgstr "" -#: src/input/gamepad_config.cpp:202 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:214 msgid "Right bumper" msgstr "" -#: src/input/gamepad_config.cpp:206 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:222 msgid "Right thumb button" msgstr "" -#: src/input/gamepad_config.cpp:181 src/input/gamepad_config.cpp:220 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:185 src/input/gamepad_config.cpp:243 msgid "Right thumb down" msgstr "" -#: src/input/gamepad_config.cpp:180 src/input/gamepad_config.cpp:223 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:183 src/input/gamepad_config.cpp:249 msgid "Right thumb left" msgstr "" -#: src/input/gamepad_config.cpp:179 src/input/gamepad_config.cpp:222 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:181 src/input/gamepad_config.cpp:247 msgid "Right thumb right" msgstr "" -#: src/input/gamepad_config.cpp:182 src/input/gamepad_config.cpp:221 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:187 src/input/gamepad_config.cpp:245 msgid "Right thumb up" msgstr "" -#: src/input/gamepad_config.cpp:183 src/input/gamepad_config.cpp:219 +#. I18N: name of buttons on gamepads +#. I18N: name of stick on gamepads +#: src/input/gamepad_config.cpp:189 src/input/gamepad_config.cpp:241 msgid "Right trigger" msgstr "" -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1025 -msgid "SSAO K" -msgstr "" - -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1022 -msgid "SSAO Radius" -msgstr "" - -#. I18N: ./data/gui/debug_slider.stkgui -#: data/po/gui_strings.h:1028 -msgid "SSAO sigma" -msgstr "" - #. I18N: ./data/gui/gpedit.stkgui #. I18N: Menu item -#: data/po/gui_strings.h:1317 +#: data/po/gui_strings.h:1137 msgid "Save" msgstr "" -#. I18N: ./data/gui/grand_prix_win.stkgui #. I18N: ./data/gui/grand_prix_lose.stkgui -#: data/po/gui_strings.h:840 data/po/gui_strings.h:1263 +#. I18N: ./data/gui/grand_prix_win.stkgui +#: data/po/gui_strings.h:1106 data/po/gui_strings.h:1158 msgid "Save Grand Prix" msgstr "" #. I18N: ./data/gui/online/user_search.stkgui #. I18N: ./data/gui/online/profile_friends.stkgui -#: data/po/gui_strings.h:504 data/po/gui_strings.h:585 +#: data/po/gui_strings.h:400 data/po/gui_strings.h:711 msgid "Search" msgstr "" @@ -2415,12 +2418,12 @@ msgid "Select" msgstr "" #. I18N: ./data/gui/racesetup.stkgui -#: data/po/gui_strings.h:1238 +#: data/po/gui_strings.h:736 msgid "Select a difficulty" msgstr "" #. I18N: ./data/gui/racesetup.stkgui -#: data/po/gui_strings.h:1257 +#: data/po/gui_strings.h:755 msgid "Select a game mode" msgstr "" @@ -2430,36 +2433,36 @@ msgstr "" #. I18N: ./data/gui/overworld_dialog.stkgui #. I18N: In the in-game dialog -#: data/po/gui_strings.h:851 +#: data/po/gui_strings.h:840 msgid "Select kart" msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:811 +#: data/po/gui_strings.h:1077 msgid "Send anonymous HW statistics" msgstr "" #. I18N: ./data/gui/online/create_server.stkgui #. I18N: In the server creation screen -#: data/po/gui_strings.h:419 +#: data/po/gui_strings.h:591 msgid "Server Creation" msgstr "" #. I18N: ./data/gui/online/server_info_dialog.stkgui #. I18N: In the server info dialog -#: data/po/gui_strings.h:326 +#: data/po/gui_strings.h:651 msgid "Server Info" msgstr "" #. I18N: ./data/gui/online/server_selection.stkgui -#: data/po/gui_strings.h:519 +#: data/po/gui_strings.h:484 msgid "Server Selection" msgstr "" #. I18N: ./data/gui/online/lobby.stkgui #. I18N: In the networking lobby -#: data/po/gui_strings.h:551 +#: data/po/gui_strings.h:524 msgid "Server name :" msgstr "" @@ -2474,13 +2477,13 @@ msgstr "" #. I18N: ./data/gui/race_paused_dialog.stkgui #. I18N: Race paused button -#: src/states_screens/race_result_gui.cpp:198 data/po/gui_strings.h:671 +#: src/states_screens/race_result_gui.cpp:198 data/po/gui_strings.h:863 msgid "Setup New Race" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:725 +#: data/po/gui_strings.h:766 msgid "Shadows" msgstr "" @@ -2494,19 +2497,19 @@ msgstr "" #. I18N: Tab in login menu #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: In the login dialog -#: data/po/gui_strings.h:377 data/po/gui_strings.h:397 +#: data/po/gui_strings.h:539 data/po/gui_strings.h:559 msgid "Sign In" msgstr "" #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: Tab in login menu -#: data/po/gui_strings.h:381 +#: data/po/gui_strings.h:543 msgid "Sign In As Guest" msgstr "" #. I18N: ./data/gui/online/main.stkgui #. I18N: In the online multiplayer screen -#: data/po/gui_strings.h:543 +#: data/po/gui_strings.h:431 msgid "Sign Out" msgstr "" @@ -2526,7 +2529,7 @@ msgstr "" #. I18N: ./data/gui/online/guest_login.stkgui #. I18N: In the login dialog -#: data/po/gui_strings.h:393 +#: data/po/gui_strings.h:555 msgid "" "Signing in as a guest allows you to participate in online races, but it does " "not allow you to vote for addons, or collect any achievements while being " @@ -2548,7 +2551,7 @@ msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: Main menu button -#: data/po/gui_strings.h:956 +#: data/po/gui_strings.h:103 msgid "Singleplayer" msgstr "" @@ -2564,7 +2567,7 @@ msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: In the ui settings -#: data/po/gui_strings.h:799 +#: data/po/gui_strings.h:1065 msgid "Skin" msgstr "" @@ -2575,14 +2578,14 @@ msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1224 +#: data/po/gui_strings.h:1004 msgid "" "Soccer: Only in multiplayer games. Use your kart to push the ball into the " "goal." msgstr "" +#: src/states_screens/main_menu_screen.cpp:550 #: src/states_screens/addons_screen.cpp:514 -#: src/states_screens/main_menu_screen.cpp:546 msgid "" "Sorry, an error occurred while contacting the add-ons website. Make sure you " "are connected to the Internet and that SuperTuxKart is not blocked by a " @@ -2595,20 +2598,21 @@ msgstr "" #. I18N: ./data/gui/options_audio.stkgui #. I18N: In the audio options screen -#: data/po/gui_strings.h:67 +#: data/po/gui_strings.h:237 msgid "Sound Effects" msgstr "" -#. I18N: ./data/gui/easter_egg.stkgui -#. I18N: track group #. I18N: ./data/gui/arenas.stkgui #. I18N: track group +#. I18N: ./data/gui/easter_egg.stkgui +#. I18N: track group #: src/states_screens/grand_prix_editor_screen.cpp:334 -#: data/po/gui_strings.h:284 data/po/gui_strings.h:1063 +#: data/po/gui_strings.h:1221 data/po/gui_strings.h:1257 msgid "Standard" msgstr "" -#: src/input/gamepad_config.cpp:204 +#. I18N: name of buttons on gamepads +#: src/input/gamepad_config.cpp:218 msgid "Start" msgstr "" @@ -2616,11 +2620,11 @@ msgstr "" msgid "Start Grand Prix" msgstr "" -#. I18N: ./data/gui/gp_info.stkgui -#. I18N: In the grand prix info screen #. I18N: ./data/gui/track_info.stkgui #. I18N: In the track info screen -#: data/po/gui_strings.h:142 data/po/gui_strings.h:233 +#. I18N: ./data/gui/gp_info.stkgui +#. I18N: In the grand prix info screen +#: data/po/gui_strings.h:39 data/po/gui_strings.h:163 msgid "Start Race" msgstr "" @@ -2640,59 +2644,59 @@ msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: Main menu button -#: data/po/gui_strings.h:952 +#: data/po/gui_strings.h:99 msgid "Story Mode" msgstr "" -#. I18N: ./data/gui/online/recovery_input.stkgui -#. I18N: In the recovery dialog #. I18N: ./data/gui/online/change_password.stkgui #. I18N: In the change password dialog -#: data/po/gui_strings.h:494 data/po/gui_strings.h:605 +#. I18N: ./data/gui/online/recovery_input.stkgui +#. I18N: In the recovery dialog +#: data/po/gui_strings.h:451 data/po/gui_strings.h:474 msgid "Submit" msgstr "" #. I18N: ./data/gui/racesetup.stkgui #. I18N: Difficulty -#: data/po/gui_strings.h:1254 +#: data/po/gui_strings.h:752 msgid "SuperTux" msgstr "" #. I18N: ./data/gui/addons_screen.stkgui -#: data/po/gui_strings.h:1031 +#: data/po/gui_strings.h:1268 msgid "SuperTuxKart Addons" msgstr "" -#. I18N: ./data/gui/help4.stkgui -#. I18N: ./data/gui/help1.stkgui #. I18N: ./data/gui/help2.stkgui +#. I18N: ./data/gui/help1.stkgui +#. I18N: ./data/gui/help4.stkgui #. I18N: ./data/gui/help3.stkgui -#: data/po/gui_strings.h:167 data/po/gui_strings.h:1085 -#: data/po/gui_strings.h:1131 data/po/gui_strings.h:1185 +#: data/po/gui_strings.h:320 data/po/gui_strings.h:886 +#: data/po/gui_strings.h:932 data/po/gui_strings.h:965 msgid "SuperTuxKart Help" msgstr "" -#. I18N: ./data/gui/options_audio.stkgui -#. I18N: ./data/gui/options_input.stkgui #. I18N: ./data/gui/user_screen_tab.stkgui -#. I18N: ./data/gui/options_video.stkgui -#. I18N: ./data/gui/options_device.stkgui -#. I18N: ./data/gui/options_ui.stkgui +#. I18N: ./data/gui/options_audio.stkgui #. I18N: ./data/gui/options_players.stkgui -#: data/po/gui_strings.h:47 data/po/gui_strings.h:149 -#: data/po/gui_strings.h:236 data/po/gui_strings.h:628 -#: data/po/gui_strings.h:702 data/po/gui_strings.h:791 -#: data/po/gui_strings.h:933 +#. I18N: ./data/gui/options_input.stkgui +#. I18N: ./data/gui/options_ui.stkgui +#. I18N: ./data/gui/options_device.stkgui +#. I18N: ./data/gui/options_video.stkgui +#: data/po/gui_strings.h:170 data/po/gui_strings.h:217 +#: data/po/gui_strings.h:302 data/po/gui_strings.h:1039 +#: data/po/gui_strings.h:1057 data/po/gui_strings.h:1140 +#: data/po/gui_strings.h:1181 msgid "SuperTuxKart Options" msgstr "" #. I18N: ./data/gui/help4.stkgui -#: data/po/gui_strings.h:186 +#: data/po/gui_strings.h:951 msgid "SuperTuxKart can be played in multiplayer mode on the same computer" msgstr "" #. I18N: ./data/gui/help3.stkgui -#: data/po/gui_strings.h:1204 +#: data/po/gui_strings.h:984 msgid "SuperTuxKart features several game modes" msgstr "" @@ -2707,14 +2711,14 @@ msgid "" msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1172 +#: data/po/gui_strings.h:361 msgid "" "Swapper - gift boxes are transformed into bananas and vice versa for a short " "time." msgstr "" #. I18N: ./data/gui/help2.stkgui -#: data/po/gui_strings.h:1178 +#: data/po/gui_strings.h:367 msgid "Swatter - will squash karts close by, slowing them down." msgstr "" @@ -2723,61 +2727,31 @@ msgstr "" msgid "System Language" msgstr "" -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:974 -msgid "TEST: GPLose" -msgstr "" - -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:971 -msgid "TEST: GPWin" -msgstr "" - -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:983 -msgid "TEST: Intro" -msgstr "" - -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:986 -msgid "TEST: Outro" -msgstr "" - -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:977 -msgid "TEST: Unlocked" -msgstr "" - -#. I18N: ./data/gui/main.stkgui -#: data/po/gui_strings.h:980 -msgid "TEST: Unlocked 2" -msgstr "" - #. I18N: ./data/gui/online/registration_terms.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:613 +#: data/po/gui_strings.h:567 msgid "Terms and Agreement" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:769 +#: data/po/gui_strings.h:810 msgid "Texture compression" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:781 +#: data/po/gui_strings.h:822 msgid "Texture filtering" msgstr "" #. I18N: ./data/gui/help1.stkgui #. I18N: in the help menu -#: data/po/gui_strings.h:1124 +#: data/po/gui_strings.h:925 msgid "The 'skidding' key allows you to skid in sharp turns and get a boost." msgstr "" -#: src/states_screens/main_menu_screen.cpp:541 +#: src/states_screens/main_menu_screen.cpp:545 msgid "The add-ons module is currently disabled in the Options screen" msgstr "" @@ -2798,7 +2772,7 @@ msgstr "" #. I18N: ./data/gui/help3.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1212 +#: data/po/gui_strings.h:992 msgid "Time Trial: Contains no powerups, so only your driving skills matter!" msgstr "" @@ -2816,12 +2790,12 @@ msgstr "" #. I18N: ./data/gui/help2.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:1151 +#: data/po/gui_strings.h:340 msgid "To help you win, there are some powerups you can collect :" msgstr "" #. I18N: ./data/grandprix/3_tothemoonandback.grandprix -#: data/po/gui_strings.h:5 data/po/gui_strings.h:1323 +#: data/po/gui_strings.h:11 data/po/gui_strings.h:1300 msgid "To the moon and back" msgstr "" @@ -2854,7 +2828,7 @@ msgstr "" #. I18N: ./data/gui/gp_info.stkgui #. I18N: In the grand prix info screen -#: data/po/gui_strings.h:138 +#: data/po/gui_strings.h:159 msgid "Track group" msgstr "" @@ -2862,7 +2836,7 @@ msgstr "" #. I18N: In the grand prix info screen #. I18N: ./data/gui/addons_screen.stkgui #. I18N: In the addons screen -#: data/po/gui_strings.h:134 data/po/gui_strings.h:1047 +#: data/po/gui_strings.h:155 data/po/gui_strings.h:1284 msgid "Tracks" msgstr "" @@ -2870,30 +2844,30 @@ msgstr "" msgid "Trilinear" msgstr "" -#: src/states_screens/dialogs/addons_loading.cpp:370 -#: src/states_screens/dialogs/addons_loading.cpp:409 +#: src/states_screens/dialogs/addons_loading.cpp:369 +#: src/states_screens/dialogs/addons_loading.cpp:406 msgid "Try again" msgstr "" #. I18N: ./data/gui/main.stkgui #. I18N: In the main screen -#: src/states_screens/race_gui_overworld.cpp:457 data/po/gui_strings.h:998 +#: src/states_screens/race_gui_overworld.cpp:455 data/po/gui_strings.h:127 msgid "Tutorial" msgstr "" #. I18N: ./data/gui/tutorial.stkgui #. I18N: Title for tutorials screen -#: data/po/gui_strings.h:1075 +#: data/po/gui_strings.h:249 msgid "Tutorial : Selection Room" msgstr "" #. I18N: ./data/gui/select_challenge.stkgui #. I18N: Type of race, in a challenge -#: data/po/gui_strings.h:18 +#: data/po/gui_strings.h:382 msgid "Type :" msgstr "" -#: src/states_screens/race_gui_overworld.cpp:504 +#: src/states_screens/race_gui_overworld.cpp:502 msgid "Type: Grand Prix" msgstr "" @@ -2905,7 +2879,7 @@ msgstr "" #. I18N: ./data/gui/addons_loading.stkgui #. I18N: Add-on screen action -#: data/po/gui_strings.h:98 +#: data/po/gui_strings.h:1241 msgid "Uninstall" msgstr "" @@ -2920,7 +2894,7 @@ msgstr "" #. I18N: ./data/gui/addons_screen.stkgui #. I18N: In addons screen, in the filtering bar, to enable a filter that will show only recently updated items -#: data/po/gui_strings.h:1035 +#: data/po/gui_strings.h:1272 msgid "Updated" msgstr "" @@ -2930,34 +2904,34 @@ msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:773 +#: data/po/gui_strings.h:814 msgid "Use high definition textures" msgstr "" #. I18N: ./data/gui/soccer_setup.stkgui #. I18N: In soccer setup screen -#: data/po/gui_strings.h:1282 +#: data/po/gui_strings.h:62 msgid "Use left/right to choose your team and press fire" msgstr "" -#: src/tracks/track_object_presentation.cpp:919 +#: src/tracks/track_object_presentation.cpp:922 #, c-format msgid "Use the nitro you collected by pressing <%s>!" msgstr "" #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog' dialog -#: data/po/gui_strings.h:342 +#: data/po/gui_strings.h:488 msgid "User Info" msgstr "" #. I18N: ./data/gui/options_ui.stkgui #. I18N: Section in the settings menu -#: src/states_screens/options_screen_input2.cpp:87 -#: src/states_screens/options_screen_input.cpp:140 -#: src/states_screens/options_screen_audio.cpp:65 #: src/states_screens/user_screen.cpp:593 -#: src/states_screens/options_screen_video.cpp:137 data/po/gui_strings.h:795 +#: src/states_screens/options_screen_input2.cpp:87 +#: src/states_screens/options_screen_audio.cpp:65 +#: src/states_screens/options_screen_video.cpp:137 +#: src/states_screens/options_screen_input.cpp:140 data/po/gui_strings.h:1061 msgid "User Interface" msgstr "" @@ -2966,19 +2940,19 @@ msgid "User defined" msgstr "" #. I18N: ./data/gui/online/user_search.stkgui -#: data/po/gui_strings.h:501 +#: data/po/gui_strings.h:397 msgid "User search" msgstr "" #. I18N: ./data/gui/user_screen_tab.stkgui #. I18N: In the user screen -#. I18N: ./data/gui/online/recovery_input.stkgui -#. I18N: In the recovery dialog #. I18N: ./data/gui/user_screen.stkgui #. I18N: In the user screen +#. I18N: ./data/gui/online/recovery_input.stkgui +#. I18N: In the recovery dialog #: src/states_screens/online_user_search.cpp:74 -#: src/states_screens/online_profile_friends.cpp:67 data/po/gui_strings.h:252 -#: data/po/gui_strings.h:486 data/po/gui_strings.h:906 +#: src/states_screens/online_profile_friends.cpp:67 data/po/gui_strings.h:186 +#: data/po/gui_strings.h:275 data/po/gui_strings.h:466 msgid "Username" msgstr "" @@ -2987,7 +2961,7 @@ msgid "Username and/or email address invalid." msgstr "" #. I18N: ./data/gui/soccer_setup.stkgui -#: data/po/gui_strings.h:1285 +#: data/po/gui_strings.h:65 msgid "VS" msgstr "" @@ -3004,27 +2978,27 @@ msgstr "" #. I18N: ./data/gui/options_video.stkgui #. I18N: In the video settings -#: data/po/gui_strings.h:644 +#: data/po/gui_strings.h:1197 msgid "Vertical Sync (requires restart)" msgstr "" -#. I18N: ./data/gui/online/notification_dialog.stkgui -#. I18N: User info dialog #. I18N: ./data/gui/online/user_info_dialog.stkgui #. I18N: User info dialog -#: data/po/gui_strings.h:318 data/po/gui_strings.h:366 +#. I18N: ./data/gui/online/notification_dialog.stkgui +#. I18N: User info dialog +#: data/po/gui_strings.h:512 data/po/gui_strings.h:667 msgid "View" msgstr "" #. I18N: ./data/gui/options_audio.stkgui #. I18N: In the audio options screen -#: data/po/gui_strings.h:63 data/po/gui_strings.h:75 +#: data/po/gui_strings.h:233 data/po/gui_strings.h:245 msgid "Volume" msgstr "" #. I18N: ./data/gui/online/vote_dialog.stkgui #. I18N: In the vote dialog -#: data/po/gui_strings.h:303 +#: data/po/gui_strings.h:583 msgid "Vote" msgstr "" @@ -3043,22 +3017,22 @@ msgid "" "working." msgstr "" -#. I18N: ./data/gui/help4.stkgui +#. I18N: ./data/gui/help2.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help1.stkgui #. I18N: Tab in help menu -#. I18N: ./data/gui/help2.stkgui +#. I18N: ./data/gui/help4.stkgui #. I18N: Tab in help menu #. I18N: ./data/gui/help3.stkgui #. I18N: Tab in help menu -#: data/po/gui_strings.h:175 data/po/gui_strings.h:1093 -#: data/po/gui_strings.h:1139 data/po/gui_strings.h:1193 +#: data/po/gui_strings.h:328 data/po/gui_strings.h:894 +#: data/po/gui_strings.h:940 data/po/gui_strings.h:973 msgid "Weapons" msgstr "" #. I18N: ./data/gui/custom_video_settings.stkgui #. I18N: Video settings -#: data/po/gui_strings.h:761 +#: data/po/gui_strings.h:802 msgid "Weather Effects" msgstr "" @@ -3070,7 +3044,7 @@ msgstr "" #. I18N: ./data/gui/help4.stkgui #. I18N: In the help menu -#: data/po/gui_strings.h:197 +#: data/po/gui_strings.h:962 msgid "" "When input devices are configured, you are ready to play. Select the " "'multiplayer race' icon in the main menu. When it is time to choose a kart, " @@ -3087,16 +3061,16 @@ msgstr "" #. I18N: ./data/gui/confirm_dialog.stkgui #. I18N: In a 'are you sure?' dialog -#: src/states_screens/edit_gp_screen.cpp:253 data/po/gui_strings.h:201 +#: src/states_screens/edit_gp_screen.cpp:253 data/po/gui_strings.h:91 msgid "Yes" msgstr "" -#: src/tracks/track_object_presentation.cpp:958 +#: src/tracks/track_object_presentation.cpp:961 msgid "You are now ready to race. Good luck!" msgstr "" #. I18N: ./data/gui/options_players.stkgui -#: data/po/gui_strings.h:940 +#: data/po/gui_strings.h:309 msgid "You are playing as" msgstr "" @@ -3120,7 +3094,7 @@ msgstr "" #. I18N: ./data/gui/online/register.stkgui #. I18N: In the registration dialog -#: data/po/gui_strings.h:467 +#: data/po/gui_strings.h:639 msgid "" "You can play without creating an online account by unchecking the online " "checkbox, though then you can not connect to friends, vote for addons etc. " @@ -3129,8 +3103,8 @@ msgid "" "supertuxkart.net" msgstr "" -#: src/states_screens/grand_prix_win.cpp:125 #: src/states_screens/race_result_gui.cpp:164 +#: src/states_screens/grand_prix_win.cpp:125 msgid "You completed a challenge!" msgstr "" @@ -3204,7 +3178,7 @@ msgstr "" #. I18N: ./data/gui/online/recovery_info.stkgui #. I18N: In the recovery dialog -#: data/po/gui_strings.h:567 +#: data/po/gui_strings.h:719 msgid "" "You will receive an email with further instructions on how to reset your " "password. Please be patient and be sure to check your spam folder." @@ -3236,7 +3210,8 @@ msgstr "" msgid "Your input config file is not compatible with this version of STK." msgstr "" -#: src/states_screens/online_profile_base.cpp:99 +#: src/states_screens/online_profile_base.cpp:105 +#: src/states_screens/online_profile_base.cpp:115 msgid "Your profile" msgstr "" @@ -3247,7 +3222,7 @@ msgstr "" #. I18N: ./data/gui/online/lobby.stkgui #. I18N: In networking lobby -#: data/po/gui_strings.h:555 +#: data/po/gui_strings.h:528 msgid "actions" msgstr "" @@ -3268,13 +3243,13 @@ msgstr "" msgid "low" msgstr "" -#. I18N: arena group name #. I18N: track group name #. I18N: kart group name +#. I18N: arena group name #. I18N: track group name -#: src/states_screens/arenas_screen.cpp:81 #: src/states_screens/tracks_screen.cpp:152 #: src/states_screens/kart_selection.cpp:284 +#: src/states_screens/arenas_screen.cpp:81 #: src/states_screens/easter_egg_screen.cpp:143 msgid "standard" msgstr "" From 8a2128fe7eafbb731bb10617f093f0461fa1b1fe Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Fri, 5 Dec 2014 19:55:24 -0500 Subject: [PATCH 12/40] Cleanup additive material detection --- src/graphics/stkmesh.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/graphics/stkmesh.cpp b/src/graphics/stkmesh.cpp index cd3fb7fa7..3047c0876 100644 --- a/src/graphics/stkmesh.cpp +++ b/src/graphics/stkmesh.cpp @@ -34,11 +34,7 @@ TransparentMaterial MaterialTypeToTransparentMaterial(video::E_MATERIAL_TYPE typ { if (type == irr_driver->getShader(ES_DISPLACE)) return TM_DISPLACEMENT; - video::E_BLEND_FACTOR srcFact, DstFact; - video::E_MODULATE_FUNC mod; - u32 alpha; - unpack_textureBlendFunc(srcFact, DstFact, mod, alpha, MaterialTypeParam); - if (DstFact == video::EBF_ONE || type == video::EMT_TRANSPARENT_ADD_COLOR) + if (material->getShaderType() == Material::SHADERTYPE_ADDITIVE) return TM_ADDITIVE; return TM_DEFAULT; } From 7367342755cc056381a83a4192110f730f02b821 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sat, 6 Dec 2014 02:06:59 +0100 Subject: [PATCH 13/40] Fix split_stream wrong blending op "immediate_draw" objects were assumed to be always blended but splitstream is additive. --- src/graphics/stkmeshscenenode.cpp | 7 ++++++- src/graphics/stkmeshscenenode.hpp | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/graphics/stkmeshscenenode.cpp b/src/graphics/stkmeshscenenode.cpp index 418c34e4c..d609dd6bd 100644 --- a/src/graphics/stkmeshscenenode.cpp +++ b/src/graphics/stkmeshscenenode.cpp @@ -142,6 +142,8 @@ void STKMeshSceneNode::updateNoGL() TransparentMaterial TranspMat = MaterialTypeToTransparentMaterial(type, MaterialTypeParam, material); if (!immediate_draw) TransparentMesh[TranspMat].push_back(&mesh); + else + additive = (TranspMat == TM_ADDITIVE); } else { @@ -370,7 +372,10 @@ void STKMeshSceneNode::render() { if (update_each_frame) updatevbo(); - glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + if (additive) + glBlendFunc(GL_ONE, GL_ONE); + else + glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); if (World::getWorld() && World::getWorld()->isFogEnabled()) { diff --git a/src/graphics/stkmeshscenenode.hpp b/src/graphics/stkmeshscenenode.hpp index d247b9cc0..bdebe8788 100644 --- a/src/graphics/stkmeshscenenode.hpp +++ b/src/graphics/stkmeshscenenode.hpp @@ -21,6 +21,7 @@ protected: bool isMaterialInitialized; bool isGLInitialized; bool immediate_draw; + bool additive; bool update_each_frame; bool isDisplacement; bool isGlow; From 68db893e8482ac37e1e0515f7d1ad332f0cb172e Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Fri, 5 Dec 2014 21:11:56 -0500 Subject: [PATCH 14/40] Message dialog: set buttons text before layout occurs, so that buttons get the proper size. Fixes #1764 --- src/states_screens/dialogs/message_dialog.cpp | 18 ++++++++++-------- src/states_screens/dialogs/message_dialog.hpp | 4 ++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/src/states_screens/dialogs/message_dialog.cpp b/src/states_screens/dialogs/message_dialog.cpp index 075774013..15feb9d50 100644 --- a/src/states_screens/dialogs/message_dialog.cpp +++ b/src/states_screens/dialogs/message_dialog.cpp @@ -68,25 +68,28 @@ MessageDialog::~MessageDialog() // ------------------------------------------------------------------------------------------------------ void MessageDialog::doInit(MessageDialogType type, - IConfirmDialogListener* listener, bool own_listener) + IConfirmDialogListener* listener, bool own_listener) { if (StateManager::get()->getGameState() == GUIEngine::GAME) { World::getWorld()->schedulePause(World::IN_GAME_MENU_PHASE); } - - loadFromFile("confirm_dialog.stkgui"); - + m_type = type; m_listener = listener; m_own_listener = own_listener; + loadFromFile("confirm_dialog.stkgui"); +} + +void MessageDialog::loadedFromFile() +{ LabelWidget* message = getWidget("title"); message->setText( m_msg.c_str(), false ); // If the dialog is a simple 'OK' dialog, then hide the "Yes" button and // change "Cancel" to "OK" - if (type == MessageDialog::MESSAGE_DIALOG_OK) + if (m_type == MessageDialog::MESSAGE_DIALOG_OK) { ButtonWidget* yesbtn = getWidget("confirm"); yesbtn->setVisible(false); @@ -95,13 +98,13 @@ void MessageDialog::doInit(MessageDialogType type, cancelbtn->setText(_("OK")); cancelbtn->setFocusForPlayer(PLAYER_ID_GAME_MASTER); } - else if (type == MessageDialog::MESSAGE_DIALOG_YESNO) + else if (m_type == MessageDialog::MESSAGE_DIALOG_YESNO) { ButtonWidget* cancelbtn = getWidget("cancel"); cancelbtn->setText(_("No")); } - else if (type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL) + else if (m_type == MessageDialog::MESSAGE_DIALOG_OK_CANCEL) { // In case of a OK_CANCEL dialog, change the text from 'Yes' to 'Ok' ButtonWidget* yesbtn = getWidget("confirm"); @@ -109,7 +112,6 @@ void MessageDialog::doInit(MessageDialogType type, } } - // ------------------------------------------------------------------------------------------------------ void MessageDialog::onEnterPressedInternal() diff --git a/src/states_screens/dialogs/message_dialog.hpp b/src/states_screens/dialogs/message_dialog.hpp index 05dfda475..fb39b6d8e 100644 --- a/src/states_screens/dialogs/message_dialog.hpp +++ b/src/states_screens/dialogs/message_dialog.hpp @@ -64,6 +64,8 @@ public: enum MessageDialogType { MESSAGE_DIALOG_OK, MESSAGE_DIALOG_CONFIRM, MESSAGE_DIALOG_OK_CANCEL, MESSAGE_DIALOG_YESNO }; + MessageDialogType m_type; + private: IConfirmDialogListener* m_listener; @@ -96,6 +98,8 @@ public: virtual void load(); GUIEngine::EventPropagation processEvent(const std::string& eventSource); + + virtual void loadedFromFile(); }; From 6d88a6547bd13b9ddf8e9eeb564bbcc165680b55 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sat, 6 Dec 2014 21:17:46 +0100 Subject: [PATCH 15/40] Fix GI viz --- src/graphics/render.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index 2ce4f441d..ee278aa9f 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -440,12 +440,14 @@ void IrrDriver::renderScene(scene::ICameraSceneNode * const camnode, unsigned po if (getRH()) { + glDisable(GL_BLEND); m_rtts->getFBO(FBO_COLORS).Bind(); m_post_processing->renderRHDebug(m_rtts->getRH().getRTT()[0], m_rtts->getRH().getRTT()[1], m_rtts->getRH().getRTT()[2], rh_matrix, rh_extend); } if (getGI()) { + glDisable(GL_BLEND); m_rtts->getFBO(FBO_COLORS).Bind(); m_post_processing->renderGI(rh_matrix, rh_extend, m_rtts->getRH().getRTT()[0], m_rtts->getRH().getRTT()[1], m_rtts->getRH().getRTT()[2]); } From 1bd83f41401e46852e5603a7c200edaf67e15560 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sat, 6 Dec 2014 23:20:46 +0100 Subject: [PATCH 16/40] Use omp for IBL gen + force some typecast --- src/graphics/IBL.cpp | 22 ++++++++++++---------- src/graphics/render_skybox.cpp | 2 +- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp index 71e7b854e..38efe5f5b 100644 --- a/src/graphics/IBL.cpp +++ b/src/graphics/IBL.cpp @@ -46,18 +46,19 @@ static void getXYZ(GLenum face, float i, float j, float &x, float &y, float &z) } -static void getYml(GLenum face, size_t width, size_t height, +static void getYml(GLenum face, size_t edge_size, float *Y00, float *Y1minus1, float *Y10, float *Y11, float *Y2minus2, float *Y2minus1, float *Y20, float *Y21, float *Y22) { - for (unsigned i = 0; i < width; i++) +#pragma omp parallel for + for (int i = 0; i < int(edge_size); i++) { - for (unsigned j = 0; j < height; j++) + for (unsigned j = 0; j < edge_size; j++) { float x, y, z; float fi = float(i), fj = float(j); - fi /= width, fj /= height; + fi /= edge_size, fj /= edge_size; fi = 2 * fi - 1, fj = 2 * fj - 1; getXYZ(face, fi, fj, x, y, z); @@ -72,7 +73,7 @@ static void getYml(GLenum face, size_t width, size_t height, float c20 = 0.315392f; float c22 = 0.546274f; - size_t idx = i * height + j; + size_t idx = i * edge_size + j; Y00[idx] = c00; Y1minus1[idx] = c1minus1 * y; @@ -105,11 +106,12 @@ static void projectSH(Color *CubemapFace[6], size_t edge_size, float wh = float(edge_size * edge_size); for (unsigned face = 0; face < 6; face++) { - for (unsigned i = 0; i < edge_size; i++) +#pragma omp parallel for + for (int i = 0; i < int(edge_size); i++) { for (unsigned j = 0; j < edge_size; j++) { - size_t idx = i * edge_size + j; + int idx = i * edge_size + j; float fi = float(i), fj = float(j); fi /= edge_size, fj /= edge_size; fi = 2 * fi - 1, fj = 2 * fj - 1; @@ -183,7 +185,7 @@ void SphericalHarmonics(Color *CubemapFace[6], size_t edge_size, float *blueSHCo Y21[face] = new float[edge_size * edge_size]; Y22[face] = new float[edge_size * edge_size]; - getYml(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, edge_size, edge_size, Y00[face], Y1minus1[face], Y10[face], Y11[face], Y2minus2[face], Y2minus1[face], Y20[face], Y21[face], Y22[face]); + getYml(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, edge_size, Y00[face], Y1minus1[face], Y10[face], Y11[face], Y2minus2[face], Y2minus1[face], Y20[face], Y21[face], Y22[face]); } projectSH(CubemapFace, edge_size, @@ -284,8 +286,8 @@ GLuint generateSpecularCubemap(GLuint probe) { // Blinn Phong can be approximated by Phong with 4x the specular coefficient // See http://seblagarde.wordpress.com/2012/03/29/relationship-between-phong-and-blinn-lighting-model/ - float roughness = (8 - level) * 4 * pow(2., 10.) / 8.; - float viewportSize = 1 << (8 - level); + float roughness = (8 - level) * 4 * pow(2.f, 10.f) / 8.f; + float viewportSize = float(1 << (8 - level)); std::vector Samples; for (unsigned i = 0; i < 1024; i++) diff --git a/src/graphics/render_skybox.cpp b/src/graphics/render_skybox.cpp index c408636d5..ef7ca122f 100644 --- a/src/graphics/render_skybox.cpp +++ b/src/graphics/render_skybox.cpp @@ -332,7 +332,7 @@ void IrrDriver::generateDiffuseCoefficients() { sh_rgba[i] = new unsigned char[sh_w * sh_h * 4]; - for (int j = 0; j < sh_w * sh_h * 4; j += 4) + for (unsigned j = 0; j < sh_w * sh_h * 4; j += 4) { sh_rgba[i][j] = ambient.getBlue(); sh_rgba[i][j + 1] = ambient.getGreen(); From 7686628401604098266f9f078194fac291592532 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Sat, 6 Dec 2014 19:51:46 -0500 Subject: [PATCH 17/40] Allow animated meshes in LOD, fixes #1747 --- src/tracks/model_definition_loader.cpp | 61 ++++++++++++++++++-------- src/tracks/model_definition_loader.hpp | 8 +++- 2 files changed, 48 insertions(+), 21 deletions(-) diff --git a/src/tracks/model_definition_loader.cpp b/src/tracks/model_definition_loader.cpp index c6c29a17b..14fe029e2 100644 --- a/src/tracks/model_definition_loader.cpp +++ b/src/tracks/model_definition_loader.cpp @@ -45,13 +45,13 @@ void ModelDefinitionLoader::addModelDefinition(const XMLNode* xml) std::string lodgroup; xml->get("lod_group", &lodgroup); - bool tangent = false; - xml->get("tangents", &tangent); + bool skeletal_animation = false; + xml->get("skeletal-animation", &skeletal_animation); std::string model_name; xml->get("model", &model_name); - m_lod_groups[lodgroup].push_back(ModelDefinition(xml, (int)lod_distance, model_name, tangent)); + m_lod_groups[lodgroup].push_back(ModelDefinition(xml, (int)lod_distance, model_name, false, skeletal_animation)); } // ---------------------------------------------------------------------------- @@ -72,28 +72,51 @@ LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISc lod_node->updateAbsolutePosition(); for (unsigned int m=0; mgetMesh(group[m].m_model_file); - - if (!a_mesh) + if (group[m].m_skeletal_animation) { - Log::warn("LODNodeLoad", "Warning: object model '%s' not found, ignored.\n", - group[m].m_model_file.c_str()); - continue; + scene::IAnimatedMesh* a_mesh = irr_driver->getAnimatedMesh(group[m].m_model_file); + if (!a_mesh) + { + Log::warn("LODNodeLoad", "Warning: object model '%s' not found, ignored.\n", + group[m].m_model_file.c_str()); + continue; + } + + irr_driver->setAllMaterialFlags(a_mesh); + + a_mesh->grab(); + //cache.push_back(a_mesh); + irr_driver->grabAllTextures(a_mesh); + m_track->addCachedMesh(a_mesh); + scene::IAnimatedMeshSceneNode* scene_node = irr_driver->addAnimatedMesh(a_mesh, group[m].m_model_file); + + m_track->handleAnimatedTextures(scene_node, *group[m].m_xml); + + lod_node->add(group[m].m_distance, scene_node, true); } + else + { + scene::IMesh* a_mesh = irr_driver->getMesh(group[m].m_model_file); + if (!a_mesh) + { + Log::warn("LODNodeLoad", "Warning: object model '%s' not found, ignored.\n", + group[m].m_model_file.c_str()); + continue; + } - a_mesh = MeshTools::createMeshWithTangents(a_mesh, &MeshTools::isNormalMap); - irr_driver->setAllMaterialFlags(a_mesh); + a_mesh = MeshTools::createMeshWithTangents(a_mesh, &MeshTools::isNormalMap); + irr_driver->setAllMaterialFlags(a_mesh); - a_mesh->grab(); - //cache.push_back(a_mesh); - irr_driver->grabAllTextures(a_mesh); - m_track->addCachedMesh(a_mesh); - scene::IMeshSceneNode* scene_node = irr_driver->addMesh(a_mesh, group[m].m_model_file); + a_mesh->grab(); + //cache.push_back(a_mesh); + irr_driver->grabAllTextures(a_mesh); + m_track->addCachedMesh(a_mesh); + scene::IMeshSceneNode* scene_node = irr_driver->addMesh(a_mesh, group[m].m_model_file); - m_track->handleAnimatedTextures( scene_node, *group[m].m_xml ); + m_track->handleAnimatedTextures(scene_node, *group[m].m_xml); - lod_node->add( group[m].m_distance, scene_node, true ); + lod_node->add(group[m].m_distance, scene_node, true); + } } #ifdef DEBUG diff --git a/src/tracks/model_definition_loader.hpp b/src/tracks/model_definition_loader.hpp index f7c669362..bc4f48dcb 100644 --- a/src/tracks/model_definition_loader.hpp +++ b/src/tracks/model_definition_loader.hpp @@ -42,26 +42,30 @@ namespace irr struct ModelDefinition { std::string m_model_file; - bool m_tangent; + bool m_tangent; // obsolete, TODO remove const XMLNode* m_xml; /** For LOD */ int m_distance; + bool m_skeletal_animation; + /** Constructor to allow storing this in STL containers */ ModelDefinition() { m_tangent = false; + m_skeletal_animation = false; m_distance = 0; m_xml = NULL; } - ModelDefinition(const XMLNode* xml, int distance, std::string& model, bool tangent) + ModelDefinition(const XMLNode* xml, int distance, std::string& model, bool tangent, bool skeletal_animation) { m_model_file = model; m_tangent = tangent; m_xml = xml; m_distance = distance; + m_skeletal_animation = skeletal_animation; } ~ModelDefinition() From e491422bdc9e7a2c6bdc195147fe570fe5b92f62 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 7 Dec 2014 18:26:51 +0100 Subject: [PATCH 18/40] Weight sample in importance sampling --- data/shaders/importance_sampling_specular.frag | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag index 51549aa6f..eadddaa6d 100644 --- a/data/shaders/importance_sampling_specular.frag +++ b/data/shaders/importance_sampling_specular.frag @@ -16,15 +16,18 @@ void main(void) vec3 up = (RayDir.y < .99) ? vec3(0., 1., 0.) : vec3(0., 0., 1.); vec3 Tangent = normalize(cross(up, RayDir)); vec3 Bitangent = cross(RayDir, Tangent); + float weight = 0.; for (int i = 0; i < 1024; i++) { float Theta = samples[2 * i]; float Phi = samples[2 * i + 1]; - vec3 sampleDir = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; - FinalColor += textureLod(tex, sampleDir, 0.); + vec3 L = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; + float NdotL = clamp(dot(RayDir, L), 0., 1.); + FinalColor += textureLod(tex, L, 0.) * NdotL; + weight += NdotL; } - FragColor = FinalColor / 1024.; + FragColor = FinalColor / weight; } From 2e0bec57570c27a37630e98a721a79127ea6e7f5 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 7 Dec 2014 18:48:45 +0100 Subject: [PATCH 19/40] No need to signal the shader the AMD_vertex_shader_layer is enabled --- src/graphics/shaders.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 1b67a5546..4f64a4fb8 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -147,8 +147,6 @@ GLuint LoadShader(const char * file, unsigned type) char versionString[20]; sprintf(versionString, "#version %d\n", irr_driver->getGLSLVersion()); std::string Code = versionString; - if (irr_driver->hasVSLayerExtension()) - Code += "#extension GL_AMD_vertex_shader_layer : enable\n"; if (UserConfigParams::m_azdo) Code += "#extension GL_ARB_bindless_texture : enable\n"; else From a094bbae196df047124fa664c6f13a637e256c94 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 7 Dec 2014 19:10:22 +0100 Subject: [PATCH 20/40] Factorize DiffuseIBL and SpecularIBL --- data/shaders/IBL.frag | 41 ++++------------------------- data/shaders/utils/DiffuseIBL.frag | 32 ++++++++++++++++++++++ data/shaders/utils/SpecularIBL.frag | 11 ++++++++ src/graphics/shaders.cpp | 4 ++- 4 files changed, 51 insertions(+), 37 deletions(-) create mode 100644 data/shaders/utils/DiffuseIBL.frag create mode 100644 data/shaders/utils/SpecularIBL.frag diff --git a/data/shaders/IBL.frag b/data/shaders/IBL.frag index a638c3629..70e08e020 100644 --- a/data/shaders/IBL.frag +++ b/data/shaders/IBL.frag @@ -1,57 +1,26 @@ -uniform float blueLmn[9]; -uniform float greenLmn[9]; -uniform float redLmn[9]; uniform sampler2D ntex; uniform sampler2D dtex; -uniform samplerCube tex; -uniform mat4 TransposeViewMatrix; out vec4 Diff; out vec4 Spec; vec3 DecodeNormal(vec2 n); vec4 getPosFromUVDepth(vec3 uvDepth, mat4 InverseProjectionMatrix); - -mat4 getMatrix(float L[9]) -{ - float c1 = 0.429043, c2 = 0.511664, c3 = 0.743125, c4 = 0.886227, c5 = 0.247708; - - return mat4( - c1 * L[8] /*L22*/, c1 * L[4] /*L2-2*/, c1 * L[7] /*L21*/, c2 * L[3] /*L11*/, - c1 * L[4], - c1 * L[8], c1 * L[5] /*L2-1*/, c2 * L[1] /*L1-1*/, - c1 * L[7], c1 * L[5], c3 * L[6] /*L20*/, c2 * L[2] /*L10*/, - c2 * L[3], c2 * L[1], c2 * L[2], c4 * L[0] /*L00*/ - c5 * L[6] - ); -} +vec3 DiffuseIBL(vec3 normal); +vec3 SpecularIBL(vec3 normal, vec3 V, float roughness); void main(void) { vec2 uv = gl_FragCoord.xy / screen; vec3 normal = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.)); - // Convert normal in world space (where SH coordinates were computed) - vec4 extendednormal = TransposeViewMatrix * vec4(normal, 0.); - extendednormal.w = 1.; - mat4 rmat = getMatrix(redLmn); - mat4 gmat = getMatrix(greenLmn); - mat4 bmat = getMatrix(blueLmn); - - float r = dot(extendednormal, rmat * extendednormal); - float g = dot(extendednormal, gmat * extendednormal); - float b = dot(extendednormal, bmat * extendednormal); - - Diff = max(0.25 * vec4(r, g, b, .1), vec4(0.)); + Diff = vec4(0.25 * DiffuseIBL(normal), 1.); float z = texture(dtex, uv).x; vec4 xpos = getPosFromUVDepth(vec3(uv, z), InverseProjectionMatrix); vec3 eyedir = -normalize(xpos.xyz); - vec3 sampleDirection = reflect(-eyedir, normal); - sampleDirection = (InverseViewMatrix * vec4(sampleDirection, 0.)).xyz; - float specval = texture(ntex, uv).z; - // Assume 8 level of lod (ie 256x256 texture) - float lodval = 8. * (1. - specval); - vec4 specular = textureLod(tex, sampleDirection, lodval); - Spec = max(specular, vec4(0.)); + + Spec = vec4(SpecularIBL(normal, eyedir, specval), 1.); } diff --git a/data/shaders/utils/DiffuseIBL.frag b/data/shaders/utils/DiffuseIBL.frag new file mode 100644 index 000000000..0d4d14194 --- /dev/null +++ b/data/shaders/utils/DiffuseIBL.frag @@ -0,0 +1,32 @@ +uniform float blueLmn[9]; +uniform float greenLmn[9]; +uniform float redLmn[9]; +uniform mat4 TransposeViewMatrix; + +mat4 getMatrix(float L[9]) +{ + float c1 = 0.429043, c2 = 0.511664, c3 = 0.743125, c4 = 0.886227, c5 = 0.247708; + + return mat4( + c1 * L[8] /*L22*/, c1 * L[4] /*L2-2*/, c1 * L[7] /*L21*/, c2 * L[3] /*L11*/, + c1 * L[4], - c1 * L[8], c1 * L[5] /*L2-1*/, c2 * L[1] /*L1-1*/, + c1 * L[7], c1 * L[5], c3 * L[6] /*L20*/, c2 * L[2] /*L10*/, + c2 * L[3], c2 * L[1], c2 * L[2], c4 * L[0] /*L00*/ - c5 * L[6] + ); +} + +vec3 DiffuseIBL(vec3 normal) +{ + // Convert normal in world space (where SH coordinates were computed) + vec4 extendednormal = TransposeViewMatrix * vec4(normal, 0.); + extendednormal.w = 1.; + mat4 rmat = getMatrix(redLmn); + mat4 gmat = getMatrix(greenLmn); + mat4 bmat = getMatrix(blueLmn); + + float r = dot(extendednormal, rmat * extendednormal); + float g = dot(extendednormal, gmat * extendednormal); + float b = dot(extendednormal, bmat * extendednormal); + + return max(vec3(r, g, b), vec3(0.)); +} \ No newline at end of file diff --git a/data/shaders/utils/SpecularIBL.frag b/data/shaders/utils/SpecularIBL.frag new file mode 100644 index 000000000..04832dfa7 --- /dev/null +++ b/data/shaders/utils/SpecularIBL.frag @@ -0,0 +1,11 @@ +uniform samplerCube probe; + +vec3 SpecularIBL(vec3 normal, vec3 V, float roughness) +{ + vec3 sampleDirection = reflect(-V, normal); + sampleDirection = (InverseViewMatrix * vec4(sampleDirection, 0.)).xyz; + + // Assume 8 level of lod (ie 256x256 texture) + float lodval = 8. * (1. - roughness); + return textureLod(probe, sampleDirection, lodval).rgb; +} \ No newline at end of file diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 4f64a4fb8..c9a3c3569 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1649,9 +1649,11 @@ namespace FullScreenShader GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/decodeNormal.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/getPosFromUVDepth.frag").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/DiffuseIBL.frag").c_str(), + GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/utils/SpecularIBL.frag").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/IBL.frag").c_str()); AssignUniforms("TransposeViewMatrix", "blueLmn[0]", "greenLmn[0]", "redLmn[0]"); - AssignSamplerNames(Program, 0, "ntex", 1, "dtex", 2, "tex"); + AssignSamplerNames(Program, 0, "ntex", 1, "dtex", 2, "probe"); } ShadowedSunLightShader::ShadowedSunLightShader() From a320eebecebfb9cedc4a7e450a58c907050e136f Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 7 Dec 2014 21:27:26 +0100 Subject: [PATCH 21/40] Cleanup tonemap shader --- data/shaders/tonemap.frag | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/data/shaders/tonemap.frag b/data/shaders/tonemap.frag index 1ebd6c119..47832801a 100644 --- a/data/shaders/tonemap.frag +++ b/data/shaders/tonemap.frag @@ -1,9 +1,4 @@ -// From http://www.ceng.metu.edu.tr/~akyuz/files/hdrgpu.pdf - uniform sampler2D tex; -uniform sampler2D logluminancetex; -uniform float exposure = .09; -uniform float Lwhite = 1.; uniform float vignette_weight; out vec4 FragColor; @@ -11,25 +6,10 @@ out vec4 FragColor; vec3 getCIEYxy(vec3 rgbColor); vec3 getRGBFromCIEXxy(vec3 YxyColor); - -float delta = .0001; -float saturation = 1.; - void main() { vec2 uv = gl_FragCoord.xy / screen; vec4 col = texture(tex, uv); - float avgLw = textureLod(logluminancetex, uv, 10.).x; - avgLw = max(exp(avgLw) - delta, delta); - - vec3 Cw = getCIEYxy(col.xyz); - float Lw = Cw.y; - - /* Reinhard, for reference */ -// float L = Lw * exposure / avgLw; -// float Ld = L * (1. + L / (Lwhite * Lwhite)); -// Ld /= (1. + L); -// FragColor = vec4(Ld * pow(col.xyz / Lw, vec3(saturation)), 1.); // Uncharted2 tonemap with Auria's custom coefficients vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06); @@ -38,7 +18,6 @@ void main() vec2 inside = uv - 0.5; float vignette = 1. - dot(inside, inside) * vignette_weight; vignette = clamp(pow(vignette, 0.8), 0., 1.); - //vignette = clamp(vignette + vignette - 0.5, 0., 1.15); FragColor = vec4(perChannel.xyz * vignette, col.a); } From 6041c48fbedb3b02e38ecdc9ef01c0f1c320a29a Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Sun, 7 Dec 2014 21:37:16 +0100 Subject: [PATCH 22/40] Source DiffuseIBL algorithm --- data/shaders/utils/DiffuseIBL.frag | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/shaders/utils/DiffuseIBL.frag b/data/shaders/utils/DiffuseIBL.frag index 0d4d14194..a581514e9 100644 --- a/data/shaders/utils/DiffuseIBL.frag +++ b/data/shaders/utils/DiffuseIBL.frag @@ -1,3 +1,7 @@ +// From "An Efficient Representation for Irradiance Environment Maps" article +// See http://graphics.stanford.edu/papers/envmap/ + +// Coefficients are calculated in IBL.cpp uniform float blueLmn[9]; uniform float greenLmn[9]; uniform float redLmn[9]; From f0d430c83350d0bdbaf8b888d210503e517354a2 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 8 Dec 2014 15:22:12 +1100 Subject: [PATCH 23/40] Fix #1761 (Players tab in Options autofocus issue). --- src/states_screens/user_screen.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/states_screens/user_screen.cpp b/src/states_screens/user_screen.cpp index 2877eb37f..8df444ba4 100644 --- a/src/states_screens/user_screen.cpp +++ b/src/states_screens/user_screen.cpp @@ -111,8 +111,14 @@ void BaseUserScreen::init() // Select the current player. That can only be done after // updateItemDisplay is called. - if(current_player_index != -1) - selectUser(current_player_index); + if (current_player_index != -1) + { + // Only set focus in case of non-tabbed version (so that keyboard + // or gamepad navigation with tabs works as expected, i.e. you can + // select the next tab without having to go up to the tab list first. + if(!getWidget("options_choice")) + selectUser(current_player_index); + } // no current player found // The first player is the most frequently used, so select it else if (PlayerManager::get()->getNumPlayers() > 0) @@ -586,8 +592,8 @@ void BaseUserScreen::unloaded() */ void TabbedUserScreen::init() { - RibbonWidget* tab_bar = this->getWidget("options_choice"); - if (tab_bar != NULL) tab_bar->select("tab_players", PLAYER_ID_GAME_MASTER); + RibbonWidget* tab_bar = getWidget("options_choice"); + if (tab_bar) tab_bar->select("tab_players", PLAYER_ID_GAME_MASTER); tab_bar->getRibbonChildren()[0].setTooltip( _("Graphics") ); tab_bar->getRibbonChildren()[1].setTooltip( _("Audio") ); tab_bar->getRibbonChildren()[2].setTooltip(_("User Interface")); From b764339b2046c2230794b9c5b05835c7e6889ae3 Mon Sep 17 00:00:00 2001 From: hiker Date: Mon, 8 Dec 2014 23:39:41 +1100 Subject: [PATCH 24/40] Moved cloning of animated mesh into CSkinnedMesh (to get access to private members). Fixed animation bug, caused by copying already animated vertex position from LocalBuffer to Weight (so they were then later animated again). Might need a better solution to avoid copying mesh twice (LocalBuffer = Weight, followed by Weight = LocalBuffer). --- lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp | 70 +++++++++++++++++++ lib/irrlicht/source/Irrlicht/CSkinnedMesh.h | 2 +- src/graphics/irr_driver.cpp | 39 +---------- 3 files changed, 72 insertions(+), 39 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp index bb4a50474..764fab617 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp @@ -1470,6 +1470,76 @@ void CSkinnedMesh::calculateTangents( } } +// ---------------------------------------------------------------------------- +/** Copies a mesh. + */ +CSkinnedMesh *CSkinnedMesh::clone() +{ + + CSkinnedMesh* skinned_mesh = new CSkinnedMesh(); + + for (u32 i = 0; i < getMeshBuffers().size(); i++) + { + SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); + *buffer = *(getMeshBuffers()[i]); + } + + for (u32 j = 0; j < getAllJoints().size(); ++j) + { + ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); + *joint = *(getAllJoints()[j]); + } + + // fix children pointers (they still have old pointers) + core::array & new_joints = skinned_mesh->getAllJoints(); + for (u32 i = 0; i < new_joints.size(); ++i) + { + ISkinnedMesh::SJoint * joint = new_joints[i]; + for (u32 c = 0; c < joint->Children.size(); ++c) + { + // the child is one of the oldJoints and must be replaced by the newjoint on the same index + bool found = false; + for (u32 k = 0; k < AllJoints.size(); ++k) + { + if (joint->Children[c] == AllJoints[k]) + { + joint->Children[c] = new_joints[k]; + found = true; + break; + } + } // k < old_joints.size + + if (!found) + found = true; + } // c < joint->Children.size() + } // i < new_joints.size() + + // In finalize the values from LocalBuffers are copied into + // Weights[].StaticPos. Since skinned_mesh already has the correct + // values in Weights, we have to copy the values from Weights + // into LocalBuffer (so that in the copy from LocalBuffer to weights + // no values are overwritten). + // FIXME: Not ideal, better would be not to copy the values in + // finalize(). + for (unsigned int i = 0; iWeights.size(); ++j) + { + const u16 buffer_id = joint->Weights[j].buffer_id; + const u32 vertex_id = joint->Weights[j].vertex_id; + + skinned_mesh->LocalBuffers[buffer_id]->getVertex(vertex_id)->Pos = joint->Weights[j].StaticPos; + skinned_mesh->LocalBuffers[buffer_id]->getVertex(vertex_id)->Normal = joint->Weights[j].StaticNormal; + } + } + skinned_mesh->finalize(); + + + + return skinned_mesh; + +} // clone } // end namespace scene } // end namespace irr diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h index 564693c84..2946d14c2 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.h @@ -159,7 +159,7 @@ namespace scene void addJoints(core::array &jointChildSceneNodes, IAnimatedMeshSceneNode* node, ISceneManager* smgr); - + CSkinnedMesh *clone(); private: void checkForAnimation(); diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index f10627175..473f57aa9 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1018,44 +1018,7 @@ scene::IAnimatedMesh *IrrDriver::copyAnimatedMesh(scene::IAnimatedMesh *orig) Log::error("copyAnimatedMesh", "Given mesh was not a skinned mesh."); return NULL; } - - ISkinnedMesh* skinned_mesh = m_scene_manager->createSkinnedMesh(); - - for (u32 i = 0; i < mesh->getMeshBuffers().size(); i++) - { - SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); - *buffer = *(mesh->getMeshBuffers()[i]); - } - - for (u32 j = 0; j < mesh->getAllJoints().size(); ++j) - { - ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); - *joint = *(mesh->getAllJoints()[j]); - } - - // fix children pointers (they still have old pointers) - core::array & new_joints = skinned_mesh->getAllJoints(); - core::array & old_joints = mesh->getAllJoints(); - for (u32 i = 0; i < new_joints.size(); ++i) - { - ISkinnedMesh::SJoint * joint = new_joints[i]; - for (u32 c = 0; c < joint->Children.size(); ++c) - { - // the child is one of the oldJoints and must be replaced by the newjoint on the same index - for (u32 k = 0; k < old_joints.size(); ++k) - { - if (joint->Children[c] == old_joints[k]) - { - joint->Children[c] = new_joints[k]; - break; - } - } // k < old_joints.size - } // c < joint->Children.size() - } // i < new_joints.size() - - skinned_mesh->finalize(); - - return skinned_mesh; + return mesh->clone(); } // copyAnimatedMesh // ---------------------------------------------------------------------------- From 2b0680d92dbedfe8633a0a6690d09195f2ca2b2a Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 8 Dec 2014 18:24:43 +0100 Subject: [PATCH 25/40] Use texture buffer instead of uniform for samples Should fix nvidia glsl error --- .../shaders/importance_sampling_specular.frag | 6 ++--- src/graphics/IBL.cpp | 23 +++++++++++++++---- src/graphics/shaders.cpp | 4 +++- src/graphics/shaders.hpp | 3 ++- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag index eadddaa6d..ca3187d82 100644 --- a/data/shaders/importance_sampling_specular.frag +++ b/data/shaders/importance_sampling_specular.frag @@ -1,5 +1,5 @@ uniform samplerCube tex; -uniform float samples[2048]; +uniform samplerBuffer samples; uniform float ViewportSize; uniform mat4 PermutationMatrix; @@ -20,8 +20,8 @@ void main(void) for (int i = 0; i < 1024; i++) { - float Theta = samples[2 * i]; - float Phi = samples[2 * i + 1]; + float Theta = texelFetch(samples, 2 * i).r; + float Phi = texelFetch(samples, 2 * i).g; vec3 L = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; float NdotL = clamp(dot(RayDir, L), 0., 1.); diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp index 38efe5f5b..abeb6d774 100644 --- a/src/graphics/IBL.cpp +++ b/src/graphics/IBL.cpp @@ -289,24 +289,39 @@ GLuint generateSpecularCubemap(GLuint probe) float roughness = (8 - level) * 4 * pow(2.f, 10.f) / 8.f; float viewportSize = float(1 << (8 - level)); - std::vector Samples; + float *tmp = new float[2048]; for (unsigned i = 0; i < 1024; i++) { std::pair sample = ImportanceSamplingPhong(HammersleySequence(i, 1024), roughness); - Samples.push_back(sample.first); - Samples.push_back(sample.second); + tmp[2 * i] = sample.first; + tmp[2 * i + 1] = sample.second; } + glActiveTexture(GL_TEXTURE0 + UtilShader::SpecularIBLGenerator::getInstance()->TU_Samples); + GLuint sampleTex, sampleBuffer; + glGenBuffers(1, &sampleBuffer); + glBindBuffer(GL_TEXTURE_BUFFER, sampleBuffer); + glBufferData(GL_TEXTURE_BUFFER, 2048 * sizeof(float), tmp, GL_STATIC_DRAW); + glGenTextures(1, &sampleTex); + glBindTexture(GL_TEXTURE_BUFFER, sampleTex); + glTexBuffer(GL_TEXTURE_BUFFER, GL_RG32F, sampleBuffer); + for (unsigned face = 0; face < 6; face++) { + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, cubemap_texture, level); GLuint status = glCheckFramebufferStatus(GL_FRAMEBUFFER); assert(status == GL_FRAMEBUFFER_COMPLETE); UtilShader::SpecularIBLGenerator::getInstance()->SetTextureUnits(probe); - UtilShader::SpecularIBLGenerator::getInstance()->setUniforms(M[face], Samples, viewportSize); + UtilShader::SpecularIBLGenerator::getInstance()->setUniforms(M[face], viewportSize); + glDrawArrays(GL_TRIANGLES, 0, 3); } + + delete[] tmp; + glDeleteTextures(1, &sampleTex); + glDeleteBuffers(1, &sampleBuffer); } glDeleteFramebuffers(1, &fbo); diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index c9a3c3569..3a258ee25 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -894,8 +894,10 @@ namespace UtilShader Program = LoadProgram(OBJECT, GL_VERTEX_SHADER, file_manager->getAsset("shaders/screenquad.vert").c_str(), GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/importance_sampling_specular.frag").c_str()); - AssignUniforms("PermutationMatrix", "samples[0]", "ViewportSize"); + AssignUniforms("PermutationMatrix", "ViewportSize"); + TU_Samples = 1; AssignSamplerNames(Program, 0, "tex"); + AssignTextureUnit(Program, TexUnit(TU_Samples, "samples")); } } diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index 97ba49c41..a8be956d0 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -49,9 +49,10 @@ public: static void setUniforms(const irr::video::SColor &); }; -class SpecularIBLGenerator : public ShaderHelperSingleton, float >, public TextureRead +class SpecularIBLGenerator : public ShaderHelperSingleton, public TextureRead { public: + GLuint TU_Samples; SpecularIBLGenerator(); }; } From 72fdf816e78b8b497d91164176215f082b590ff5 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 8 Dec 2014 19:16:26 +0100 Subject: [PATCH 26/40] Fix Importance sampling --- data/shaders/importance_sampling_specular.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/data/shaders/importance_sampling_specular.frag b/data/shaders/importance_sampling_specular.frag index ca3187d82..c997fafb7 100644 --- a/data/shaders/importance_sampling_specular.frag +++ b/data/shaders/importance_sampling_specular.frag @@ -20,8 +20,8 @@ void main(void) for (int i = 0; i < 1024; i++) { - float Theta = texelFetch(samples, 2 * i).r; - float Phi = texelFetch(samples, 2 * i).g; + float Theta = texelFetch(samples, i).r; + float Phi = texelFetch(samples, i).g; vec3 L = cos(Theta) * RayDir + sin(Theta) * cos(Phi) * Tangent + sin(Theta) * sin(Phi) * Bitangent; float NdotL = clamp(dot(RayDir, L), 0., 1.); From 26677916215973cf69aba9babf176cd38476b82b Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 8 Dec 2014 19:36:23 +0100 Subject: [PATCH 27/40] Tweak IBL --- data/shaders/IBL.frag | 2 +- src/graphics/IBL.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/data/shaders/IBL.frag b/data/shaders/IBL.frag index 70e08e020..689e8911c 100644 --- a/data/shaders/IBL.frag +++ b/data/shaders/IBL.frag @@ -22,5 +22,5 @@ void main(void) vec3 eyedir = -normalize(xpos.xyz); float specval = texture(ntex, uv).z; - Spec = vec4(SpecularIBL(normal, eyedir, specval), 1.); + Spec = vec4(.25 * SpecularIBL(normal, eyedir, specval), 1.); } diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp index abeb6d774..420a4b318 100644 --- a/src/graphics/IBL.cpp +++ b/src/graphics/IBL.cpp @@ -286,7 +286,8 @@ GLuint generateSpecularCubemap(GLuint probe) { // Blinn Phong can be approximated by Phong with 4x the specular coefficient // See http://seblagarde.wordpress.com/2012/03/29/relationship-between-phong-and-blinn-lighting-model/ - float roughness = (8 - level) * 4 * pow(2.f, 10.f) / 8.f; + // NOTE : Removed because it makes too sharp reflexion + float roughness = (8 - level) * pow(2.f, 10.f) / 8.f; float viewportSize = float(1 << (8 - level)); float *tmp = new float[2048]; From 36d20773d753faf383a2810f6362c8bec131fe2b Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Mon, 8 Dec 2014 19:42:03 +0100 Subject: [PATCH 28/40] Unbind everything before deleting --- src/graphics/IBL.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/graphics/IBL.cpp b/src/graphics/IBL.cpp index 420a4b318..9f944a76d 100644 --- a/src/graphics/IBL.cpp +++ b/src/graphics/IBL.cpp @@ -267,7 +267,6 @@ GLuint generateSpecularCubemap(GLuint probe) GLenum bufs[] = { GL_COLOR_ATTACHMENT0 }; glDrawBuffers(1, bufs); glUseProgram(UtilShader::SpecularIBLGenerator::getInstance()->Program); - glBindVertexArray(SharedObject::FullScreenQuadVAO); glDisable(GL_BLEND); glDisable(GL_DEPTH_TEST); @@ -298,6 +297,7 @@ GLuint generateSpecularCubemap(GLuint probe) tmp[2 * i + 1] = sample.second; } + glBindVertexArray(0); glActiveTexture(GL_TEXTURE0 + UtilShader::SpecularIBLGenerator::getInstance()->TU_Samples); GLuint sampleTex, sampleBuffer; glGenBuffers(1, &sampleBuffer); @@ -306,6 +306,7 @@ GLuint generateSpecularCubemap(GLuint probe) glGenTextures(1, &sampleTex); glBindTexture(GL_TEXTURE_BUFFER, sampleTex); glTexBuffer(GL_TEXTURE_BUFFER, GL_RG32F, sampleBuffer); + glBindVertexArray(SharedObject::FullScreenQuadVAO); for (unsigned face = 0; face < 6; face++) { @@ -319,12 +320,15 @@ GLuint generateSpecularCubemap(GLuint probe) glDrawArrays(GL_TRIANGLES, 0, 3); } + glActiveTexture(GL_TEXTURE0 + UtilShader::SpecularIBLGenerator::getInstance()->TU_Samples); + glBindBuffer(GL_TEXTURE_BUFFER, 0); + glBindTexture(GL_TEXTURE_BUFFER, 0); delete[] tmp; glDeleteTextures(1, &sampleTex); glDeleteBuffers(1, &sampleBuffer); } - + glBindFramebuffer(GL_FRAMEBUFFER, 0); glDeleteFramebuffers(1, &fbo); return cubemap_texture; } \ No newline at end of file From 5b62d94c5bb251660ecc1288c795c778b4d60f96 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 Dec 2014 07:56:18 +1100 Subject: [PATCH 29/40] Minor performance optimisations. --- lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp index 764fab617..97f724f27 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp @@ -794,6 +794,7 @@ void CSkinnedMesh::checkForAnimation() AllJoints[i]->UseAnimationFrom->RotationKeys.size() ) { HasAnimation = true; + break; } } } @@ -803,8 +804,11 @@ void CSkinnedMesh::checkForAnimation() { for(i=0;iWeights.size()) - HasAnimation = true; + if (AllJoints[i]->Weights.size()) + { + HasAnimation = true; + break; + } } } From 2c2847e9126f37839d20ce2f647288e1accdc261 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 Dec 2014 08:05:16 +1100 Subject: [PATCH 30/40] Fixed line endings. --- lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp | 100 +++++++++--------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp index 97f724f27..74e472ca5 100644 --- a/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp +++ b/lib/irrlicht/source/Irrlicht/CSkinnedMesh.cpp @@ -1479,52 +1479,52 @@ void CSkinnedMesh::calculateTangents( */ CSkinnedMesh *CSkinnedMesh::clone() { - - CSkinnedMesh* skinned_mesh = new CSkinnedMesh(); - - for (u32 i = 0; i < getMeshBuffers().size(); i++) - { - SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); - *buffer = *(getMeshBuffers()[i]); - } - - for (u32 j = 0; j < getAllJoints().size(); ++j) - { - ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); - *joint = *(getAllJoints()[j]); - } - - // fix children pointers (they still have old pointers) - core::array & new_joints = skinned_mesh->getAllJoints(); - for (u32 i = 0; i < new_joints.size(); ++i) - { - ISkinnedMesh::SJoint * joint = new_joints[i]; - for (u32 c = 0; c < joint->Children.size(); ++c) - { - // the child is one of the oldJoints and must be replaced by the newjoint on the same index - bool found = false; - for (u32 k = 0; k < AllJoints.size(); ++k) - { - if (joint->Children[c] == AllJoints[k]) - { - joint->Children[c] = new_joints[k]; - found = true; - break; - } - } // k < old_joints.size - - if (!found) - found = true; - } // c < joint->Children.size() - } // i < new_joints.size() - - // In finalize the values from LocalBuffers are copied into - // Weights[].StaticPos. Since skinned_mesh already has the correct - // values in Weights, we have to copy the values from Weights - // into LocalBuffer (so that in the copy from LocalBuffer to weights - // no values are overwritten). - // FIXME: Not ideal, better would be not to copy the values in - // finalize(). + + CSkinnedMesh* skinned_mesh = new CSkinnedMesh(); + + for (u32 i = 0; i < getMeshBuffers().size(); i++) + { + SSkinMeshBuffer * buffer = skinned_mesh->addMeshBuffer(); + *buffer = *(getMeshBuffers()[i]); + } + + for (u32 j = 0; j < getAllJoints().size(); ++j) + { + ISkinnedMesh::SJoint *joint = skinned_mesh->addJoint(); + *joint = *(getAllJoints()[j]); + } + + // fix children pointers (they still have old pointers) + core::array & new_joints = skinned_mesh->getAllJoints(); + for (u32 i = 0; i < new_joints.size(); ++i) + { + ISkinnedMesh::SJoint * joint = new_joints[i]; + for (u32 c = 0; c < joint->Children.size(); ++c) + { + // the child is one of the oldJoints and must be replaced by the newjoint on the same index + bool found = false; + for (u32 k = 0; k < AllJoints.size(); ++k) + { + if (joint->Children[c] == AllJoints[k]) + { + joint->Children[c] = new_joints[k]; + found = true; + break; + } + } // k < old_joints.size + + if (!found) + found = true; + } // c < joint->Children.size() + } // i < new_joints.size() + + // In finalize the values from LocalBuffers are copied into + // Weights[].StaticPos. Since skinned_mesh already has the correct + // values in Weights, we have to copy the values from Weights + // into LocalBuffer (so that in the copy from LocalBuffer to weights + // no values are overwritten). + // FIXME: Not ideal, better would be not to copy the values in + // finalize(). for (unsigned int i = 0; iLocalBuffers[buffer_id]->getVertex(vertex_id)->Normal = joint->Weights[j].StaticNormal; } } - skinned_mesh->finalize(); + skinned_mesh->finalize(); - - - return skinned_mesh; + + + return skinned_mesh; } // clone From ca55212062090e1085d0bb61a0b979205308187e Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 Dec 2014 08:47:40 +1100 Subject: [PATCH 31/40] Fixed ref-counting. --- src/karts/kart_model.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/karts/kart_model.cpp b/src/karts/kart_model.cpp index 0d18fc89e..a23a230ff 100644 --- a/src/karts/kart_model.cpp +++ b/src/karts/kart_model.cpp @@ -241,18 +241,22 @@ KartModel::~KartModel() } } - if(m_is_master && m_mesh) + // In case of the master, the mesh must be dropped. A non-master KartModel + // has a copy of the master's mesh, so it needs to be dropped, too. + if (m_mesh) { m_mesh->drop(); - // If there is only one copy left, it's the copy in irrlicht's - // mesh cache, so it can be remove. - if(m_mesh && m_mesh->getReferenceCount()==1) + if (m_is_master) { - irr_driver->dropAllTextures(m_mesh); - irr_driver->removeMeshFromCache(m_mesh); + // If there is only one copy left, it's the copy in irrlicht's + // mesh cache, so it can be removed. + if (m_mesh && m_mesh->getReferenceCount() == 1) + { + irr_driver->dropAllTextures(m_mesh); + irr_driver->removeMeshFromCache(m_mesh); + } } } - #ifdef DEBUG #if SKELETON_DEBUG irr_driver->clearDebugMeshes(); @@ -260,7 +264,7 @@ KartModel::~KartModel() #endif } // ~KartModel - + // ---------------------------------------------------------------------------- /** This function returns a copy of this object. The memory is allocated * here, but needs to be managed (esp. freed) by the calling function. From d97b9f2d0e490643b7e117525dc44c0a3da809c0 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 01:33:58 +0100 Subject: [PATCH 32/40] Clamp SpecularIBL value on positive range --- data/shaders/utils/SpecularIBL.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/shaders/utils/SpecularIBL.frag b/data/shaders/utils/SpecularIBL.frag index 04832dfa7..d8eec8fb9 100644 --- a/data/shaders/utils/SpecularIBL.frag +++ b/data/shaders/utils/SpecularIBL.frag @@ -7,5 +7,5 @@ vec3 SpecularIBL(vec3 normal, vec3 V, float roughness) // Assume 8 level of lod (ie 256x256 texture) float lodval = 8. * (1. - roughness); - return textureLod(probe, sampleDirection, lodval).rgb; + return max(textureLod(probe, sampleDirection, lodval).rgb, vec3(0.)); } \ No newline at end of file From 05f2af79c968592d47c2f8cb9c2feb70c830f8dd Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 Dec 2014 16:50:16 +1100 Subject: [PATCH 33/40] Fixed #1770 (tabs disappear). --- src/states_screens/online_profile_base.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/states_screens/online_profile_base.cpp b/src/states_screens/online_profile_base.cpp index 67960e5f6..3a414d5d4 100644 --- a/src/states_screens/online_profile_base.cpp +++ b/src/states_screens/online_profile_base.cpp @@ -144,7 +144,7 @@ void OnlineProfileBase::eventCallback(Widget* widget, const std::string& name, if (selection == m_friends_tab->m_properties[PROP_ID]) sm->replaceTopMostScreen(OnlineProfileFriends::getInstance()); else if (selection == m_achievements_tab->m_properties[PROP_ID]) - sm->replaceTopMostScreen(OnlineProfileAchievements::getInstance()); + sm->replaceTopMostScreen(TabOnlineProfileAchievements::getInstance()); else if (selection == m_settings_tab->m_properties[PROP_ID]) sm->replaceTopMostScreen(OnlineProfileSettings::getInstance()); } From d8e6ebbb0e6de86bdabc34ce8cd7276dacf484aa Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 00:35:39 +0100 Subject: [PATCH 34/40] Use correct name for passthrough texture --- src/graphics/shaders.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 3a258ee25..661f86966 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1864,7 +1864,7 @@ namespace FullScreenShader GL_FRAGMENT_SHADER, file_manager->getAsset("shaders/texturedquad.frag").c_str()); AssignUniforms(); - AssignSamplerNames(Program, 0, "texture"); + AssignSamplerNames(Program, 0, "tex"); vao = createVAO(Program); } From d84d103b03a5f4c84f8acac6807c21ba1912149e Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 18:21:07 +0100 Subject: [PATCH 35/40] Wrap azdo check into a function call --- src/graphics/glwrap.cpp | 11 ----------- src/graphics/irr_driver.cpp | 5 +++++ src/graphics/irr_driver.hpp | 11 +++++++++++ src/graphics/render.cpp | 2 +- src/graphics/render_geometry.cpp | 22 +++++++++++----------- src/graphics/shaders.cpp | 4 ++-- src/graphics/stkmesh.cpp | 4 ++-- src/graphics/stkmeshscenenode.cpp | 8 ++++---- src/graphics/stkscenemanager.cpp | 8 ++++---- 9 files changed, 40 insertions(+), 35 deletions(-) diff --git a/src/graphics/glwrap.cpp b/src/graphics/glwrap.cpp index c86f005f2..ad55cf9df 100644 --- a/src/graphics/glwrap.cpp +++ b/src/graphics/glwrap.cpp @@ -46,17 +46,6 @@ debugCallback(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei le return; } - // Suppress warnings about GL_ARB_bindless_texture not being supported - // when we're not even using it - if (UserConfigParams::m_azdo == false && - source == GL_DEBUG_SOURCE_SHADER_COMPILER_ARB && msg != NULL && - std::string(msg).find("GL_ARB_bindless_texture") != std::string::npos) - { - Log::debug("GLWrap", "Suppressed warning: %s", msg); - return; - } - - switch(source) { case GL_DEBUG_SOURCE_API_ARB: diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index 5869cb7a3..202ff660e 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -534,6 +534,7 @@ void IrrDriver::initDevice() hasComputeShaders = false; hasTextureStorage = false; hasTextureView = false; + hasBindlessTexture = false; // Default false value for hasVSLayer if --no-graphics argument is used #if !defined(__APPLE__) if (!ProfileWorld::isNoGraphics()) @@ -566,6 +567,10 @@ void IrrDriver::initDevice() hasTextureView = true; Log::info("GLDriver", "ARB Texture View enabled"); } + if (hasGLExtension("GL_ARB_bindless_texture")) { + hasBindlessTexture = true; + Log::info("GLDriver", "ARB Bindless Texture enabled"); + } m_support_sdsm = m_support_sdsm && hasComputeShaders && hasBuffserStorage; std::string driver((char*)(glGetString(GL_VERSION))); diff --git a/src/graphics/irr_driver.hpp b/src/graphics/irr_driver.hpp index 4a61355b8..04c5bd8a5 100644 --- a/src/graphics/irr_driver.hpp +++ b/src/graphics/irr_driver.hpp @@ -191,6 +191,7 @@ private: bool hasComputeShaders; bool hasTextureStorage; bool hasTextureView; + bool hasBindlessTexture; bool m_support_sdsm; bool m_support_texture_compression; bool m_need_ubo_workaround; @@ -297,6 +298,11 @@ public: return UserConfigParams::m_texture_compression && m_support_texture_compression; } + bool useAZDO() const + { + return hasBindlessTexture && UserConfigParams::m_azdo; + } + bool needUBOWorkaround() const { return m_need_ubo_workaround; @@ -347,6 +353,11 @@ public: return hasTextureView; } + bool hasARBBindlessTexture() const + { + return hasBindlessTexture; + } + video::SColorf getAmbientLight() const; struct GlowData { diff --git a/src/graphics/render.cpp b/src/graphics/render.cpp index ee278aa9f..4afb5e1b1 100644 --- a/src/graphics/render.cpp +++ b/src/graphics/render.cpp @@ -1031,7 +1031,7 @@ void IrrDriver::renderGlow(std::vector& glows) glUseProgram(MeshShader::InstancedColorizeShader::getInstance()->Program); glBindVertexArray(VAOManager::getInstance()->getInstanceVAO(video::EVT_STANDARD, InstanceTypeGlow)); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (GlowPassCmd::getInstance()->Size) { diff --git a/src/graphics/render_geometry.cpp b/src/graphics/render_geometry.cpp index 37089a38a..51527bd13 100644 --- a/src/graphics/render_geometry.cpp +++ b/src/graphics/render_geometry.cpp @@ -427,7 +427,7 @@ void renderMeshes1stPass() continue; } - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) HandleExpander::template Expand(mesh.TextureHandles, T::FirstPassTextures); else TexExpander::template ExpandTex(mesh, T::FirstPassTextures); @@ -500,7 +500,7 @@ void IrrDriver::renderSolidFirstPass() renderMeshes1stPass(); renderMeshes1stPass(); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { multidraw1stPass(); multidraw1stPass(); @@ -546,7 +546,7 @@ void renderMeshes2ndPass( const std::vector &Prefilled_Handle, continue; } - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) HandleExpander::template Expand(mesh.TextureHandles, T::SecondPassTextures, Prefilled_Handle[0], Prefilled_Handle[1], Prefilled_Handle[2]); else TexExpander::template ExpandTex(mesh, T::SecondPassTextures, Prefilled_Tex[0], Prefilled_Tex[1], Prefilled_Tex[2]); @@ -595,7 +595,7 @@ void IrrDriver::renderSolidSecondPass() uint64_t DiffuseHandle = 0, SpecularHandle = 0, SSAOHandle = 0, DepthHandle = 0; - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { DiffuseHandle = glGetTextureSamplerHandleARB(m_rtts->getRenderTarget(RTT_DIFFUSE), MeshShader::ObjectPass2Shader::getInstance()->SamplersId[0]); if (!glIsTextureHandleResidentARB(DiffuseHandle)) @@ -633,7 +633,7 @@ void IrrDriver::renderSolidSecondPass() renderMeshes2ndPass(createVector(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex); renderMeshes2ndPass(createVector(DiffuseHandle, SpecularHandle, SSAOHandle), DiffSpecSSAOTex); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { multidraw2ndPass(createVector(DiffuseHandle, SpecularHandle, SSAOHandle, 0, 0)); multidraw2ndPass(createVector(DiffuseHandle, SpecularHandle, SSAOHandle, 0, 0)); @@ -714,7 +714,7 @@ static void renderMultiMeshNormals() void IrrDriver::renderNormalsVisualisation() { - if (UserConfigParams::m_azdo) { + if (irr_driver->useAZDO()) { renderMultiMeshNormals(); renderMultiMeshNormals(); renderMultiMeshNormals(); @@ -752,7 +752,7 @@ void renderTransparenPass(const std::vector &TexUnits, std::vectoruseAZDO()) Shader::getInstance()->SetTextureHandles(mesh.TextureHandles[0]); else Shader::getInstance()->SetTextureUnits(getTextureGLuint(mesh.textures[0])); @@ -932,7 +932,7 @@ void renderShadow(unsigned cascade) GLMesh *mesh = STK::tuple_get<0>(t.at(i)); if (!irr_driver->hasARB_base_instance()) glBindVertexArray(mesh->vao); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) HandleExpander::template Expand(mesh->TextureHandles, T::ShadowTextures); else TexExpander::template ExpandTex(*mesh, T::ShadowTextures); @@ -1004,7 +1004,7 @@ void IrrDriver::renderShadows() if (irr_driver->hasARB_draw_indirect()) glBindBuffer(GL_DRAW_INDIRECT_BUFFER, ShadowPassCmd::getInstance()->drawindirectcmd); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { multidrawShadow(cascade); multidrawShadow(cascade); @@ -1081,7 +1081,7 @@ void drawRSM(const core::matrix4 & rsm_matrix) GLMesh *mesh = STK::tuple_get<0>(t.at(i)); if (!irr_driver->hasARB_base_instance()) glBindVertexArray(mesh->vao); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) HandleExpander::template Expand(mesh->TextureHandles, T::RSMTextures); else TexExpander::template ExpandTex(*mesh, T::RSMTextures); @@ -1138,7 +1138,7 @@ void IrrDriver::renderRSM() if (irr_driver->hasARB_draw_indirect()) glBindBuffer(GL_DRAW_INDIRECT_BUFFER, RSMPassCmd::getInstance()->drawindirectcmd); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { multidrawRSM(rsm_matrix); multidrawRSM(rsm_matrix); diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 661f86966..9b4bf7cc9 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -147,9 +147,9 @@ GLuint LoadShader(const char * file, unsigned type) char versionString[20]; sprintf(versionString, "#version %d\n", irr_driver->getGLSLVersion()); std::string Code = versionString; - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) Code += "#extension GL_ARB_bindless_texture : enable\n"; - else + else if (irr_driver->hasARBBindlessTexture()) { Code += "#extension GL_ARB_bindless_texture : disable\n"; Code += "#undef GL_ARB_bindless_texture\n"; diff --git a/src/graphics/stkmesh.cpp b/src/graphics/stkmesh.cpp index 3047c0876..b9be53e98 100644 --- a/src/graphics/stkmesh.cpp +++ b/src/graphics/stkmesh.cpp @@ -286,7 +286,7 @@ SetTexture(GLMesh &mesh, unsigned i, bool isSrgb, const std::string &matname) return; } compressTexture(mesh.textures[i], isSrgb); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (!mesh.TextureHandles[i]) mesh.TextureHandles[i] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[i]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]); @@ -359,7 +359,7 @@ void InitTexturesTransparent(GLMesh &mesh) return; } compressTexture(mesh.textures[0], true); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (!mesh.TextureHandles[0]) mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]); diff --git a/src/graphics/stkmeshscenenode.cpp b/src/graphics/stkmeshscenenode.cpp index d609dd6bd..7dd7b1130 100644 --- a/src/graphics/stkmeshscenenode.cpp +++ b/src/graphics/stkmeshscenenode.cpp @@ -269,7 +269,7 @@ void STKMeshSceneNode::render() size_t count = mesh.IndexCount; compressTexture(mesh.textures[0], true); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (!mesh.TextureHandles[0]) mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::ObjectPass1Shader::getInstance()->SamplersId[0]); @@ -307,7 +307,7 @@ void STKMeshSceneNode::render() GLenum itype = mesh.IndexType; size_t count = mesh.IndexCount; - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { GLuint64 DiffuseHandle = glGetTextureSamplerHandleARB(irr_driver->getRenderTargetTexture(RTT_DIFFUSE), MeshShader::ObjectPass2Shader::getInstance()->SamplersId[0]); if (!glIsTextureHandleResidentARB(DiffuseHandle)) @@ -403,7 +403,7 @@ void STKMeshSceneNode::render() tmpcol.getBlue() / 255.0f); compressTexture(mesh.textures[0], true); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (!mesh.TextureHandles[0]) mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::TransparentFogShader::getInstance()->SamplersId[0]); @@ -433,7 +433,7 @@ void STKMeshSceneNode::render() size_t count = mesh.IndexCount; compressTexture(mesh.textures[0], true); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) { if (!mesh.TextureHandles[0]) mesh.TextureHandles[0] = glGetTextureSamplerHandleARB(getTextureGLuint(mesh.textures[0]), MeshShader::TransparentShader::getInstance()->SamplersId[0]); diff --git a/src/graphics/stkscenemanager.cpp b/src/graphics/stkscenemanager.cpp index 5589ed039..9cc7eb46f 100644 --- a/src/graphics/stkscenemanager.cpp +++ b/src/graphics/stkscenemanager.cpp @@ -143,7 +143,7 @@ void FillInstances(const std::unordered_map(It->second, InstanceBuffer, CommandBuffer, InstanceBufferOffset, CommandBufferOffset, Polycount); - if (!UserConfigParams::m_azdo) + if (!irr_driver->useAZDO()) InstancedList.push_back(It->second.front().first); } } @@ -527,7 +527,7 @@ GenDrawCalls(unsigned cascade, std::vector &InstancedList, if (irr_driver->hasARB_draw_indirect()) ShadowPassCmd::getInstance()->Offset[cascade][Mat] = CommandBufferOffset; // Store command buffer offset FillInstances(MeshForShadowPass[Mat][cascade], InstancedList, InstanceBuffer, CommandBuffer, InstanceBufferOffset, CommandBufferOffset, PolyCount); - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) ShadowPassCmd::getInstance()->Size[cascade][Mat] = CommandBufferOffset - ShadowPassCmd::getInstance()->Offset[cascade][Mat]; } @@ -734,11 +734,11 @@ PROFILER_POP_CPU_MARKER(); { size_t Polycnt = 0; FillInstances_impl(It->second, GlowInstanceBuffer, GlowCmdBuffer, offset, current_cmd, Polycnt); - if (!UserConfigParams::m_azdo) + if (!irr_driver->useAZDO()) ListInstancedGlow::getInstance()->push_back(It->second.front().first); } - if (UserConfigParams::m_azdo) + if (irr_driver->useAZDO()) GlowPassCmd::getInstance()->Size = current_cmd - GlowPassCmd::getInstance()->Offset; if (!irr_driver->hasBufferStorageExtension()) From b24fd621a514cc06269c1dc0ae84bf8957d50269 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 18:43:48 +0100 Subject: [PATCH 36/40] Precompute coefficient in gaussian blur pass --- data/shaders/gaussian6h.comp | 16 ++---- data/shaders/gaussian6v.comp | 16 ++---- src/graphics/post_processing.cpp | 88 +++++++++++++++++++------------- src/graphics/shaders.cpp | 4 +- src/graphics/shaders.hpp | 4 +- 5 files changed, 65 insertions(+), 63 deletions(-) diff --git a/data/shaders/gaussian6h.comp b/data/shaders/gaussian6h.comp index c1909b9ab..f2df38fe0 100644 --- a/data/shaders/gaussian6h.comp +++ b/data/shaders/gaussian6h.comp @@ -1,7 +1,7 @@ uniform sampler2D source; uniform layout(rgba16f) restrict writeonly image2D dest; uniform vec2 pixel; -uniform float sigma; +uniform float weights[7]; // Gaussian separated blur with radius 6. @@ -23,18 +23,10 @@ void main() barrier(); - float g0, g1, g2; - g0 = 1.0 / (sqrt(2.0 * 3.14) * sigma); - g1 = exp(-0.5 / (sigma * sigma)); - g2 = g1 * g1; - vec4 sum = local_src[x + 6][y] * g0; - g0 *= g1; - g1 *= g2; + vec4 sum = local_src[x + 6][y] * weights[0]; for (int i = 1; i < 6; i++) { - sum += local_src[6 + x - i][y] * g0; - sum += local_src[6 + x + i][y] * g0; - g0 *= g1; - g1 *= g2; + sum += local_src[6 + x - i][y] * weights[i]; + sum += local_src[6 + x + i][y] * weights[i]; } imageStore(dest, iuv, sum); diff --git a/data/shaders/gaussian6v.comp b/data/shaders/gaussian6v.comp index dfd71c920..7c3a0979a 100644 --- a/data/shaders/gaussian6v.comp +++ b/data/shaders/gaussian6v.comp @@ -1,7 +1,7 @@ uniform sampler2D source; uniform layout(rgba16f) restrict writeonly image2D dest; uniform vec2 pixel; -uniform float sigma; +uniform float weights[7]; // Gaussian separated blur with radius 6. @@ -23,18 +23,10 @@ void main() barrier(); - float g0, g1, g2; - g0 = 1.0 / (sqrt(2.0 * 3.14) * sigma); - g1 = exp(-0.5 / (sigma * sigma)); - g2 = g1 * g1; - vec4 sum = local_src[x][y + 6] * g0; - g0 *= g1; - g1 *= g2; + vec4 sum = local_src[x][y + 6] * weights[0]; for (int i = 1; i < 6; i++) { - sum += local_src[x][6 + y - i] * g0; - sum += local_src[x][6 + y + i] * g0; - g0 *= g1; - g1 *= g2; + sum += local_src[x][6 + y - i] * weights[i]; + sum += local_src[x][6 + y + i] * weights[i]; } imageStore(dest, iuv, sum); diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index 9d8dcf0b0..cb6db3a25 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -353,45 +353,63 @@ void PostProcessing::renderGaussian6Blur(FrameBuffer &in_fbo, FrameBuffer &auxil { assert(in_fbo.getWidth() == auxiliary.getWidth() && in_fbo.getHeight() == auxiliary.getHeight()); float inv_width = 1.0f / in_fbo.getWidth(), inv_height = 1.0f / in_fbo.getHeight(); - { - if (!irr_driver->hasARBComputeShaders()) - { - auxiliary.Bind(); - FullScreenShader::Gaussian6VBlurShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0]); - DrawFullScreenEffect(core::vector2df(inv_width, inv_height), sigmaV); - } - else - { - glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT); - glUseProgram(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->Program); - FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0]); - glBindSampler(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, 0); - glBindImageTexture(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F); - FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height), sigmaV); - glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); - } - } + if (!irr_driver->hasARBComputeShaders()) { - if (!irr_driver->hasARBComputeShaders()) - { - in_fbo.Bind(); + auxiliary.Bind(); - FullScreenShader::Gaussian6HBlurShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0]); - DrawFullScreenEffect(core::vector2df(inv_width, inv_height), sigmaH); - } - else - { - glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); - glUseProgram(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->Program); - FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0]); - glBindSampler(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, 0); - glBindImageTexture(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F); - FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height), sigmaH); - glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); - glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); - } + FullScreenShader::Gaussian6VBlurShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0]); + DrawFullScreenEffect(core::vector2df(inv_width, inv_height), sigmaV); + + in_fbo.Bind(); + + FullScreenShader::Gaussian6HBlurShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0]); + DrawFullScreenEffect(core::vector2df(inv_width, inv_height), sigmaH); } + else + { + float g0, g1, g2; + + std::vector weightsV; + g0 = 1.f / (sqrtf(2.f * 3.14f) * sigmaV); + g1 = exp(-.5f / (sigmaV * sigmaV)); + g2 = g1 * g1; + for (unsigned i = 0; i < 7; i++) + { + weightsV.push_back(g0); + g0 *= g1; + g1 *= g2; + } + + glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT); + glUseProgram(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->Program); + FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->SetTextureUnits(in_fbo.getRTT()[0]); + glBindSampler(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, 0); + glBindImageTexture(FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->TU_dest, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F); + FullScreenShader::ComputeGaussian6VBlurShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height), weightsV); + glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); + + std::vector weightsH; + g0 = 1.f / (sqrtf(2.f * 3.14f) * sigmaH); + g1 = exp(-.5f / (sigmaH * sigmaH)); + g2 = g1 * g1; + for (unsigned i = 0; i < 7; i++) + { + weightsH.push_back(g0); + g0 *= g1; + g1 *= g2; + } + + glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); + glUseProgram(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->Program); + FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->SetTextureUnits(auxiliary.getRTT()[0]); + glBindSampler(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, 0); + glBindImageTexture(FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->TU_dest, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_RGBA16F); + FullScreenShader::ComputeGaussian6HBlurShader::getInstance()->setUniforms(core::vector2df(inv_width, inv_height), weightsH); + glDispatchCompute((int)in_fbo.getWidth() / 8 + 1, (int)in_fbo.getHeight() / 8 + 1, 1); + glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); + } + } void PostProcessing::renderHorizontalBlur(FrameBuffer &in_fbo, FrameBuffer &auxiliary) diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 9b4bf7cc9..3634ef3da 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1752,7 +1752,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussian6h.comp").c_str()); TU_dest = 1; - AssignUniforms("pixel", "sigma"); + AssignUniforms("pixel", "weights"); AssignSamplerNames(Program, 0, "source"); AssignTextureUnit(Program, TexUnit(TU_dest, "dest")); } @@ -1822,7 +1822,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussian6v.comp").c_str()); TU_dest = 1; - AssignUniforms("pixel", "sigma"); + AssignUniforms("pixel", "weights"); AssignSamplerNames(Program, 0, "source"); AssignTextureUnit(Program, TexUnit(TU_dest, "dest")); } diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index a8be956d0..24f1c616f 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -471,7 +471,7 @@ public: ComputeGaussian17TapHShader(); }; -class ComputeGaussian6HBlurShader : public ShaderHelperSingleton, public TextureRead +class ComputeGaussian6HBlurShader : public ShaderHelperSingleton >, public TextureRead { public: GLuint TU_dest; @@ -517,7 +517,7 @@ public: ComputeGaussian17TapVShader(); }; -class ComputeGaussian6VBlurShader : public ShaderHelperSingleton, public TextureRead +class ComputeGaussian6VBlurShader : public ShaderHelperSingleton >, public TextureRead { public: GLuint TU_dest; From c91c04c8623a48252fe4ccf7f400a28b8c09eeda Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 18:54:27 +0100 Subject: [PATCH 37/40] Same for shadow blur pass --- data/shaders/blurshadowH.comp | 16 ++++------------ data/shaders/blurshadowV.comp | 16 ++++------------ src/graphics/post_processing.cpp | 27 +++++++++++++++++++++++++-- src/graphics/shaders.cpp | 4 ++-- src/graphics/shaders.hpp | 4 ++-- 5 files changed, 37 insertions(+), 30 deletions(-) diff --git a/data/shaders/blurshadowH.comp b/data/shaders/blurshadowH.comp index 21b176cbe..0f1156f25 100644 --- a/data/shaders/blurshadowH.comp +++ b/data/shaders/blurshadowH.comp @@ -1,7 +1,7 @@ uniform sampler2D source; uniform layout(r32f) restrict writeonly image2D dest; uniform vec2 pixel; -uniform float sigma; +uniform float weights[7]; // Gaussian separated blur with radius 6. @@ -23,18 +23,10 @@ void main() barrier(); - float g0, g1, g2; - g0 = 1.0 / (sqrt(2.0 * 3.14) * sigma); - g1 = exp(-0.5 / (sigma * sigma)); - g2 = g1 * g1; - float sum = local_src[x + 6][y] * g0; - g0 *= g1; - g1 *= g2; + float sum = local_src[x + 6][y] * weights[0]; for (int i = 1; i < 6; i++) { - sum += local_src[6 + x - i][y] * g0; - sum += local_src[6 + x + i][y] * g0; - g0 *= g1; - g1 *= g2; + sum += local_src[6 + x - i][y] * weights[i]; + sum += local_src[6 + x + i][y] * weights[i]; } imageStore(dest, iuv, vec4(sum)); diff --git a/data/shaders/blurshadowV.comp b/data/shaders/blurshadowV.comp index a6b439ce3..65992ebb4 100644 --- a/data/shaders/blurshadowV.comp +++ b/data/shaders/blurshadowV.comp @@ -1,7 +1,7 @@ uniform sampler2D source; uniform layout(r32f) restrict writeonly image2D dest; uniform vec2 pixel; -uniform float sigma; +uniform float weights[7]; // Gaussian separated blur with radius 6. @@ -23,18 +23,10 @@ void main() barrier(); - float g0, g1, g2; - g0 = 1.0 / (sqrt(2.0 * 3.14) * sigma); - g1 = exp(-0.5 / (sigma * sigma)); - g2 = g1 * g1; - float sum = local_src[x][y + 6] * g0; - g0 *= g1; - g1 *= g2; + float sum = local_src[x][y + 6] * weights[0]; for (int i = 1; i < 6; i++) { - sum += local_src[x][6 + y - i] * g0; - sum += local_src[x][6 + y + i] * g0; - g0 *= g1; - g1 *= g2; + sum += local_src[x][6 + y - i] * weights[i]; + sum += local_src[x][6 + y + i] * weights[i]; } imageStore(dest, iuv, vec4(sum)); diff --git a/src/graphics/post_processing.cpp b/src/graphics/post_processing.cpp index cb6db3a25..fc1a23b7f 100644 --- a/src/graphics/post_processing.cpp +++ b/src/graphics/post_processing.cpp @@ -329,20 +329,43 @@ void PostProcessing::renderGaussian6BlurLayer(FrameBuffer &in_fbo, size_t layer, } else { + float g0, g1, g2; + + std::vector weightsV; + g0 = 1.f / (sqrtf(2.f * 3.14f) * sigmaV); + g1 = exp(-.5f / (sigmaV * sigmaV)); + g2 = g1 * g1; + for (unsigned i = 0; i < 7; i++) + { + weightsV.push_back(g0); + g0 *= g1; + g1 *= g2; + } glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT); glUseProgram(FullScreenShader::ComputeShadowBlurVShader::getInstance()->Program); FullScreenShader::ComputeShadowBlurVShader::getInstance()->SetTextureUnits(LayerTex); glBindSampler(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, 0); glBindImageTexture(FullScreenShader::ComputeShadowBlurVShader::getInstance()->TU_dest, irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R32F); - FullScreenShader::ComputeShadowBlurVShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), sigmaV); + FullScreenShader::ComputeShadowBlurVShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), weightsV); glDispatchCompute((int)1024 / 8 + 1, (int)1024 / 8 + 1, 1); + std::vector weightsH; + g0 = 1.f / (sqrtf(2.f * 3.14f) * sigmaH); + g1 = exp(-.5f / (sigmaH * sigmaH)); + g2 = g1 * g1; + for (unsigned i = 0; i < 7; i++) + { + weightsH.push_back(g0); + g0 *= g1; + g1 *= g2; + } + glMemoryBarrier(GL_TEXTURE_FETCH_BARRIER_BIT | GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); glUseProgram(FullScreenShader::ComputeShadowBlurHShader::getInstance()->Program); FullScreenShader::ComputeShadowBlurHShader::getInstance()->SetTextureUnits(irr_driver->getFBO(FBO_SCALAR_1024).getRTT()[0]); glBindSampler(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, 0); glBindImageTexture(FullScreenShader::ComputeShadowBlurHShader::getInstance()->TU_dest, LayerTex, 0, false, 0, GL_WRITE_ONLY, GL_R32F); - FullScreenShader::ComputeShadowBlurHShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), sigmaH); + FullScreenShader::ComputeShadowBlurHShader::getInstance()->setUniforms(core::vector2df(1.f / 1024.f, 1.f / 1024.f), weightsH); glDispatchCompute((int)1024 / 8 + 1, (int)1024 / 8 + 1, 1); glMemoryBarrier(GL_SHADER_IMAGE_ACCESS_BARRIER_BIT); } diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 3634ef3da..9e29ccc2a 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -1762,7 +1762,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_COMPUTE_SHADER, file_manager->getAsset("shaders/blurshadowH.comp").c_str()); TU_dest = 1; - AssignUniforms("pixel", "sigma"); + AssignUniforms("pixel", "weights"); AssignSamplerNames(Program, 0, "source"); AssignTextureUnit(Program, TexUnit(TU_dest, "dest")); } @@ -1832,7 +1832,7 @@ namespace FullScreenShader Program = LoadProgram(OBJECT, GL_COMPUTE_SHADER, file_manager->getAsset("shaders/blurshadowV.comp").c_str()); TU_dest = 1; - AssignUniforms("pixel", "sigma"); + AssignUniforms("pixel", "weights"); AssignSamplerNames(Program, 0, "source"); AssignTextureUnit(Program, TexUnit(TU_dest, "dest")); } diff --git a/src/graphics/shaders.hpp b/src/graphics/shaders.hpp index 24f1c616f..367588845 100644 --- a/src/graphics/shaders.hpp +++ b/src/graphics/shaders.hpp @@ -478,7 +478,7 @@ public: ComputeGaussian6HBlurShader(); }; -class ComputeShadowBlurHShader : public ShaderHelperSingleton, public TextureRead +class ComputeShadowBlurHShader : public ShaderHelperSingleton >, public TextureRead { public: GLuint TU_dest; @@ -524,7 +524,7 @@ public: ComputeGaussian6VBlurShader(); }; -class ComputeShadowBlurVShader : public ShaderHelperSingleton, public TextureRead +class ComputeShadowBlurVShader : public ShaderHelperSingleton >, public TextureRead { public: GLuint TU_dest; From cc7f95163c29a19d6905e2e99a76a62fbbd63578 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 19:00:21 +0100 Subject: [PATCH 38/40] Simplify sunlight shadow shader. --- data/shaders/sunlightshadow.frag | 79 ++++++++++---------------------- 1 file changed, 23 insertions(+), 56 deletions(-) diff --git a/data/shaders/sunlightshadow.frag b/data/shaders/sunlightshadow.frag index b375be90c..47abf616c 100644 --- a/data/shaders/sunlightshadow.frag +++ b/data/shaders/sunlightshadow.frag @@ -29,35 +29,27 @@ vec3 getMostRepresentativePoint(vec3 direction, vec3 R, float angularRadius) return (DdotR < d) ? normalize(d * D + normalize (S) * r) : R; } -float getShadowFactor(vec3 pos, float bias, int index) +float getShadowFactor(vec3 pos, int index) { + vec4 shadowcoord = (ShadowViewProjMatrixes[index] * InverseViewMatrix * vec4(pos, 1.0)); + shadowcoord.xy /= shadowcoord.w; + vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5; - vec2 shadowoffset[4] = vec2[]( - vec2(-1., -1.), - vec2(-1., 1.), - vec2(1., -1.), - vec2(1., 1.) - ); - - vec4 shadowcoord = (ShadowViewProjMatrixes[index] * InverseViewMatrix * vec4(pos, 1.0)); - shadowcoord.xy /= shadowcoord.w; - vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5; - - float z = texture(shadowtex, vec3(shadowtexcoord, float(index))).x; - float d = shadowcoord.z; - return min(pow(exp(-32. * d) * z, 8.), 1.); + float z = texture(shadowtex, vec3(shadowtexcoord, float(index))).x; + float d = shadowcoord.z; + return min(pow(exp(-32. * d) * z, 8.), 1.); } void main() { vec2 uv = gl_FragCoord.xy / screen; - float z = texture(dtex, uv).x; - vec4 xpos = getPosFromUVDepth(vec3(uv, z), InverseProjectionMatrix); + float z = texture(dtex, uv).x; + vec4 xpos = getPosFromUVDepth(vec3(uv, z), InverseProjectionMatrix); - vec3 norm = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.)); + vec3 norm = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.)); float roughness =texture(ntex, uv).z; vec3 eyedir = -normalize(xpos.xyz); - // Normalized on the cpu + // Normalized on the cpu vec3 L = direction; float NdotL = clamp(dot(norm, L), 0., 1.); @@ -69,43 +61,18 @@ void main() { vec3 Specular = SpecularBRDF(norm, eyedir, Lightdir, col, roughness) * NdotL; - vec3 outcol = NdotL * col; + vec3 outcol = NdotL * col; - // Shadows - float bias = 0.005 * tan(acos(NdotL)); // According to the slope - bias = clamp(bias, 0., 0.01); - float factor; - if (xpos.z < split0) - factor = getShadowFactor(xpos.xyz, bias, 0); -/* else if (xpos.z < 6.) - { - float a = getShadowFactor(xpos.xyz, bias, 0), b = getShadowFactor(xpos.xyz, bias, 1); - factor = mix(a, b, (xpos.z - 5.)); - }*/ - else if (xpos.z < split1) - factor = getShadowFactor(xpos.xyz, bias, 1); -/* else if (xpos.z < 21.) - { - float a = getShadowFactor(xpos.xyz, bias, 1), b = getShadowFactor(xpos.xyz, bias, 2); - factor = mix(a, b, (xpos.z - 20.)); - }*/ - else if (xpos.z < split2) - factor = getShadowFactor(xpos.xyz, bias, 2); -/* else if (xpos.z < 55.) - { - float a = getShadowFactor(xpos.xyz, bias, 2), b = getShadowFactor(xpos.xyz, bias, 3); - factor = mix(a, b, (xpos.z - 50.) / 5.); - }*/ - else if (xpos.z < splitmax) - factor = getShadowFactor(xpos.xyz, bias, 3); -/* else if (xpos.z < 150.) - { - factor = mix(getShadowFactor(xpos.xyz, bias, 3), 1., (xpos.z - 145.) / 5.); - }*/ - else - factor = 1.; - Diff = vec4(factor * NdotL * col, 1.); - Spec = vec4(factor * Specular, 1.); - return; + // Shadows + int shadowtex_index = 0; + shadowtex_index += (xpos.z >= split0) ? 1 : 0; + shadowtex_index += (xpos.z >= split1) ? 1 : 0; + shadowtex_index += (xpos.z >= split2) ? 1 : 0; + + float factor = getShadowFactor(xpos.xyz, shadowtex_index); + factor = (xpos.z > splitmax) ? 1. : factor; + + Diff = vec4(factor * NdotL * col, 1.); + Spec = vec4(factor * Specular, 1.); } From f241fc3b71fb79cb60ec4b146e5194f13be3b70c Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 19:09:31 +0100 Subject: [PATCH 39/40] Use clamp mode for tex shadow --- src/graphics/shaders.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/graphics/shaders.cpp b/src/graphics/shaders.cpp index 9e29ccc2a..6841f0daa 100644 --- a/src/graphics/shaders.cpp +++ b/src/graphics/shaders.cpp @@ -849,8 +849,8 @@ GLuint createShadowSampler() glGenSamplers(1, &id); glSamplerParameteri(id, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glSamplerParameteri(id, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); - glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GL_REPEAT); - glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GL_REPEAT); + glSamplerParameteri(id, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glSamplerParameteri(id, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); int aniso = UserConfigParams::m_anisotropic; if (aniso == 0) aniso = 1; @@ -865,8 +865,8 @@ void BindTextureShadow(GLuint TU, GLuint tex) glBindTexture(GL_TEXTURE_2D_ARRAY, tex); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_REPEAT); - glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + glTexParameteri(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE); glTexParameterf(GL_TEXTURE_2D_ARRAY, GL_TEXTURE_COMPARE_FUNC, GL_LEQUAL); } From a8ce996047fcb0627e4abc0f63c9476eec7186c6 Mon Sep 17 00:00:00 2001 From: Vincent Lejeune Date: Tue, 9 Dec 2014 21:20:55 +0100 Subject: [PATCH 40/40] Revert "Simplify sunlight shadow shader." This reverts commit cc7f95163c29a19d6905e2e99a76a62fbbd63578. --- data/shaders/sunlightshadow.frag | 79 ++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 23 deletions(-) diff --git a/data/shaders/sunlightshadow.frag b/data/shaders/sunlightshadow.frag index 47abf616c..b375be90c 100644 --- a/data/shaders/sunlightshadow.frag +++ b/data/shaders/sunlightshadow.frag @@ -29,27 +29,35 @@ vec3 getMostRepresentativePoint(vec3 direction, vec3 R, float angularRadius) return (DdotR < d) ? normalize(d * D + normalize (S) * r) : R; } -float getShadowFactor(vec3 pos, int index) +float getShadowFactor(vec3 pos, float bias, int index) { - vec4 shadowcoord = (ShadowViewProjMatrixes[index] * InverseViewMatrix * vec4(pos, 1.0)); - shadowcoord.xy /= shadowcoord.w; - vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5; - float z = texture(shadowtex, vec3(shadowtexcoord, float(index))).x; - float d = shadowcoord.z; - return min(pow(exp(-32. * d) * z, 8.), 1.); + vec2 shadowoffset[4] = vec2[]( + vec2(-1., -1.), + vec2(-1., 1.), + vec2(1., -1.), + vec2(1., 1.) + ); + + vec4 shadowcoord = (ShadowViewProjMatrixes[index] * InverseViewMatrix * vec4(pos, 1.0)); + shadowcoord.xy /= shadowcoord.w; + vec2 shadowtexcoord = shadowcoord.xy * 0.5 + 0.5; + + float z = texture(shadowtex, vec3(shadowtexcoord, float(index))).x; + float d = shadowcoord.z; + return min(pow(exp(-32. * d) * z, 8.), 1.); } void main() { vec2 uv = gl_FragCoord.xy / screen; - float z = texture(dtex, uv).x; - vec4 xpos = getPosFromUVDepth(vec3(uv, z), InverseProjectionMatrix); + float z = texture(dtex, uv).x; + vec4 xpos = getPosFromUVDepth(vec3(uv, z), InverseProjectionMatrix); - vec3 norm = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.)); + vec3 norm = normalize(DecodeNormal(2. * texture(ntex, uv).xy - 1.)); float roughness =texture(ntex, uv).z; vec3 eyedir = -normalize(xpos.xyz); - // Normalized on the cpu + // Normalized on the cpu vec3 L = direction; float NdotL = clamp(dot(norm, L), 0., 1.); @@ -61,18 +69,43 @@ void main() { vec3 Specular = SpecularBRDF(norm, eyedir, Lightdir, col, roughness) * NdotL; - vec3 outcol = NdotL * col; + vec3 outcol = NdotL * col; - // Shadows - int shadowtex_index = 0; - shadowtex_index += (xpos.z >= split0) ? 1 : 0; - shadowtex_index += (xpos.z >= split1) ? 1 : 0; - shadowtex_index += (xpos.z >= split2) ? 1 : 0; - - float factor = getShadowFactor(xpos.xyz, shadowtex_index); - factor = (xpos.z > splitmax) ? 1. : factor; - - Diff = vec4(factor * NdotL * col, 1.); - Spec = vec4(factor * Specular, 1.); + // Shadows + float bias = 0.005 * tan(acos(NdotL)); // According to the slope + bias = clamp(bias, 0., 0.01); + float factor; + if (xpos.z < split0) + factor = getShadowFactor(xpos.xyz, bias, 0); +/* else if (xpos.z < 6.) + { + float a = getShadowFactor(xpos.xyz, bias, 0), b = getShadowFactor(xpos.xyz, bias, 1); + factor = mix(a, b, (xpos.z - 5.)); + }*/ + else if (xpos.z < split1) + factor = getShadowFactor(xpos.xyz, bias, 1); +/* else if (xpos.z < 21.) + { + float a = getShadowFactor(xpos.xyz, bias, 1), b = getShadowFactor(xpos.xyz, bias, 2); + factor = mix(a, b, (xpos.z - 20.)); + }*/ + else if (xpos.z < split2) + factor = getShadowFactor(xpos.xyz, bias, 2); +/* else if (xpos.z < 55.) + { + float a = getShadowFactor(xpos.xyz, bias, 2), b = getShadowFactor(xpos.xyz, bias, 3); + factor = mix(a, b, (xpos.z - 50.) / 5.); + }*/ + else if (xpos.z < splitmax) + factor = getShadowFactor(xpos.xyz, bias, 3); +/* else if (xpos.z < 150.) + { + factor = mix(getShadowFactor(xpos.xyz, bias, 3), 1., (xpos.z - 145.) / 5.); + }*/ + else + factor = 1.; + Diff = vec4(factor * NdotL * col, 1.); + Spec = vec4(factor * Specular, 1.); + return; }