Updated sdf code to work in C++
This commit is contained in:
@@ -614,10 +614,11 @@ float RoadsData::get_sdf(int x, int y, int z)
|
||||
if (!curve.is_valid() || !noise.is_valid())
|
||||
return (float)y;
|
||||
float n = curve->interpolate_baked(0.5f + noise->get_noise_2d(x, z) * 0.5f);
|
||||
Vector2 ifl = rg->get_influence(x, z);
|
||||
n = CLAMP(n, -1000.0f, 1000.0f);
|
||||
Vector2 ifl = rg->get_influence(x, z, 32.0f);
|
||||
if (ifl.x > 0.0f) {
|
||||
if (n <= ifl.y + 2.0f)
|
||||
return (float)y - ifl.y;
|
||||
if (n <= ifl.y - 0.5f)
|
||||
return (float)y - ifl.y - 0.6f;
|
||||
else
|
||||
return (float)y - ifl.y;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user