indigo icon indicating copy to clipboard operation
indigo copied to clipboard

Allow use of a Canvas as a texture source.

Open davesmith00000 opened this issue 3 years ago • 0 comments

Why? Well passing large amounts of data to a shader is expensive - but not if that data is disguised as a texture.

TextBox is using a canvas in the background and is reloaded constantly, so the performance is there. We need:

  1. A process in the renderer for using a canvas as a data / texture source
  2. A nice way to perform the side effect of drawing to a canvas element. Couple of ways to do that:
    1. Side effects are currently specific, and are run based on a specific GlobalEvent, such as making http calls. So we could have a Canvas event, the complication here is elegantly representing a canvas program to be executed. Would probably need Tagless Final / Free Monad style interpretation.
    2. Tyrian allows for arbitrary Task execution, this solves some problems are creates others, but it would allow people to just use Scala.js to do the work. Feels like a sledgehammer solution though.

davesmith00000 avatar Jul 15 '21 19:07 davesmith00000