You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is essential for the successful application of this WebSocket approach to minimise the amount of network traffic between the server and the clients. The WebSocket spec allows for extensions that perform general compression on the transmitted data, but it can only do so much. A custom approach, handcrafted for ImDrawData could significantly reduce the network traffic.
Current implementation
The differences are calculated per ImDrawList. For each ImDrawList, we store the position of the first vertex and subtract this value from all vertices in the draw list. This makes the ImDrawList invariant to shifts. The client takes care to restore the position offset before rendering the data.
If the current ImDrawList curList has the same size as it had in the previous frame prevList - the binary contents of curList and prevList are xored and run-length encoded. Otherwise - we send the full curList.
Ideas to explore
Per DrawList differences
Deinterleave ImDrawVtx fields
Rate control of focused/hovered windows
Alternative ImDrawList structure
The text was updated successfully, but these errors were encountered:
ggerganov
changed the title
Improve compression of Dear Imgui's DrawData difference between consecutive frames
Improve compression of Dear Imgui's DrawData buffers
Jul 1, 2019
ggerganov
changed the title
Improve compression of Dear Imgui's DrawData buffers
Improve compression of ImDrawData buffers
Jul 1, 2019
We store the offset for each command list and subtract it from all
vertex positions in that list. This makes the new vertex positions
constant when moving the windows around, which gets compressed by
the RLE very well.
Effectively, changing the content in a window does not trigger
update of the draw data for other windows. This reduces bandwidth
significantly in some cases.
Description
It is essential for the successful application of this WebSocket approach to minimise the amount of network traffic between the server and the clients. The WebSocket spec allows for extensions that perform general compression on the transmitted data, but it can only do so much. A custom approach, handcrafted for ImDrawData could significantly reduce the network traffic.
Current implementation
The differences are calculated per ImDrawList. For each ImDrawList, we store the position of the first vertex and subtract this value from all vertices in the draw list. This makes the ImDrawList invariant to shifts. The client takes care to restore the position offset before rendering the data.
If the current ImDrawList
curList
has the same size as it had in the previous frameprevList
- the binary contents ofcurList
andprevList
are xored and run-length encoded. Otherwise - we send the fullcurList
.Ideas to explore
The text was updated successfully, but these errors were encountered: