-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Allow customizing debug color of Path3D. #82321
base: master
Are you sure you want to change the base?
Conversation
The solution is not working for some reason, so that's why I assigned it as a draft. |
Hey, I noticed that were making your first PRs recently. I recommend familiarizing with our contribution guidelines. Namely the preferred way to title commits and pull requests. For example, for this feature the commit message could be "Allow to customize debug color of |
Yeah, those are my first PRs.
thanks that will help, I was using a message similar to the linux kernel stuff, lol. |
Debug is split between Editor debug and runtime debug (because the Editor is not available at runtime). The one that you see in the Editor and also in the screenshot of the proposal is from an Editor plugin. The debug that you see at runtime with the "Visible paths" debug enabled is part of the Path2D and Path3D node. A debug change should be added to both Path2D and Path3D as both nodes should keep feature parity wherever possible and reasonable. If you need some examples you could look at the NavigationAgent2D and NavigationAgent3D as both have custom path debug implemented. PR #71543 added it for the agent (there where some bug fixes since so don't copy directly). |
@smix8 |
so while going through this, to change the color in the editor, it applies to all path3D, I think because the gizmos are just instances, is it worth it to not use instances for the same material to have custom debug color ? |
That is why the e.g. NavigationAgent has a "debug_use_custom" bool. When enabled it creates its own material copy so it does not affect all other instances that share the default material for performance. |
I think I will add custom debug color to Path2D in a seperate PR, or should I add it in this PR too ? |
These nodes are rendered differently, so I think it's more suited for a separate PR. |
a976224
to
e55578a
Compare
Just Rebased to make this PR ready, in case the team wants to merge it for 4.4 |
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.
Tested locally, there are some issues:
- The material used for custom colors should be unshaded, so that the shape appears at its intended color regardless of lighting conditions. Right now, the red path in the screenshot below uses
#ff0000
but appears quite dark due to this:
With sky | Black sky (no ambient light) |
---|---|
- The material used for custom colors should be transparent. This yellow path should be invisible as its alpha component is 0, but it's visible:
- Paths do not get brighter when selected (or darker when unselected) like the default path color does:
Default unselected | Default selected |
---|---|
Custom unselected | Custom selected |
---|---|
-
The path color does not update immediately after you change it in the color picker (or even after pressing Enter). You need to do something else for the gizmo to update instead, but the update ought to happen as soon as possible.
-
The editor view does not match the running project view, as Show Path being unchecked is ignored in the editor. Also, the main path is not colored when running the project; only the fishbones are:
Editor | Running project |
---|---|
- I'm not sure if there should be a Show Path option. Other nodes like RayCast2D/3D don't have it. If you want to hide a path, you can set its color to a fully transparent custom color, in which case the gizmo drawing should be skipped (to improve performance).
is there a signal or a way to hook Color property realtime change to a function ? |
Ok, so I found my way (turns out when I change the color in the editor it does realtime change the Color Property, so I just emit a signal on set_custom_debug_color) @Calinou also I have implemented what you asked in the review, you can try it out any time. |
LOL, I think I did something wrong in the runtime material, the game crashes with the Path3D in the scene |
Now everything should work. |
solves : godotengine/godot-proposals#7853