1
Support / Round corners
« on: April 09, 2014, 11:04:30 pm »
Hi all,
I am trying to create a tiled sprite with round corners with a dynamic width. See image.
The challenge here is the fact that the tiling goes on until the corner itself. Here's the thoughts I have so far:
1 - Mask shader http://wiki.unity3d.com/index.php/TextureMask . But this doesn't work because I want to stretch my image. Somehow I'd like to 9-slice the shader... If that were possible.
2 - Round-corner shader. I'm no shader expert but I guess I could draw/not draw pixels based on the y-coordinate, using a sine-function to make it round. That's what I'll try to figure out now.
Any idea which way would be better? Or is there a third way?ß
Cheers
I am trying to create a tiled sprite with round corners with a dynamic width. See image.
The challenge here is the fact that the tiling goes on until the corner itself. Here's the thoughts I have so far:
1 - Mask shader http://wiki.unity3d.com/index.php/TextureMask . But this doesn't work because I want to stretch my image. Somehow I'd like to 9-slice the shader... If that were possible.
2 - Round-corner shader. I'm no shader expert but I guess I could draw/not draw pixels based on the y-coordinate, using a sine-function to make it round. That's what I'll try to figure out now.
Any idea which way would be better? Or is there a third way?ß
Cheers