Zylann / godot_heightmap_plugin

HeightMap terrain for Godot implemented in GDScript
Other
1.74k stars 159 forks source link

Pen Pressure support for terrain painting #245

Open larssteenhoff opened 3 years ago

larssteenhoff commented 3 years ago

will you be able to add pen pressure for wacom tablets? for example assign pressure to size or opacity. https://docs.godotengine.org/en/stable/classes/class_inputeventmousemotion.html

Zylann commented 3 years ago

Sounds like a good idea, easy to implement. It would require sending a pressure parameter to this function: https://github.com/Zylann/godot_heightmap_plugin/blob/af6a0ac2ebfea8d92d975a78d4dd9d89da6a0e0a/addons/zylann.hterrain/tools/plugin.gd#L500 And then use it in painting functions/shaders, as an opacity multiplier I guess: https://github.com/Zylann/godot_heightmap_plugin/blob/af6a0ac2ebfea8d92d975a78d4dd9d89da6a0e0a/addons/zylann.hterrain/tools/brush/terrain_painter.gd#L231

larssteenhoff commented 3 years ago

Yes opacity makes the most sense,

It could also be user configurable to set it to brush size, or object size.