My Authors
Read all threads
Today I'd like to talk about the shader I made for The Adventures of Wolf and Hood. It's what gives the puzzle pieces their realistic look but it also allows for a cool visual effect when you complete a puzzle. 1/9 #screenshotsaturday #gamedev #indiedev #jigsaw #madewithunity
The shader is actually pretty simple, just a main texture plus a shadow and normal map derived from the shape of the puzzle pieces. The cool bit is how these are smoothed away around a position in space (the final mouse position) with the effect radius controlled by script. 2/9
I also add an expanding particle system to give it a bit more interest and to make it look like the particles are smoothing out the joins between the pieces. I use a sprite mask to keep the particles inside the puzzle frame. 3/9
Now, here's where it gets weird and nerdy. What follows is going to be a tedious explanation of a problem I had with the Android build of the game, which took me weeks to figure out. Only read on if you've had shader problems on mobile with Unity 2019. 4/9
The PC build worked just fine, and when building for Android the editor version looked fine too. However, when testing on an Android device the smoothing effect just wasn't right. The joins between the pieces didn't go away as intended. 5/9
The odd thing is in Unity 2018 it worked just fine, so something had clearly broken in the upgrade to 2019. I tried everything I could think of and I won't bore you with what didn't work so I'll just describe what I did to finally fix it. 6/9
I changed the order of the exposed shader properties in Shader Graph. Makes no sense, right? I change the effect radius value of the material via script but for some reason in the Android build that wasn't working. But if I moved that property up in the order it worked fine. 7/9
I verified this with the other properties and found the effect centre (set by the final mouse position) would also stop working if it was in a particular place in the property list. I solved the problem by just trying different orders until it all worked. 8/9
I only change a couple of the properties via script so as long as those properties could be changed then all is well. But it's still super weird and clearly an issue that could catch you out. If you're having similar problem I hope this helps you fix them. End of thread. 9/9
Missing some Tweet in this thread? You can try to force a refresh.

Keep Current with Tim Waskett

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!