diff --git a/Effects/airfield.eff b/Effects/airfield.eff
index b8b9f4872..8e9a23edc 100644
--- a/Effects/airfield.eff
+++ b/Effects/airfield.eff
@@ -148,10 +148,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
visibility
diff --git a/Effects/grass.eff b/Effects/grass.eff
index 2262d12cc..f55faa072 100644
--- a/Effects/grass.eff
+++ b/Effects/grass.eff
@@ -141,10 +141,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
visibility
diff --git a/Effects/terrain-default.eff b/Effects/terrain-default.eff
index 5053eead8..e9faf666c 100644
--- a/Effects/terrain-default.eff
+++ b/Effects/terrain-default.eff
@@ -336,10 +336,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
grain_strength
@@ -994,10 +990,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
visibility
@@ -1313,10 +1305,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
visibility
@@ -1572,10 +1560,6 @@
Shaders/include_fog.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
visibility
diff --git a/Effects/terrain-overlay.eff b/Effects/terrain-overlay.eff
index 5e06a425f..004b92997 100644
--- a/Effects/terrain-overlay.eff
+++ b/Effects/terrain-overlay.eff
@@ -169,10 +169,6 @@
Shaders/filters-ALS.frag
Shaders/shadows-include.frag
Shaders/clustered-include.frag
-
- orthophotoTexCoord
- 14
-
grain_strength
diff --git a/Effects/ws30-road.eff b/Effects/ws30-road.eff
index 354b1bfc5..98180a260 100644
--- a/Effects/ws30-road.eff
+++ b/Effects/ws30-road.eff
@@ -233,11 +233,6 @@
binormal
7
-
- orthophotoTexCoord
- 14
-
-
diff --git a/Shaders/airfield-ALS.frag b/Shaders/airfield-ALS.frag
index e039ddcfc..1649ade04 100644
--- a/Shaders/airfield-ALS.frag
+++ b/Shaders/airfield-ALS.frag
@@ -10,7 +10,6 @@ varying vec3 worldPos;
varying vec2 rawPos;
varying vec3 ecViewdir;
varying vec4 ecPosition;
-varying vec2 orthoTexCoord;
uniform sampler2D texture;
@@ -170,7 +169,7 @@ float noise_2000m = Noise3D(worldPos.xyz, 2000.0);
float local_autumn_factor = texel.a;
if (orthophotoAvailable) {
- vec4 sat_texel = texture2D(orthophotoTexture, orthoTexCoord);
+ vec4 sat_texel = texture2D(orthophotoTexture, gl_TexCoord[2].st);
if (sat_texel.a > 0) {
texel.rgb = sat_texel.rgb;
}
diff --git a/Shaders/default.frag b/Shaders/default.frag
index 8bd60ccf6..c3cfef17c 100644
--- a/Shaders/default.frag
+++ b/Shaders/default.frag
@@ -5,7 +5,6 @@
varying vec4 diffuse_term;
varying vec3 normal;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
uniform sampler2D texture;
@@ -62,7 +61,7 @@ void main()
texel = texture2D(texture, gl_TexCoord[0].st);
if (orthophotoAvailable) {
- vec4 sat_texel = texture2D(orthophotoTexture, orthoTexCoord);
+ vec4 sat_texel = texture2D(orthophotoTexture, gl_TexCoord[2].st);
if (sat_texel.a > 0) {
texel.rgb = sat_texel.rgb;
}
diff --git a/Shaders/default.vert b/Shaders/default.vert
index ef8cfa17c..0f4acb560 100644
--- a/Shaders/default.vert
+++ b/Shaders/default.vert
@@ -12,15 +12,12 @@
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
-attribute vec2 orthophotoTexCoord;
-
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
// bugs with gl_FrontFacing in the fragment shader.
varying vec4 diffuse_term;
varying vec3 normal;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
uniform int colorMode;
@@ -38,7 +35,7 @@ void main()
gl_Position = ftransform();
ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- orthoTexCoord = orthophotoTexCoord;
+ gl_TexCoord[2] = gl_TextureMatrix[2] * gl_MultiTexCoord2;
normal = gl_NormalMatrix * gl_Normal;
vec4 ambient_color, diffuse_color;
if (colorMode == MODE_DIFFUSE) {
diff --git a/Shaders/generic-ALS-base.vert b/Shaders/generic-ALS-base.vert
index 3c531c444..5f7131146 100644
--- a/Shaders/generic-ALS-base.vert
+++ b/Shaders/generic-ALS-base.vert
@@ -15,8 +15,6 @@
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
-attribute vec2 orthophotoTexCoord;
-
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
@@ -24,7 +22,6 @@ attribute vec2 orthophotoTexCoord;
varying vec4 diffuse_term;
varying vec3 normal;
varying vec3 relPos;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
varying float yprime_alt;
@@ -81,7 +78,7 @@ void main()
ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- orthoTexCoord = orthophotoTexCoord;
+ gl_TexCoord[2] = gl_TextureMatrix[2] * gl_MultiTexCoord2;
normal = gl_NormalMatrix * gl_Normal;
vec4 ambient_color, diffuse_color;
if (colorMode == MODE_DIFFUSE) {
diff --git a/Shaders/terrain-ALS-base.frag b/Shaders/terrain-ALS-base.frag
index 841eb6a03..65b410c76 100644
--- a/Shaders/terrain-ALS-base.frag
+++ b/Shaders/terrain-ALS-base.frag
@@ -14,7 +14,6 @@ uniform sampler2D orthophotoTexture;
varying float yprime_alt;
varying float mie_angle;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
@@ -94,7 +93,7 @@ void main()
texel = texture2D(texture, gl_TexCoord[0].st);
if (orthophotoAvailable) {
- vec4 sat_texel = texture2D(orthophotoTexture, orthoTexCoord);
+ vec4 sat_texel = texture2D(orthophotoTexture, gl_TexCoord[2].st);
if (sat_texel.a > 0) {
texel.rgb = sat_texel.rgb;
}
diff --git a/Shaders/terrain-ALS-detailed.frag b/Shaders/terrain-ALS-detailed.frag
index 8bb9922eb..6a9546683 100644
--- a/Shaders/terrain-ALS-detailed.frag
+++ b/Shaders/terrain-ALS-detailed.frag
@@ -8,7 +8,6 @@ varying vec3 normal;
varying vec3 relPos;
varying vec2 rawPos;
varying vec3 worldPos;
-varying vec2 orthoTexCoord;
varying vec4 eyePos;
@@ -135,7 +134,7 @@ float noise_2000m = Noise3D(worldPos.xyz, 2000.0);
float local_autumn_factor = texel.a;
if (orthophotoAvailable) {
- vec4 sat_texel = texture2D(orthophotoTexture, orthoTexCoord);
+ vec4 sat_texel = texture2D(orthophotoTexture, gl_TexCoord[2].st);
if (sat_texel.a > 0) {
texel.rgb = sat_texel.rgb;
flag = 0;
diff --git a/Shaders/terrain-ALS-detailed.vert b/Shaders/terrain-ALS-detailed.vert
index 17d2dc156..2888c343d 100644
--- a/Shaders/terrain-ALS-detailed.vert
+++ b/Shaders/terrain-ALS-detailed.vert
@@ -15,8 +15,6 @@
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
-attribute vec2 orthophotoTexCoord;
-
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
@@ -26,7 +24,6 @@ varying vec3 normal;
varying vec3 relPos;
varying vec2 rawPos;
varying vec3 worldPos;
-varying vec2 orthoTexCoord;
varying vec4 eyePos;
@@ -99,7 +96,7 @@ void main()
//vec4 ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- orthoTexCoord = orthophotoTexCoord;
+ gl_TexCoord[2] = gl_TextureMatrix[2] * gl_MultiTexCoord2;
normal = gl_NormalMatrix * gl_Normal;
//nvec = (gl_NormalMatrix * gl_Normal).xy;
vec4 ambient_color, diffuse_color;
diff --git a/Shaders/terrain-ALS-ultra.frag b/Shaders/terrain-ALS-ultra.frag
index 015fada4a..05eb72eb2 100644
--- a/Shaders/terrain-ALS-ultra.frag
+++ b/Shaders/terrain-ALS-ultra.frag
@@ -10,7 +10,6 @@ varying vec2 rawPos;
varying vec3 worldPos;
varying vec3 ecViewdir;
varying vec2 grad_dir;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
@@ -244,7 +243,7 @@ float snownoise_50m = mix(noise_50m, slopenoise_100m, clamp(3.0*(1.0-steepness),
float local_autumn_factor = texel.a;
if (orthophotoAvailable) {
- vec4 sat_texel = texture2D(orthophotoTexture, orthoTexCoord);
+ vec4 sat_texel = texture2D(orthophotoTexture, gl_TexCoord[2].st);
if (sat_texel.a > 0) {
texel.rgb = sat_texel.rgb;
flag = 0;
diff --git a/Shaders/terrain-ALS-ultra.vert b/Shaders/terrain-ALS-ultra.vert
index 191061152..66088a659 100644
--- a/Shaders/terrain-ALS-ultra.vert
+++ b/Shaders/terrain-ALS-ultra.vert
@@ -15,8 +15,6 @@
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
-attribute vec2 orthophotoTexCoord;
-
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
@@ -28,7 +26,6 @@ varying vec2 rawPos;
varying vec3 worldPos;
varying vec3 ecViewdir;
varying vec2 grad_dir;
-varying vec2 orthoTexCoord;
varying vec4 ecPosition;
varying float mie_angle;
@@ -114,7 +111,7 @@ void main()
ecPosition = gl_ModelViewMatrix * gl_Vertex;
//gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- orthoTexCoord = orthophotoTexCoord;
+ gl_TexCoord[2] = gl_TextureMatrix[2] * gl_MultiTexCoord2;
normal = gl_NormalMatrix * gl_Normal;
//nvec = (gl_NormalMatrix * gl_Normal).xy;
vec4 ambient_color, diffuse_color;
diff --git a/Shaders/ws30-ALS-detailed.frag b/Shaders/ws30-ALS-detailed.frag
index 490152c0e..465818b72 100644
--- a/Shaders/ws30-ALS-detailed.frag
+++ b/Shaders/ws30-ALS-detailed.frag
@@ -51,7 +51,6 @@ varying vec2 rawPos;
varying vec3 worldPos;
// Testing code:
//vec3 worldPos = vec3(5000.0, 6000.0, 7000.0) + vec3(vec2(rawPos), 600.0); // vec3(100.0, 10.0, 3.0);
-//varying vec2 orthoTexCoord;
varying vec4 eyePos;
diff --git a/Shaders/ws30-ALS-detailed.vert b/Shaders/ws30-ALS-detailed.vert
index d74d90051..c5bc67780 100644
--- a/Shaders/ws30-ALS-detailed.vert
+++ b/Shaders/ws30-ALS-detailed.vert
@@ -16,8 +16,6 @@
#define MODE_DIFFUSE 1
#define MODE_AMBIENT_AND_DIFFUSE 2
-attribute vec2 orthophotoTexCoord;
-
// The constant term of the lighting equation that doesn't depend on
// the surface normal is passed in gl_{Front,Back}Color. The alpha
// component is set to 1 for front, 0 for back in order to work around
@@ -28,7 +26,6 @@ varying vec3 relPos;
varying vec2 ground_tex_coord;
varying vec2 rawPos;
varying vec3 worldPos;
-//varying vec2 orthoTexCoord;
varying vec4 eyePos;
varying vec4 ecPosition;
@@ -128,7 +125,6 @@ void main()
ecPosition = gl_ModelViewMatrix * gl_Vertex;
gl_Position = ftransform();
gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0;
- //orthoTexCoord = orthophotoTexCoord;
normal = gl_NormalMatrix * gl_Normal;
//nvec = (gl_NormalMatrix * gl_Normal).xy;
diff --git a/Shaders/ws30-water-ALS-detailed.frag b/Shaders/ws30-water-ALS-detailed.frag
index 587360e29..6874e93c9 100644
--- a/Shaders/ws30-water-ALS-detailed.frag
+++ b/Shaders/ws30-water-ALS-detailed.frag
@@ -51,7 +51,6 @@ varying vec2 rawPos;
varying vec3 worldPos;
// Testing code:
//vec3 worldPos = vec3(5000.0, 6000.0, 7000.0) + vec3(vec2(rawPos), 600.0); // vec3(100.0, 10.0, 3.0);
-//varying vec2 orthoTexCoord;
varying vec4 eyePos;