NULL/NO DATA values in Displacement Map

Hello all, has anyone dealt with Null or No Data values when creating a Displacement Map? I am working with actual ground elevation data but have “holes” in my raster data set as NoData, the Displacement Map shows them as a deep depression or drop(see attatchment). I would love to just have it…not displace at all in those areas. just show a blank area. anyone have any ideas on how i can control this? anything i need to do to the original value image? Thanks for your thoughts!

By default your plane is the blue part - that part in the corner is the original elevation (equal to black / null / 0 color channel / 0 alpha channel / nan in your displacement map.) Anything with a higher value on the displacement map is displaced “up” (at least in your case.)

So wherever your displacement map has no color - it’s rendered without a displacement (as a blue plane at the original elevation.) Displacement is not calculated relative to the neighbouring vertexes. If you’d like the vertex not to return to the bottom and become a drop - it has to be given the same color as the neighbouring pixels on the displacement map.

(If you want to hide parts that have no displacement data on the map - you can try using the alpha channel of the displacement map with Material.alphaMap.)

Thanks. would this alpha idea be dependent on the Material im using? i’ve been having trouble “seeing” under my displacement mesh, so I am using MeshToonMaterial, not Standard or Phong.

this would be my basic goal. blanks/holes where I have No Data. need a way to mask the No Data displacement or not have the displacement happen at all…

Maybe using a Plane and DisplacementMap is the issue? it may “always” displace?
does anybody have any other ideas how to create this surface(ground) without using an image to displace? I have a regular array of elevation values(xyz).

Can you please share a codepen / jsfiddle showing what you have in mind (not necessarily entire files / codebase, just something to show what you want to build) ?

It’d be a bit easier to help you that way.

I have never actually used external files(my displacement images) in jsfiddle sorry, however, it is basically this exact simple example but using my own DisplacentMap image file and Texture image file for the color.

i included the .png here if youre interested…
(is NoData vs ‘Transparent’ an issue?)

it also has lots of similar questions/answers here: (alpha map as you suggested)