OGL32CTX: Replace implicitly declared uniforms in bubble
git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14984 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
751d09d35f
commit
75b492b871
@ -18,15 +18,16 @@
|
||||
|
||||
// Creates a bubble (wave) effect by distorting the texture depending on time
|
||||
#version 130
|
||||
uniform mat4 ModelViewProjectionMatrix;
|
||||
uniform float time;
|
||||
out vec2 uv;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
|
||||
gl_Position = ModelViewProjectionMatrix * gl_Vertex;
|
||||
|
||||
float delta_x = cos(time*3.0) * sin( 4.0 * gl_TexCoord[0].st.s * 6.28318531 );
|
||||
float delta_y = cos(time*2.0) * sin( 3.0 * gl_TexCoord[0].st.t * 6.28318531 );
|
||||
|
||||
uv = (gl_TextureMatrix[0] * gl_MultiTexCoord0).st + vec2(0.02*delta_x, 0.02*delta_y);
|
||||
uv = gl_MultiTexCoord0.st + vec2(0.02*delta_x, 0.02*delta_y);
|
||||
}
|
||||
|
@ -239,6 +239,12 @@ void BubbleEffectProvider::OnSetConstants(IMaterialRendererServices *srv, int)
|
||||
|
||||
const float diff = (time - start) / 3.0f;
|
||||
|
||||
core::matrix4 ModelViewProjectionMatrix = srv->getVideoDriver()->getTransform(ETS_PROJECTION);
|
||||
ModelViewProjectionMatrix *= srv->getVideoDriver()->getTransform(ETS_VIEW);
|
||||
ModelViewProjectionMatrix *= srv->getVideoDriver()->getTransform(ETS_WORLD);
|
||||
|
||||
srv->setVertexShaderConstant("ModelViewProjectionMatrix", ModelViewProjectionMatrix.pointer(), 16);
|
||||
|
||||
if (visible)
|
||||
{
|
||||
transparency = diff;
|
||||
|
Loading…
x
Reference in New Issue
Block a user