You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//Ocean/land mask, baked into colour texture alpha channel
133
-
//vec4 Colour = texture(uTexture, vTexCoord);
134
-
//mask = Colour.a;
135
137
bool water = mask <=0.7;
136
138
//bool water = mask >= 0.85 && depth <= 1.0;
137
139
//Water calc for shaded relief textures
@@ -151,38 +153,56 @@ if (blendFactor >= 0.0)
151
153
//N = normalize(vVertex);
152
154
//Flatten normal
153
155
N =normalize(mat3(uNMatrix) *normalize(vVertex));
154
-
//outColour = vec3(1.0, 0.0, 0.0, 1.0);
155
-
//return;
156
156
}
157
157
158
158
if (water &&!snow) //Sea-level ice fix, don't apply water shading
159
159
{
160
160
//Bathymetry is included in topo data
161
-
//With x10 vertical exaggeration, bathymetry max is -10952M in Mm range [-0.10952,0]
162
-
//TODO: FIX THIS, V_EXAG IS NOT HARD CODED, PASS IN HEIGHT MIN/MAX AS UNIFORM !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
163
-
float DMIN =-0.104809;
164
-
float depth =1.0- ((vlen - radius) / DMIN);
161
+
//Normalised depth [0,1] where 0 is sea level
162
+
float depth = ((vlen - radius) / (heightmin));
163
+
164
+
//Calculate the ocean colour
165
+
//if (bluemarble)
165
166
if (!bathymetry)
166
167
{
167
-
//Plotting ocean as surface, blend bathymetry with earth texture based on depth to
168
-
//show sense of water depth and some blurred bathymetry detail only
168
+
//blend bathymetry with earth texture based on depth to
169
+
//show sense of water depth and some blurred bathymetry detail
169
170
170
-
//Remove detail of lower depths by clamping to upper range
171
-
float depth2 =clamp(depth, 0.6, 1.0) -0.4;
171
+
//Remove detail of lower depths by clamping to upper range
0 commit comments