Following this seat
https://youtu.be/eH-PdFKgctE?t=2046
I have a scroll of UI items masked at the top to buttom of the screen
So far I've failed to reduce the batching past 10 batches
What I did was:
I Created 2 components (for now both are UI/Default) 1 for the scrollElements and 2nd for the rest of the screen.
I've set all the UI elements to the 1st material.
I've tried to llok on the web and failed to understand how to tween the alternate the shader into UI-fast which prevent's masking
Related
I'm trying to reproduce the following animation in Flutter (original was built in SwiftUI):
These items are backed by a dynamic data model — an array of "items" — and remove themselves on tap.
There are 2 animations in one here:
the fade out for the removed item
the slide for both sides of the remaining items
In a default Flutter AnimatedList with FadeTransition, I only get 1). My question is how to implement both of them.
I basically want to 100% replicate the animation shown in the video.
EDIT: What I figured out I need, conceptually, is this: two boxes, one stacked upon the other, both the same size (intrinsic content size of box 2). But then, only box 1 (which is invisible) should affect the layout. That is where a SizeTransition should be applied. Box 2, where the actual content gets drawn, needs to be like an overlay — not affecting layout — and on that box I need a FadeTransition.
Additionally, the item that gets removed should be drawn below the rest of the items, not above.
Approach #1
I suppose you can just use both FadeTransition and SizeTransition together, and you will have "almost the same effect" - not quite 100%, because the box will be fading while shrinking in size, at the same time. Depending on the animation duration, it might not be noticeably different.
To chain them, you can simply wrap them like so:
FadeTranstion(child: SizeTransition(child: YourWidget(...
Approach #2
On the other hand, if you must achieve 100% the same as SwiftUI, i.e. make sure the fading box is not shrinking at the same time, it's probably easiest to only apply SizeTranstion to do the shrinking, and on top of that, use OverlayEntry to stack another layer of fading animation.
That is, in the AnimatedList exit animation, apply SizeTransition and wrap it with an Opacity(opacity: 0.0, ...) to make it invisible (but still occupy the space) and shrinking-in-size. When the animation starts (during onDelete event, or alike), insert an Overlay on top of it. This could be easier to do than maintaining two lists, and can be more performant too.
I recommend approach #1, just chain both animations, and not make it 100% replica. The result should look similar enough especially if the animation is fast.
I am trying to create something like this in flutter:
Image 1 -
Image 2
The two main aspects are:
the filled part of the vertical container has this elipse with darker color on the top, which gives the 3d depth effect
on Image 2 there is that % indicator, moving accordingly
What I have tried is:
tried to modify different progress_indicator packages, so that to achieve the 2 things above. However, I was never able to do that 3d depth effect.
tried to implement it as 2 expanded containers, where the flex of the bottom one represents the persentage. However again I was not able to do the elipse on the top.
From my searches online, it looks like I need to use the CustomPaint class, but it look very complicated.
If you have any better suggestions, or ever code pieces that can help, I would be extremely thankful !
I have a scrollbar with a mask.
Inside there are over 1000 UI elements scrolled - each has bg, icon, and text.
on top there are several UI elements spreaded out
when static, it runs at arounf 80fps
while scrollng, it runs at about 30fps
What i've tried
Atlassing all images
uniying materials - giving the same material to all elements (either 1 for all or 1 for the list and 1 for all the rest)
seperating canvases - 1 for the list and 1 for all the rest (only increased batches).
removed pixel perfect from canvas
Changed canvas from screenspace: camera to overlay.
Issues:
there are seperate batches for 2 objects under the reason "Different material instance"
although both objects are under the same canvas, same Z same material and same Image (and both read the same image from the same atlas on start).
the list of elements all contain an image taken as an index from a unified atlas.
However, I see 2 separate batches - 1 for the 15 elements not masked, and 1 for all the masked elements. is there a way to batch them together?
I'm looking for a way to optimize the masking of the element (for this is the heaviest component)
With the pixel perfect off - the fps moved from ~30fps while scrolling to anything between 60fps to 0.7fps
I am about 4 hours into debugging this, time to ask!
I have this nest of objects:
- Game Object
|--- Canvas
| |---Panel
| | |---Element 1
| | |---Element 2
With my current configuration, Elements 1 and 2 are showing up separate with one completely off screen, rather than evenly spaced out next to one another within the specified space. It is a Horizontal Layout Group specified to:
Child Alignment: Middle Center
Child Controls Size & Force Expand: None.
The Canvas is set to Screen Space - Camera, with my only camera specified.
Those settings are here as well:
The Panel is a Rect Transform set to around the bottom of the screen.
Those settings - The panel has the Horizontal Layout Group component on it.
Next are the child objects, those settings are here:
In terms of what I have done, here are just a few:
Tried to remove the Canvas components from the children
Unpacked the prefabs completely to make further edits.
Rebuild the children
Tried Render mode of the Canvas to World Space
Tinkered with the anchor points to see if positioning was an issue
Hierarchy is here for clarity:
This ultimately leads to this result, the graphic on the right should be in view (on the yellow screen).
Thank you in advance!
EDIT: With Horizontal Layout Group and the rest of the object it is on:
ag-grid-enterprise v20.2.0.
Chrome v73.
I have several columns and a large data set with a full-screen grid. I don't have any custom renders and I'm using batchUpdateRowData() to add to the grid.
When my app loads, I load a history of up-to 20000 records. Each time the grid draws it takes ~150ms (as per the console).
Are there any suggestions for improving the draw performance...or am I expecting too much? Due to the amount of data being loaded at start, each draw is a full re-draw of grid.
Unfortunately I cannot avoid loading these records.
Extra info:
The reason why there is a redraw is because my grid is sorted by timestamp descending and the history is loaded oldest to newest. It's loaded from a persistent topic, so has to be loaded in that order annoyingly.
1) Given that you are loading 20000 rows, your biggest issue would be Ag-Grid trying to load and display all 20000 of them when your component starts up. You should use infinite scrolling, which displays only a fixed amount of rows on your viewport/Ag-grid table, and dynamically removing the 'hidden' ones loading the rest while you scroll along the grid. In short, you have to set the rowModelType property to infinite.
2) This point is regarding your row buffers, and it has a similar concept as the point above.
3) Another alternative to doing infinite scrolling is to use server-side pagination, whereby you only fetch x-number of rows for that given page, and fetch more as you scroll down/to the next page.
4) If possible, try not to disable suppressColumnVirtualization, as the original settings for can have a slight improvement on performance since the non-visible columns are rendered until it is scrolled to.