A Unity bug or is my matrix shader broken?
I'm trying to pull off a water reflection effect by mirroring sprites with a Shader Graph vertex transform, it actually works close to perfect if it wasn't for the fact that at certain camera angles vertices simply go mental. I understand nothing of the actual maths behind matrices and such so results as bizarre as these baffles me to say the least. Here's the WIP Shader Graph with an extra matrix showing what I'm using.
What I find the most concerning is the fact that mesh proximity seemingly affects whether or not the vertices goes mental? Weird. I got the mirroring effect down at first but obviously it meant that the sprites no longer faced the camera proper, so I added a matrix on later by trial-and-error numbers to lean them back again. Here's a video of it all; window to the right is in focus for the most part: https://www.youtube.com/watch?v=OfrFmkqrspw
In short, I find these results so odd that I question if it's something in Unity's engine that has gone wonk or if it just is me. Either way I'd love some advice or even just an explanation from a wizard.
If I can get this to function the plan is to look into making each camera render the objects with different shaders. So there are no duplicate-gameobjects everywhere just to see a reflection; they are just going to be rendered differently based on camera. Uh. Incidentally, I also need advice on that down the line.
Your answer
Follow this Question
Related Questions
Find border of Matrix (east, west, north, south) 0 Answers
How to rotate quad towards light in shader? 0 Answers
Rotate gameObject by applying rotation matrix in unity3d 0 Answers
How do I set an array of 3x3 matrices within a material's shader? 0 Answers
HELP URGENT How to convert Mesh from local to World Space? 0 Answers