16.5 C
New York
Tuesday, May 6, 2025

unreal 5 – Procedural map era


First please excuse my English, it is not my first language!

I am attempting to course of an current picture to create a recreation map, to be clear, this isn’t a procedurally-generated picture. Nonetheless, I wish to implement a procedural method, to spotlight the borders of any such picture:

I began by processing the picture and created a filter/masks to isolate the border utilizing a fundamental sobel algorithm, carried out utilizing UE

float2 sobelMatrix[9] =
{
    float2(-1, -1), float2(0, -2), float2(1, -1),
    float2(-2, 0), float2(0, 0), float2(2, 0),
    float2(-1, 1), float2(0, 2), float2(1, 1)
};
float2 gradients = .0;
for (int i = 0; i < 9; ++i)
{
    int row = i / 3;
    int column = i % 3;
 
    float offsetX = (column - 1) / decision.x;
    float offsetY = (column - 1) / decision.y;

    float2 offsetUV = float2(uv.x + offsetX, uv.y + offsetY);

    float sampledIntensity = SceneTextureLookup(offsetUV, 14, false);
    gradients += sobelMatrix[i] * sampledIntensity;
}

return  size(gradients);

Result 1
I can get varied outcomes by additional manipulation of the masks made by sobel

Other Results

That is what I would like obtain, so this is Actuality vs Expectation,

Reality vs Expectation

I need to obtain a picture just like the instance on the best. I am not referring to tiling, I’m referring to the clear-cut area and borders.

Does an algorithm exist that may do that?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles