arcade icon indicating copy to clipboard operation
arcade copied to clipboard

Complete and add a minimal BackgroundTexture class

Open einarf opened this issue 3 years ago • 4 comments

Having a BackgroundTexture class solves quite a few use cases that are difficult for most users to implement without having to use shaders. The name can still be debated. It's pretty close to a RenderTargetTexture currently in experimental, so maybe we should look into that relation. The BackgroundTexture is just a wrapper over an arcade.gl.Texture.

Some ponts:

  • It should not use the texture atlas because using this type is a good way to avoid flooding the atlas with large images
  • Default initializer can take a width and height
  • BackgroundTexure.from_file(path) would load an image from file. Possibly using the texture cache
  • Support scrolling texture coordiantes in pixels
  • Support rotating texture coordiantes with preserved aspect ratio
  • Support enabling and disabling texture repeat
  • Support enabling mipmaps (useful if zooming)
  • Support setting a Mat3 directly for finer control over texture coordinate transformations
  • It can also work as a render target, so it also needs to be a framebuffer. with bg.enabled()
  • Should it have the same pixel scale as the window framebuffer?
  • Create a default texture shader users can load. It should be compatible with the vertex format in arcade.gl.geometry.

More thinking is needed.

einarf avatar Mar 31 '22 23:03 einarf

This might be a dupe of #991

pushfoo avatar Mar 31 '22 23:03 pushfoo

I don't think it's a direct dupe, but it's good to get them linked up to provide the most information. It might be a sub-issue of this one.

einarf avatar Mar 31 '22 23:03 einarf

#1152 is the original / related issue

einarf avatar Jun 17 '22 23:06 einarf

This is still in experimental and is subject to change. We can move this to 3.x

einarf avatar Feb 18 '24 01:02 einarf