-
Notifications
You must be signed in to change notification settings - Fork 398
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
Implement Blob component #5485
Implement Blob component #5485
Conversation
I like that this is implemented as a separate shader, was scared it would get bunched into circular progress and that shader would become a hydra of sorts :) |
if (pixelAngle < 0.0) | ||
pixelAngle += TWO_PI; | ||
|
||
int pointCount = 50; |
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 should probably be a const int
instead. In older GLSL versions (< 4.00) there's no guarantee of these being "dynamically uniform" and from experience Intel drivers specifically do minimal optimisations.
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
#nullable disable |
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.
Remove this + update any relevant code.
|
||
namespace osu.Framework.Graphics.UserInterface | ||
{ | ||
public class Blob : Sprite |
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.
I'd probably call this CircularBlob
or something else. Just Blob
is too generic and has a different meaning in development terms.
Yep, this is due to how we are approximating the path: we are plotting Potential solution: increasing |
I think it's a pretty good example component to have in the framework, but would be okay with either direction. Interested in @smoogipoo's thoughts. |
I'm fine with it being in o!f. |
Ignoring the issue mentioned in discord regarding the seed ( osu.2022-10-27.at.04.14.02.mp4 |
Okay, I don't see the shape issue being fixed with the current implementation, needs a big alg rethinking. |
[runtime] 2022-10-27 09:15:13 [error]: An unhandled error has occurred.
[runtime] 2022-10-27 09:15:13 [error]: osu.Framework.Graphics.OpenGL.Shaders.GLShader+PartCompilationFailedException: A osu.Framework.Graphics.OpenGL.Shaders.GLShaderPart failed to compile: sh_CircularBlob.fs:
[runtime] 2022-10-27 09:15:13 [error]: ERROR: 0:116: '*' does not operate on 'int' and 'float'
[runtime] 2022-10-27 09:15:13 [error]: ERROR: 0:116: '*' does not operate on 'int' and 'float'
[runtime] 2022-10-27 09:15:13 [error]: ERROR: 0:123: Use of undeclared identifier 'noisePosition'
[runtime] 2022-10-27 09:15:13 [error]: ERROR: 0:124: Use of undeclared identifier 'noiseValue'
[runtime] 2022-10-27 09:15:13 [error]: ERROR: 0:125: Use of undeclared identifier 'pos'
[runtime] 2022-10-27 09:15:13 [error]: at osu.Framework.Graphics.OpenGL.Shaders.GLShaderPart.Compile() in /Users/dean/Projects/osu-framework/osu.Framework/Graphics/OpenGL/Shaders/GLShaderPart.cs:line 151 |
DrawNode logic is very similar to
CircularProgress
.In the shader
pointCount
andsearch range
may be probably adjusted further to improve performance even more but visuals may suffer for blobs with thick borders due to how approximation works there.Test scene has been taken from
CircularProgress
and probably needs to be abstracted later.