-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
move cursor decals to shader #538
Conversation
Great!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this. In my review copy I rebased it, then tested.
-
crosshair(s) seems to be most widely used as a single word. So all cross_hair references could drop the underscore.
-
I'd like to see the crosshair lines the same opacity as the brush so they match better.
-
I don't see the fade on timeout, though I see there's code in there. The only way to make it disappear is a single right click, but it reappears when the mouse moves. There are times when the camera is close and the cursor is big, and we want to adjust something in the inspector and see the results on the terrain w/o the decal. Currently the process is to wait until it disappears then adjust. We need either the timeout, or maybe a better alternative is to hide the cursor as soon as the mouse leaves the viewport, or both.
-
In this PR, with Paint mode, if you right-click-hold and move the camera, let go (cursor invisible), click-hold and paint, the cursor will appear at a wrong spot and paint, then jump to where it should be and continue painting.
-
Comptability mode, Raise 100% strength, white decal Brightness is way too bright. As well as slope, spray, foliage ring. The other colors are acceptable. Forward foliage ring is a bit bright as well.
-
I'm wondering if the lines should change thickness/size based on the brush size. 🤔
-
Can be rebased and squashed to one commit.
This happens on main too. Its related to get_intersection() GPU mode problems. |
Given the new changes to the shader, these tasks could be addressed, if you're up for it:
|
what I wrote in the docs might need some more work. the last commit is a bit cheeky, but updates the demo textures, and applies some detiling to them. Also made the grass a bit smaller too. |
0085d97
to
d647d87
Compare
@TokisanGames Rebased, and hopefully finished. |
Looks great. Much more stable now.
Fantastic Addressed issues:
|
3b8f2dc
to
1759226
Compare
There are times when I get these errors starting up, closing a scene, or saving the code.
|
i guess these lines: var editor_decal_position: Array[Vector2] = [Vector2(), Vector2(), Vector2()]
var editor_decal_rotation: Array[float] = [float(), float(), float()]
var editor_decal_size: Array[float] = [float(), float(), float()]
var editor_decal_color: Array[Color] = [Color(), Color(), Color()]
var editor_decal_visible: Array[bool] = [bool(), bool(), bool()] arent initializing correctly? might have to do editor_decal_position.resize(3) in _ready() instead for each one. |
_ready and _enter tree are for UI.gd which starts at engine launch time. It's strange that they are losing their size after being set though. Also strange that I didn't notice any errors until today, but I don't see any changes I did to these arrays. |
Edit: set visible not enough.. I dont like this but it works. func update_decal() -> void:
if not plugin.terrain:
return
editor_decal_color.resize(3)
editor_decal_position.resize(3)
editor_decal_rotation.resize(3)
editor_decal_size.resize(3)
editor_decal_visible.resize(3)
mat_rid = plugin.terrain.material.get_material_rid()
editor_decal_timer.start()
var editor_decal_fade: float :
set(value):
if (editor_decal_color.size() > 0):
editor_decal_fade = value
editor_decal_color[0] = Color(
editor_decal_color[0].r,
editor_decal_color[0].g,
editor_decal_color[0].b,
value
)
RenderingServer.material_set_param(mat_rid, "_editor_decal_color", editor_decal_color) this seems to cover enough bases. opening and closing Demo / NavigationDemo giving no errors. possibly cleaner placement of that block than right at the top of supdate_decal() or even somewhere else? |
I have no issues with these changes. Do you get any errors with just these, and nothing in update_decal? var editor_decal_fade: float :
set(value):
editor_decal_fade = value
+ if not plugin.terrain:
+ return
editor_decal_color[0] = Color(
func set_visible(p_visible: bool, p_menu_only: bool = false) -> void:
...
visible = p_visible
toolbar.set_visible(p_visible)
tool_settings.set_visible(p_visible)
+ if editor_decal_color.size() != 3:
+ # These sizes get reset to 0 on user scene closes. No idea why
+ editor_decal_position.resize(3)
+ editor_decal_rotation.resize(3)
+ editor_decal_size.resize(3)
+ editor_decal_color.resize(3)
+ editor_decal_visible.resize(3)
update_decal() |
Yes, if i have both the demo, and navdemo scenes open at the same time with terrain3d selected in both scenes, switch back and forth, and then close 1, I get errors again until i deselect and reselect the terrain3d node in the remaining scene. |
d4f8fc1
to
2c1ce97
Compare
Excellent work as always. Thank you. |
removes all decals, closes #534
Adds a crosshair, with a threshold setting in the advanced menu, closes #533
Consolidate uniforms to just brush and ring textures
Also fixed derivative rotations
Also added more agressive branching to texture lookups in get_material()
Todo: