UGUI Vertex Effect
UGUIVertexEffect is a set of components for Unity UGUI that adds cool effects to your UI!
com.popupasylum.uguivertexeffect Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/uguivertexeffect.git 
README Markdown
Copy this to your project's README.md
## Installation
Add **UGUI Vertex Effect** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/uguivertexeffect.git
```
[](https://www.pkglnk.dev/pkg/uguivertexeffect)README
UGUI Vertex Effect
Adds effects to UGUI graphics in a hierarchial way, e.g. A Bend effect on a top level canvas affects all children. All effects operate on the geometry rather than the shader which allows it to be used in conjuntion with any UI shader, for example Unity-UI-Rounded-Corners and UIEffect.
Performance
Though a good chunk of time has been devoted to performance, there are some limiting factors, it leverages UGUI's BaseMeshEffect which is CPU and non multithreaded. So the code is setup to be as fast as I can make it on a single thread. It's pretty fast but it scales with the number of Graphics.
Effects
Bend - Curves UI around a cylinder
Feathered Edge - Similar to RectMask2D but supporting rotation
Bezier Patch - Similar to Photoshop's Warp
Gradient - A gradient across the graphic (great in conjuntion with GradientColorSpace)
Nine Slice - Turns anything into a nine sliced sprite, useful for SVGs
Desaturation - If the graphic uses a material with the UGUIVertexEffect.shader, it desaturates inthe shader, otherwise desaturates the vertex colors. For Images assign a material with the UGUIVertexEffect.shader
https://github.com/markeahogan/UGUIVertexEffect/assets/6376138/f41b924d-051b-450b-8b7e-3e65324d0201
Raycasting
Effects such as Bend and Bezier Warp move the Graphic's visual away from it's RectTransform but it's clickable area doesn't change. To counter this the current strategy is to get the event camera's position relative to the Graphic's visual, then counter position the event camera relative to the Graphic's Rect.
Known Issues
- RectMask2D's shader clipping expects a rect, bend can move verts outside of the rect, use Mask as a workaround
- Raycasting is still against a Rect, so is an approximation, very distorted UI will not be raycasted accurately
- Sliders act like theyre in their unmodified position
- If the event ray doesnt intersect the plane of the Graphic's Rect the hit is not detected. i.e. With a canvas bent 360 with the player at the center, the graphics behind the player will not recieve events
Comments
No comments yet. Be the first!
Sign in to join the conversation
Sign In