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;
|
2020-12-22 09:52:59 +00:00
|
|
|
varying vec4 eyePos;
|
2013-01-17 09:51:23 +00:00
|
|
|
varying vec3 normal;
|
|
|
|
varying vec3 Vnormal;
|
|
|
|
|
|
|
|
uniform mat4 osg_ViewMatrixInverse;
|
2011-12-01 20:58:14 +00:00
|
|
|
|
2020-11-10 00:45:54 +00:00
|
|
|
void setupShadows(vec4 eyeSpacePos);
|
|
|
|
|
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;
|
2020-12-22 09:52:59 +00:00
|
|
|
eyePos = gl_ModelViewMatrix * gl_Vertex;
|
2020-11-10 00:45:54 +00:00
|
|
|
WorldPos = (osg_ViewMatrixInverse * eyePos).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);
|
2020-11-10 00:45:54 +00:00
|
|
|
setupShadows(eyePos);
|
2011-09-05 15:02:06 +00:00
|
|
|
}
|