Merge branch 'master' of github.com:supertuxkart/stk-code
This commit is contained in:
commit
8dfe72f73f
@ -33,6 +33,8 @@ void main()
|
||||
|
||||
// Uncharted2 tonemap with Auria's custom coefficients
|
||||
vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06);
|
||||
// Protect us from negative coefficient just in case...
|
||||
perChannel = max(perChannel, vec4(0.));
|
||||
perChannel = pow(perChannel, vec4(2.2));
|
||||
|
||||
vec2 inside = uv - 0.5;
|
||||
|
@ -14,6 +14,6 @@ vec3 getLightFactor(float specMapValue)
|
||||
vec3 DiffuseComponent = texture(DiffuseMap, tc).xyz;
|
||||
vec3 SpecularComponent = texture(SpecularMap, tc).xyz;
|
||||
float ao = texture(SSAO, tc).x;
|
||||
vec3 tmp = DiffuseComponent + SpecularComponent * specMapValue;
|
||||
vec3 tmp = DiffuseComponent + SpecularComponent * max(specMapValue, 0.);
|
||||
return tmp * ao;
|
||||
}
|
@ -493,7 +493,11 @@ void IrrDriver::initDevice()
|
||||
if (strstr((const char *)glGetString(GL_VENDOR), "ATI") != NULL)
|
||||
m_need_srgb_workaround = true;
|
||||
}
|
||||
#ifdef WIN32
|
||||
m_glsl = (GLMajorVersion > 3 || (GLMajorVersion == 3 && GLMinorVersion >= 3));
|
||||
#else
|
||||
m_glsl = (GLMajorVersion > 3 || (GLMajorVersion == 3 && GLMinorVersion >= 1));
|
||||
#endif
|
||||
initGL();
|
||||
|
||||
// Parse extensions
|
||||
|
@ -464,16 +464,21 @@ void PostProcessing::renderMotionBlur(unsigned cam, FrameBuffer &in_fbo, FrameBu
|
||||
|
||||
scene::ICameraSceneNode * const camnode =
|
||||
Camera::getCamera(cam)->getCameraSceneNode();
|
||||
// Calculate the kart's Y position on screen
|
||||
const core::vector3df pos =
|
||||
Camera::getCamera(cam)->getKart()->getNode()->getPosition();
|
||||
float ndc[4];
|
||||
core::matrix4 trans = camnode->getProjectionMatrix();
|
||||
trans *= camnode->getViewMatrix();
|
||||
|
||||
trans.transformVect(ndc, pos);
|
||||
const float karty = (ndc[1] / ndc[3]) * 0.5f + 0.5f;
|
||||
setMotionBlurCenterY(cam, karty);
|
||||
// Calculate the kart's Y position on screen
|
||||
if (Camera::getCamera(cam)->getKart())
|
||||
{
|
||||
const core::vector3df pos = Camera::getCamera(cam)->getKart()->getNode()->getPosition();
|
||||
float ndc[4];
|
||||
core::matrix4 trans = camnode->getProjectionMatrix();
|
||||
trans *= camnode->getViewMatrix();
|
||||
|
||||
trans.transformVect(ndc, pos);
|
||||
const float karty = (ndc[1] / ndc[3]) * 0.5f + 0.5f;
|
||||
setMotionBlurCenterY(cam, karty);
|
||||
}
|
||||
else
|
||||
setMotionBlurCenterY(cam, 0.5f);
|
||||
|
||||
out_fbo.Bind();
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
@ -105,6 +105,15 @@ void STKAnimatedMesh::updateNoGL()
|
||||
}
|
||||
isMaterialInitialized = true;
|
||||
}
|
||||
|
||||
for (u32 i = 0; i < m->getMeshBufferCount(); ++i)
|
||||
{
|
||||
scene::IMeshBuffer* mb = Mesh->getMeshBuffer(i);
|
||||
if (!mb)
|
||||
continue;
|
||||
if (mb)
|
||||
GLmeshes[i].TextureMatrix = getMaterial(i).getTextureMatrix(0);
|
||||
}
|
||||
}
|
||||
|
||||
void STKAnimatedMesh::updateGL()
|
||||
@ -177,8 +186,6 @@ void STKAnimatedMesh::updateGL()
|
||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||
}
|
||||
}
|
||||
if (mb)
|
||||
GLmeshes[i].TextureMatrix = getMaterial(i).getTextureMatrix(0);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -59,6 +59,7 @@ CutsceneWorld::CutsceneWorld() : World()
|
||||
WorldStatus::setClockMode(CLOCK_NONE);
|
||||
m_use_highscores = false;
|
||||
m_play_racestart_sounds = false;
|
||||
m_fade_duration = 1.0f;
|
||||
} // CutsceneWorld
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@ -240,13 +241,13 @@ void CutsceneWorld::update(float dt)
|
||||
float fade = 0.0f;
|
||||
float fadeIn = -1.0f;
|
||||
float fadeOut = -1.0f;
|
||||
if (m_time < 2.0f)
|
||||
if (m_time < m_fade_duration)
|
||||
{
|
||||
fadeIn = 1.0f - (float)m_time / 2.0f;
|
||||
fadeIn = 1.0f - (float)m_time / m_fade_duration;
|
||||
}
|
||||
if (m_time > m_duration - 2.0f)
|
||||
if (m_time > m_duration - m_fade_duration)
|
||||
{
|
||||
fadeOut = (float)(m_time - (m_duration - 2.0f)) / 2.0f;
|
||||
fadeOut = (float)(m_time - (m_duration - m_fade_duration)) / m_fade_duration;
|
||||
}
|
||||
|
||||
if (fadeIn >= 0.0f && fadeOut >= 0.0f)
|
||||
|
@ -45,6 +45,8 @@ class CutsceneWorld : public World
|
||||
double m_duration;
|
||||
bool m_aborted;
|
||||
|
||||
float m_fade_duration;
|
||||
|
||||
// TODO find a better way than static
|
||||
static bool s_use_duration;
|
||||
|
||||
@ -109,7 +111,7 @@ public:
|
||||
// ------------------------------------------------------------------------
|
||||
void abortCutscene()
|
||||
{
|
||||
if (m_time < m_duration - 2.0f) m_duration = m_time + 2.0f;
|
||||
if (m_time < m_duration - m_fade_duration) m_duration = m_time + m_fade_duration;
|
||||
m_aborted = true;
|
||||
}
|
||||
|
||||
|
@ -904,6 +904,9 @@ void KartHoverListener::onSelectionChanged(DynamicRibbonWidget* theWidget,
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_parent->m_kart_widgets[playerID].getKartInternalName() == selectionID)
|
||||
return; // already selected
|
||||
|
||||
m_parent->updateKartWidgetModel(playerID, selectionID, selectionText);
|
||||
m_parent->m_kart_widgets[playerID].setKartInternalName(selectionID);
|
||||
m_parent->updateKartStats(playerID, selectionID);
|
||||
|
Loading…
Reference in New Issue
Block a user