This may sound a bit crazy, and quite expensive in terms of performance, but hear me out:
A use case::
Have a script that generates voxel terrain from a file defined in the script. It then translates the image (with size limitations however, image should not be larger than N mb (use best case scenario here, they can get quite large in memory) and could only be done when interacted with) into a chunked voxel terrain:
For the script: Alpha channel could defined as height,
While colours them selves would define poly materials used (so FF FF FF / 17 = F0F0F0 in which the first significant bytes per color) are used to define the material used for the topmost voxel.
To do this,
- the scripter would need some way to load up an image in JS
- Store in into the object (do able)
- Convert to 4 Matrices (RGBA). (not doable natively, but there are libraries susch as Sylvester, but it doesnt match what is already available in client)
- Grab a specific section of each of the images (such as 32x32 area on top right)
- read each of the matrices
Other Use cases:
- Generate a texture
- Generate terrain
- Manipulate textures
- Manipulate terrain via custom “brushes”
- “Biome” sorta like variation Polyvoxels
- Nearly Limitless other stuff. Etc.
However instead of this, could just have a Image processing interface in the interface: This might allow the utilisation of the Graphics Card: it would call a defined callback that returns the 4 matrices.
Could also be awesome if we could use this same method to set textures onto objects, and maybe even animate them similar to sprite sheets: or even procedurally generate textures.