-
Notifications
You must be signed in to change notification settings - Fork 134
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
Radial Gradient #28
base: main
Are you sure you want to change the base?
Radial Gradient #28
Conversation
It's hard to follow large number of elements that need to be in the correct order. Use material types as indices, which should make the implementation clearer. Signed-off-by: Egon Elbre <[email protected]>
Signed-off-by: Egon Elbre <[email protected]>
Signed-off-by: Egon Elbre <[email protected]>
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.
Indeed, I'd like to hold off features not implemented in the compute renderer.
FWIW, the rendering of materials have been split out to a separate (fixed function) pass, which may be easier to modify for gradients. See renderMaterials.
Signed-off-by: Egon Elbre <[email protected]>
@eliasnaur I took a look at the For example in https://github.com/egonelbre/expgio/blob/master/box-shadows/surface.go, it currently creates 8*3 = 24 gradients for a single surface. Those gradients would add up really fast for anything more complex. While I understand that a specialized "round-rect-shadow" would reduce it to a single additional tex per atlas, it could still be problematic in other scenarios. |
A atlas reservation per gradient, but otherwise yes. I just pushed gioui.org/commit/3a3ec711d388a7 that caches materials off a (transformation, image handle) key. If two gradients are equal, they can re-use that space.
Indeed your example is expensive in texture memory, but I'll gladly settle for "it works, wasting memory" than not implemented at all. Alternatives include: adding gradient support to piet-gpu (Raph is open to other material types); adding a "drop-shadow" material to Gio or effect to piet-gpu (we're likely going to need that eventually). Both options seem like more work, and I don't see myself working on either in the near future. |
899f0fa
to
94f7fa3
Compare
8ae0153
to
3f38e67
Compare
0d543a0
to
1686874
Compare
67c77c9
to
46cc311
Compare
f8029f2
to
026d3f9
Compare
037391a
to
4759601
Compare
3d36537
to
74ccc9c
Compare
Implementation of RadialGradient, I'm unsure whether we wanted to merge this or not. But I updated it, such that people can try and experiment if they want to.