indigo icon indicating copy to clipboard operation
indigo copied to clipboard

9-Slice Shader / Material

Open davesmith00000 opened this issue 2 years ago • 3 comments

Try and reuse some of the shader library shaders to make, say, a 9-slice shader and test reusability.

davesmith00000 avatar Jan 25 '23 21:01 davesmith00000

Duplicate of #425, suggested by @hobnob - closing that one down and keeping this one.

davesmith00000 avatar Feb 11 '23 21:02 davesmith00000

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?

davesmith00000 avatar Jun 19 '24 07:06 davesmith00000

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?

davesmith00000 avatar Jun 19 '24 07:06 davesmith00000