0 votes
asked Aug 5, 2019 in Engine by siamak-s (79 points)

Thanks Zylann! Finally It works!
For someone who read later, after commenting if located in line 1077 of hterrain_data.gd with following lines we could paint terrain at runtime.

var brush = preload("res://addons/zylann.hterrain/hterrain_brush.gd").new()
brush.set_color(Color.red)
brush.set_radius(10)
brush.paint($HTerrain, collsioin_info.position.x, collsioin_info.position.z, brush.MODE_COLOR)

I think if you add an option somewhere for loading channels to memory at runtime (so does not need to change addon source files), It could be a good temporal solution for https://godotengine.org/qa/49476/apply-objects-movement-effect-on-terrain (more specific on texture painting)

Good to hear it works fine :)
However careful with the other question you linked, modifying the terrain to leave skidmarks is extremely expensive. Decals or simple mesh strips are often preferred to do this.

Would you please give me some link or resources about them?
I found this https://github.com/Mr-Slurpy/Screen-Space-Decals, but I don't know how actually its works., and are its known limitations serious or not?

I never used this in Godot yet, so I don't know more than you do.

Anyway very thanks Zylann!

1 Answer

0 votes

Comment the if which is located in line 1077 of hterrain_data.gd and then use following lines:

var brush = preload("res://addons/zylann.hterrain/hterrain_brush.gd").new()
brush.set_color(Color.red)
brush.set_radius(10)
brush.paint($HTerrain, collsioin_info.position.x, collsioin_info.position.z, brush.MODE_COLOR)

For more info read above comments.

answered Aug 12, 2019 by siamak-s (79 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.