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: Code (HLSL): 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!
Hi, have you tried ticking "Ignore PNG file gamma"? If not working, can you try disabling "Generate Mip Maps"? Or try both of them.
Thanks for the tip, but I'm afraid it didn't help. "Ignore PNG file gamma" doesn't change anything, probably because this is a tif file. Disabling "Generate Mip Maps" still leaves me with the same red areas. Since I'd primarily display earth up close, I don't actually use mip maps anyway, so I can leave them disabled.
AFAIK Unity doesn't support 16 bit tiff files in the base image importer. You must use jpg png, exr, or hdr file formats for importing > 8 bit data formats. A 16 bit tiff gets quantized to 8 bit on import regardless of the target image format you use. edit: png, not jpg. jpg doesn’t support 16 bit at all.