viaWebGL
viaWebGL copied to clipboard
Tile Redraw
Hello, I have created some image correction shaders (gamma correction etc) Now i want to update gamma factor via some UI, and pass as a uniform.
After updating UI item, i am calling openSD.world.resetItems() => it makes all tiles to reload/ download again which is an issue. is there any way to just redraw entire canvas/tile ?
I'm not sure how to trigger fresh downloads of everything, but I've been using:
openSD.world.resetItems();
openSD.world.update();
to trigger redraws of all tile
s in all tiledImage
s
I have also implemented gamma adjustment using viaWebGL. I am using viewer.world.resetItems()
after changing the gamma to force a redraw.
The issue is that resetItems()
refetches all the image data (which may take some time) and even if the image data is local, the update has a distracting delay during which the canvas is blank. The delay is about 200 ms.
My question is whether there is some way to trigger fast redrawing after changing the gamma, so that the transition between different gamma values is instant and seamless without any flicker?
I saw your interactive
branch (https://github.com/thejohnhoffer/viaWebGL/pull/6) however it's unclear how to trigger a quick redraw using the code in that branch.
I solved this more generally using a timestamp. I think this simple solution works only with simple scenarios, such as only one tile source, no transparency etc., see:
https://github.com/openseadragon/openseadragon/issues/866#issuecomment-820449459