00001 varying vec3 vEye;
00002 varying vec3 vNormal;
00003
00004 void main()
00005 {
00006
00007 vNormal = gl_NormalMatrix * gl_Normal;
00008
00009
00010 vec4 vPos = gl_ModelViewMatrix * gl_Vertex;
00011
00012
00013 vEye = -vPos.xyz;
00014
00015
00016 gl_TexCoord[0] = gl_MultiTexCoord0;
00017
00018
00019 gl_Position = ftransform();
00020 }
00021
00022 ~~~~~
00023
00024 varying vec3 vEye;
00025 varying vec3 vNormal;
00026
00027 uniform float reflectivity;
00028
00029 uniform sampler2D Texture0;
00030
00031 uniform samplerCube Texture2;
00032
00033
00034
00035 void main()
00036 {
00037
00038 vec3 vN = normalize( vNormal );
00039
00040
00041 vec3 vE = normalize( vEye );
00042
00043
00044 vec3 vR = reflect( vE, vN );
00045
00046
00047 vR = mat3( gl_TextureMatrix[0] ) * vR;
00048 vR.x = -vR.x;
00049
00050
00051
00052
00053 gl_FragColor = textureCube( Texture2, vR.xyz );
00054
00055
00056 vec4 tex = texture2D( Texture0, gl_TexCoord[0].xy );
00057
00058
00059 gl_FragColor.a = reflectivity * tex.a;
00060 }