Fix: Refactor of click target feedback #569
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description (*)
A bug fix turned refactor of the player click feedback target. Before, it was a particle system with a single plane mesh particle being scaled over life, just following the cursor's position every 20 frames. Now it is a quad with a snazzier scaling animation and interpolated following of the cursor, to create a smoother, more seamless look and feel.
Fernando and I worked together on the interpolation, and part of the change was increasing the frequency of raycasts slightly for a smoother feel, let me know your thoughts on that for balancing performance and smoothness!
The red dot bug was seemingly an issue with the GPU dynamic instancing that particle systems use--it appeared with instancing turned on, and didn't with instancing turned off. It happened on every platform, in builds, and in editor, which further points to it being a weird bug with particle systems. I tried to debug with RenderDoc, but couldn't manage to capture a frame with the red dot, even using tricks like capturing multiple sequential frames--it only ever captured it rendering correctly. There were even times where both the red dot and the green target seemed to be rendering on the one particle mesh, which I think shouldn't be possible? I'd like to do some more digging into this, but for GDC and develop for now, implementing it in a different way feels like the way to go.
Here are some videos of the difference!
Before:
https://user-images.githubusercontent.com/89089503/158853365-4986097e-c463-4ac6-af39-ef7f711aa2ac.mp4
After:
https://user-images.githubusercontent.com/89089503/158853408-fb1122a9-0592-45ba-aab2-327e28418616.mp4
Issue Number(s) (*)
Jira ticket 2456 here