2011-09-05 15:02:06 +00:00
|
|
|
// -*-C++-*-
|
2012-07-02 20:12:24 +00:00
|
|
|
// -*-C++-*-
|
|
|
|
// Texture switching based on face slope and snow level
|
|
|
|
// based on earlier work by Frederic Bouvier, Tim Moore, and Yves Sablonier.
|
|
|
|
// © Emilian Huminiuc 2011
|
2011-09-05 15:02:06 +00:00
|
|
|
|
|
|
|
|
2011-10-29 09:57:04 +00:00
|
|
|
#version 120
|
2011-09-05 15:02:06 +00:00
|
|
|
|
2013-01-17 09:51:23 +00:00
|
|
|
varying float RawPosZ;
|
|
|
|
varying vec3 WorldPos;
|
|
|
|
varying vec3 normal;
|
|
|
|
varying vec3 Vnormal;
|
|
|
|
|
|
|
|
uniform mat4 osg_ViewMatrixInverse;
|
2011-12-01 20:58:14 +00:00
|
|
|
|
2011-09-05 15:02:06 +00:00
|
|
|
void main()
|
2011-12-01 20:58:14 +00:00
|
|
|
{
|
2013-01-17 09:51:23 +00:00
|
|
|
RawPosZ = gl_Vertex.z;
|
|
|
|
WorldPos = (osg_ViewMatrixInverse *gl_ModelViewMatrix * gl_Vertex).xyz;
|
2011-09-05 15:02:06 +00:00
|
|
|
gl_Position = ftransform();
|
|
|
|
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
|
|
|
|
normal = normalize(gl_Normal);
|
2012-07-02 20:12:24 +00:00
|
|
|
Vnormal = normalize(gl_NormalMatrix * gl_Normal);
|
2011-09-05 15:02:06 +00:00
|
|
|
}
|