-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Implement two-point conical gradient. #40236
Conversation
chinmaygarde
left a comment
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.
Looks good to go. Is something missing in the draft?
Yea, the math isn't quite right. I got it working this weekend but for performance reasons I might split it out to its own shader. |
|
I would strongly recommend making the radial and conical gradients separate shaders. These are already fairly expensive |
94c75fd to
f872571
Compare
|
@chinmaygarde The main work is done on this and is ready to review. Let me know what tests you'd like to see added. |
|
There is a graphical glitch where there is banding if c0 is close to c1. I can remove that by adding a minimum samperate. Let me think if there is something smarter we can do. |
| float result = 0.0; | ||
| vec2 ab = c1 - c0; | ||
| float dr = r1 - r0; | ||
| // Set sample rate to a minimum for the case where c0 and c1 are close. |
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.
Can we handle this with a kEhCloseEnough check in the conical contents? if C0 close to C1, then its just a radial gradient right?
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.
in order for it to be the same it has to be c0==c1 and r1 == 0. If c0==c1 we can do the math easily without the loop but it didn't seem worth the extra complexity.
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.
ahh got it.
jonahwilliams
left a comment
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.
LGTM
|
@chinmaygarde @jonahwilliams is there a special kind of golden image test we are doing for these shaders? |
|
There isn't the testing infrastructure to write the kind of tests I'd like. I'm going to try to come up with ideas in an issue and we can revisit this. There are a lot of opinions about how to best test on the team so this may take some time to sort out what we want to do here. |
…ngine#40236) (#122623) Roll Flutter Engine from 22be417acc86 to e80266b78e74 (1 revision)
…lutter/engine#40236) (#122623) Commit: fcf11343ae9e291189ba59dc27c3d3e7def17ff9
fixes: flutter/flutter#113110
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.