Move the wind portion into the world matrix

It should make the normal correct although I didnt notice any visual difference.
This commit is contained in:
vlj
2014-03-28 02:39:17 +01:00
parent 008b070aab
commit 81b1e9fb94

View File

@@ -52,9 +52,9 @@ mat4 getInverseWorldMatrix(vec3 translation, vec3 rotation)
void main()
{
mat4 ModelMatrix = getWorldMatrix(Origin, Orientation);
mat4 TransposeInverseModelView = transpose(getInverseWorldMatrix(Origin, Orientation) * InverseViewMatrix);
gl_Position = ViewProjectionMatrix * ModelMatrix * vec4(Position + windDir * Color.r, 1.);
mat4 ModelMatrix = getWorldMatrix(Origin + windDir * Color.r, Orientation);
mat4 TransposeInverseModelView = transpose(getInverseWorldMatrix(Origin + windDir * Color.r, Orientation) * InverseViewMatrix);
gl_Position = ViewProjectionMatrix * ModelMatrix * vec4(Position, 1.);
nor = (TransposeInverseModelView * vec4(Normal, 0.)).xyz;
uv = Texcoord;
}