Open viridia opened 9 months ago
This is a problem with the UI material shader, maybe we need more a second more complex UiMaterial that provides the size and border radius info.
UiVertexOutput has the node size now: https://github.com/bevyengine/bevy/blob/8bfe635c3e119fa9324ba738ac11d30e7b988ac1/crates/bevy_ui/src/render/ui_vertex_output.wgsl#L9
I think this was changed as part of the border radius rework.
What problem does this solve or what need does it fill?
I was attempting to implement my own "border radius" shader using the custom ui material example as a basis. However, I could not figure out how to get the actual width and height of the entity. The default UI shader pipeline knows this, as it's needed for drawing borders whose thickness is not tied to the overall width/height. But the example doesn't show how to access this information.
What solution would you like?
Rather than making the existing example more complex, I would like to see a second example that shows off some more advanced techniques. Particularly, it should show what kinds of uniforms and inputs are available for shaders to use.
What alternative(s) have you considered?
Yes, I could ask on Discord, but I think that others will want to know the answer to this, and an example could be helpful.