Skip to content
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

Better image load experience #3

Closed
gre opened this issue Aug 28, 2015 · 0 comments
Closed

Better image load experience #3

gre opened this issue Aug 28, 2015 · 0 comments
Assignees
Labels
Milestone

Comments

@gre
Copy link
Owner

gre commented Aug 28, 2015

Problem

Currently, as soon as an image src disappears from the uniforms (e.g: moving from uniforms { t: "foo.png" } to { t: "bar.png" }), the image/texture allocated to "foo.png" instantly get cleaned which results of blinks and is especially annoying when you loop over a limited set of images.

We need a way to tell the GL.View to retain some textures to avoid glitches during loading steps (see for instance the Blur example, switching textures create a blink).

Solutions

Caching: images prop

We might want to preload images and ensure they are retained by having a preload={[ array of images ]} props.

Rendering mode: preload prop

Now, that raise another interesting use-case: a user may also want to freeze the rendering until all the uniforms are loaded.

Implementation:
gl-react-core will resolve the array of images to wait & pass-in to implementers. we might handle it in multiple levels in the rendering tree.

LRU cache

We might implement some LRU cache strategy that guess that the image are likely to get re-used (this is advanced, and I would be in favor of giving more control to users).

@gre gre mentioned this issue Sep 3, 2015
@gre gre added feature and removed enhancement labels Sep 3, 2015
@gre gre self-assigned this Sep 4, 2015
@gre gre added this to the 0.2.x milestone Sep 7, 2015
gre added a commit that referenced this issue Sep 8, 2015
@gre gre closed this as completed Sep 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant