Hi guys. I’m trying trying to render earth from a 16-bit heightmap, but for some reason I lost a lot of detail.
In these screenshots the red pixels all get the same value from the texture, even though the texture is very detailed.
This is a big problem since I need to clearly distinguish land from sea.
I suspect image import settings might be the problem, but I’ve tried all values and I never get the correct result.
My shader code:
void vert(inout appdata_full v, out Input o)
{
v.vertex.xyz = normalize(v.vertex.xyz);
o.position = v.vertex.xyz;
}
void surf(Input IN, inout SurfaceOutputStandard o)
{
float2 uv = sphere2map(normalize(IN.position));
float h = tex2D(_Heightmap, uv);
static float waterLevel = 0.57254907;
o.Albedo = h == waterLevel ?
float3(1, 0, 0) : // red at water level
h > waterLevel ?
float3(0, (h - waterLevel) / (1 - waterLevel), 0) : // green above
float3(0, 0, h / waterLevel); // blue below
}
Any tips would be really appreciated!


