Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

Xtarsia
Copy link
Contributor

@Xtarsia Xtarsia commented Nov 2, 2024

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

@TokisanGames
Copy link
Owner

Great!

  • What do you think about taking care of Visibility ring around cursor when small #533 in this PR as well and adding a larger open crosshair or circle around the cursor when small (or always)?

  • Please remove UI.gd:_on_setting_changed():update_decal(). It's annoying to have it popup all the time when changing texture colors. I have it on mine but havn't pushed it yet.

  • Why do we need separate decals for the gradients? Are there any ideas or reasons for having a third decal? What do you think if instead of three open slots for textures, we specify them: 0= current brush, 1=ring, 2=crosshair/etc? Then in the shader we can name them such as use them by name rather than editor_decal[0]?

@TokisanGames TokisanGames added this to the 1.0 milestone Nov 2, 2024
// 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.);
Copy link
Owner

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?

Copy link
Contributor Author

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.

@TokisanGames TokisanGames added the shaders Shader development label Nov 2, 2024
@Xtarsia Xtarsia marked this pull request as ready for review November 2, 2024 13:12
@Xtarsia
Copy link
Contributor Author

Xtarsia commented Nov 2, 2024

ok im fairly happy with the cross hair now.

size 0;
afar:
image
upclose:
image

size 50;
afar:
image
upclose:
image

threshold setting in advanced, defaults to 16
image

@Xtarsia
Copy link
Contributor Author

Xtarsia commented Nov 2, 2024

shorter line length feels better
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
shaders Shader development
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move cursor decals to shader Visibility ring around cursor when small
2 participants