-
Notifications
You must be signed in to change notification settings - Fork 137
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
base: main
Are you sure you want to change the base?
Conversation
Great!
|
src/shaders/editor_functions.glsl
Outdated
// Blend in decal; reduce opacity 55% to account for differences in Opengl/Vulkan and/or decals | ||
albedo = mix(albedo, _editor_decal_color[i].rgb, clamp(decal * _editor_decal_color[i].a * .55, 0., .55)); | ||
// Decal fadeout from last time stamp | ||
float fade = clamp((_editor_decal_timestamp - TIME) * 8. - 6., 0., 1.); |
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.
What do 8 and 6 represent?
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.
As only an offset time stamp is passed each update, those 2 values work with the offset to replicate the timer fade delay & speed of the original decal_timer.
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 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.
if !plugin.terrain: | ||
return | ||
var mat_rid: RID = plugin.terrain.material.get_material_rid() | ||
|
||
# If not a state that should show the decal, hide everything and return | ||
if not visible or \ | ||
not plugin.terrain or \ |
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.
This line can be removed since it's now above.
Above, I prefer if not
because the not gets color coded red.
@@ -258,7 +243,6 @@ func _on_setting_changed() -> void: | |||
return | |||
brush_data = tool_settings.get_settings() | |||
brush_data["asset_id"] = plugin.asset_dock.get_current_list().get_selected_id() | |||
update_decal() |
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.
What I believe this did is showed the decal when the brush_size gets larger or smaller. Currently the decal size doesn't change on adjustment.
else: | ||
decal.rotation.y = 0 | ||
|
||
editor_decal_rotation[0] = 0 |
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.
Please change to 0.
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