Skip to content

Add fade to slope range tool settings when out of range#767

Draft
Xtarsia wants to merge 1 commit intoTokisanGames:mainfrom
Xtarsia:smoothed-slope-falloff
Draft

Add fade to slope range tool settings when out of range#767
Xtarsia wants to merge 1 commit intoTokisanGames:mainfrom
Xtarsia:smoothed-slope-falloff

Conversation

@Xtarsia
Copy link
Copy Markdown
Collaborator

@Xtarsia Xtarsia commented Jul 18, 2025

Closes #725

example with the color map, painting red with a high slope limit, gives soft edges outside the range when painting.

image

any time the original was "true" will still be 1.0 here, only the false conditions get faded out here.

@Xtarsia Xtarsia added the enhancement New feature or request label Jul 19, 2025
Copy link
Copy Markdown
Owner

@TokisanGames TokisanGames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bleeds a bit excessively.

Here I painted with a 0-38 slope, which is the same as the autoshader. The far right is 0-28. Yet it never filters out the vertical faces.
{A06A2A79-D7E9-45A5-B7EC-F2B9E165A7CF}

I was expecting it would bleed a little bit into the area like it had a fixed width margin, but not go beyond that. This seems like it just changes the sloped area to a low power brush. If I'm filtering by slope, a little bleed on the edges is fine, but it should not be painting outside of the set area.

The instancer and texture painting seem to work as before (binary on or off).

Comment thread src/terrain_3d_data.cpp
const Vector2 slope_range = CLAMP(p_slope_range, V2_ZERO, Vector2(90.f, 90.f));
if (slope_range.y - slope_range.x > 89.99f) {
return true;
return real_t(1.f);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting float literals isn't necessary. Nor for the float math in the returns below. They'll be converted automatically for free. It's only necessary for some templates like Lerp or MIN/MAX because the linter is particular about the exact type.

@TokisanGames TokisanGames marked this pull request as draft August 24, 2025 14:07
@TokisanGames TokisanGames added this to the 1.2 milestone Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Faded Margin to Slope Filter

2 participants