2019-07-21 03:04:35 +03:00
|
|
|
$input v_texcoord0
|
|
|
|
|
|
|
|
#include "terrain_common.sh"
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2019-07-22 08:02:07 +03:00
|
|
|
vec2 s = texture2D(u_SmapSampler, v_texcoord0).rg * u_DmapFactor;
|
|
|
|
vec3 n = normalize(vec3(-s, 1));
|
|
|
|
float d = clamp(n.z, 0.0, 1.0) / 3.14159;
|
2019-07-21 03:04:35 +03:00
|
|
|
vec3 r = vec3(d, d, d);
|
2019-07-22 08:02:07 +03:00
|
|
|
gl_FragColor = vec4(r, 1);
|
2019-07-21 03:04:35 +03:00
|
|
|
}
|