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

Slider gradient integration. #330

Open
Reco1I opened this issue Feb 15, 2024 · 1 comment · May be fixed by #331
Open

Slider gradient integration. #330

Reco1I opened this issue Feb 15, 2024 · 1 comment · May be fixed by #331

Comments

@Reco1I
Copy link
Contributor

Reco1I commented Feb 15, 2024

I working on slider gradient visual for osu!droid and came up but a couple of issues due to the old Engine:

  • In ES1 there's no near existence of shaders programs which are the base of the gradient effect, to approach the effect in modern versions a fragment shader for color interpolated by position is needed.

  • Following the point above ES1 requires both vertex and color buffers by separate which means more memory usage under the hood for just a single slider.

There's 2 solutions I found for these:

  • Use textures and texture coordinates which can lead in another issues, for example transparency effects must be applied through a layer due that we're working with a texture and not an absolute color unless we generate the texture dynamically at certain time (of course punishes performance).

  • Update to ES2 and use color per vertex solution. For this we can update AndEngine to "GLES2" branch, both versions are similar despite some minor changes that would require certain effort.

I've the algorithm to convert the slider path into vertices for both versions:

In ES1 it uses a separated color buffer but as expected it doesn't work properly, the only way to do gradient on ES1 is by using a texture and a texture coordinates buffer.

In ES2 it uses a single buffer for both vertices and the color as well a fragment shader to do the trick which comes natively with AndEngine in this case. (This has been tested)

I hear suggestions.

@ammarasyad
Copy link
Contributor

I intend to propose an upgrade of the engine to GLES 2, but not for this release. We already planned some things to work on, so it will have to hold for a while.

@Reco1I Reco1I linked a pull request Feb 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants