- Home /
Unity SpriteShape Material with ShaderGraph
What I've done so far in the context of a 2D game: I'm using the SpriteShapes for the grounds as well as the fog in a game. Since it's a bit boring to only use simple sprites for fog, I've tried implementing a shader for this (with the new ShaderGraph). I've played a bit around with shaders in the past and also the fog shader implemented for this is working fine with "normal"2D sprites.
What are the issues:
1) The coordinates of the fill material seem to bit different to to coordinates of the edge material. Isn't there a way to only use the global coordinate system? I created a workaround to use a complete transparent material for the edges. With the same material the issue is displayed in the screenshot:
2) I want to fade out the texture when it's getting closer to the edge. I achieved this for simple textures, but I wonder how this can be achieved according to the actual SpriteShape border. The following screenshot is using a texture that is fading out at the outer edges, but that is a square and not the actual sprite shape shape:
Any help appreciated according to these two problems. I just found simple solutions for 2D sprites, but nothing related to shaders and sprite shapes. Thanks :)
Your answer
Follow this Question
Related Questions
Rigged 2D Sprite looks weird after adding a shadergraph material 0 Answers
Unity 5.4 - Sprite Shadow 0 Answers
Why doesn't a Sprite Renderer with a Mobile/Diffuse shader work on Android? 1 Answer
Shadergraph material messes with sorting layer of sprites in URP 0 Answers
My shader doesn't work if I use the same material for multiple objects with the same texture. 1 Answer