The first 500 people to use my link skl.sh/kylebanks10241 will get a 1 month free trial of Skillshare premium! Thank you to Skillshare for sponsoring this video
I found you out literally yesterday and said to myself exactly "wow, that's so cool, how did he do it?" your game looks amazing! I also love that you used this opportunity to try it out in another engine
Well done! And nice you choose to step out of your usual comfort range to dabble with Godot 👌 one thing I've particularly heard about shaders is avoiding "if", did this shader eventually do that?
Honestly I think that advice is generally outdated and shared without understanding the reasoning. If you look into why ifs are bad, it's really situational depending on condition types, whether a portion of the wavefront is likely to split, and whether the compiler is able to optimise out the condition. Modern GPUs are much better at this than they were in the past. In this case you could easily use a lerp or something to that effect to remove the conditional, but for tutorial/demonstration purposes it just muddies the logic and again, on modern GPUs you're not really saving much. I shipped Farewell North with plenty of ifs and it was never an issue, even on switch, but being cognizant of when it is and is not sub-optimal is always a good idea for sure. It's just not the critical issue a lot of forums and videos would lead you to believe :)
Not sure if you didn't mention it or I just missed it, but how do you apply that shader to ALL objects? Do you copy that code to all shaders, have one shader for all objects, hook into some more internal pipeline or something else? And thanks for sharing!