Blurring a generated alpha mask

I tried all day to get this work.

So instead of using tilemaps, I want to generate a layer mask for every texture layer which then gets put onto the ground. I managed to generate those layer masks based on the state of a tileGrid (which can change any moment in the game, therefore I want to generate the ground texture on demand)

Problem is, that I can’t manage to blur the layermasks. I tried different approaches. I put all my alpha values (8bit) in a 2d-byte field and tried applying various blur algorithms myself, but apparently I lack the skills to implement/copypaste box or gaussian blur myself, because the layermasks always turned black or didn’t change at all.

Next, I tried to save the layermasks into a Texture2D. I red somewhere that you can use the mip map technique to blur a texture. But that didn’t work either. All attempts to resize and scale back up a layermask turned it to a black texture with 50% alpha channel and I can’t track down the error.

Is there any cheap way I didn’t find yet which can generate me a blurred version of a heightmap/alphachannel?

I put all my alpha values (8bit) in a 2d-byte field and tried applying various blur algorithms…copypaste … the layermasks always turned black or didn’t change at all.

regarding copy/pasting the code for the blur:
I suspect/guess the algorithm uses a float value between 0 and 1 to represent the alpha. If you are using 0-255 (8bit), this is going to yield incorrect results. You will need to scale the 8bit number down to 0-1: float alpha= ((float)Alpha8bit)/255.0f;