Skip to content

Commit

Permalink
Fix wetness painting calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
TokisanGames committed Nov 19, 2023
1 parent a1097ee commit 801b31e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/terrain_3d_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,8 @@ void Terrain3DEditor::_operate_map(Vector3 p_global_position, real_t p_camera_di
* However Godot stores values as 8-bit ints. Roundtrip is = int(a*255)/255.0
* Roughness 0 is saved as 0.5, but retreived is 0.498, or -0.4 roughness
* We round the final amount in tool_settings.gd:_on_picked().
* Tip: One can round to 2 decimal places like so: 0.01*round(100.0*a)
*/
dest.a = Math::lerp(real_t(src.a), real_t(.5f + .5f * .01f) * roughness, brush_alpha * opacity);
dest.a = Math::lerp(real_t(src.a), real_t(.5f) + real_t(.5f * .01f) * roughness, brush_alpha * opacity);
break;
default:
break;
Expand Down

0 comments on commit 801b31e

Please sign in to comment.