indigo
indigo copied to clipboard
9-Slice Shader / Material
Try and reuse some of the shader library shaders to make, say, a 9-slice shader and test reusability.
Duplicate of #425, suggested by @hobnob - closing that one down and keeping this one.
9 slicing is just specifying some margins on an image to control how it is stretched to fill the space.
The difficulty here is that we don't support render targets, so we can't stack n' store shader passes. Therefore, making a 9-slice that works for a Bitmap-like material is easy, but extending it work with all the other material types would mean custom variations of all the types. Maybe a Bitmap-like one is good enough though for UI building? Or at least, better than nothing?
That said... we have the notion of "Stretch modes". I wonder if that could be extended to support another 9-slice case? It is re-implemented in every shader (somehow), but it's just adding a new case to an existing mechanism, which seems... ok?