I am trying to recreate this tutorial from Pontus Karlsson on stylised fluffy trees but in Shadergraph instead of Amplify. Basically, each polygon covers the entire UV space and is billboarded individually, to create a stylised fluffy effect.
Thing is, I can’t get it to work properly. I end up with a severe position offset that gets exponentially worse the further from world origin the mesh is located:
This is based on one of the solutions posted in the youtube comments, and have tried other variations posted, including one from the tutorial maker themselves there but to no avail. Different people have had varying results with setting the transform to either Direction or Position.
I looked up how World position is relative to the camera in HDRP and have tried various combinations of Absolute World, World, Object, etc. but it has not helped me. I can either make it change the specific behaviour of the offset (including making it stick to world 0 and be immobile) or if I remove the offset I lose the expected billboard behaviour. I even tried disabling Camera Relative Rendering, but it had no effect besides making everything look like it was under intense motion blur.
I have also attempted this in a fresh project using URP, same results. I also created a basic billboard to get a better understanding of them, which was successful but not in a way I knew how to transfer to this. My brain is fried now so I’ve lost track of all the other small things I’ve tried or any mistakes I may have made attempting them.
I lack the knowledge and experience on how to effectively troubleshoot further and make this work. So any help is appreciated!
Turns out, the Transform from Absolute World to Object space was causing the offset. I replaced it with an extra multiplication of the model’s Transformation Matrix, and removed the final addition from the Object Position.
Here is the completed shader, with billboard size and inflation added from the tutorial:
Thanks for the shader info, I tried your shadergraph but I am getting this issue, where the back billboards are in front of the front billboards, there is some z-ordering issues:
I had a look and replicated this kind of behaviour by making it Transparent like your master node. We instead used a Standard Opaque Lit shader relying on the fresnel to fake transmission (which does unfortunately mean it needs to be tuned per each level’s lighting).
This is the result we intend to ship with + the master node settings:
I couldn’t find a quick way to make it sort properly on a Transparent shader, so if you need that specifically then I’m afraid I can’t be of much help. I would suggest however, if you’re using HDRP, to use the Lit master node instead of the PBR one, since that seems to be the one we’re meant to use for HDRP (frustratingly, this master node is not mentioned in the 7.3 Shadergraph docs, but is in HDRP: https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@7.3/manual/Lit-Shader.html still worth checking the docs for your versions just in case though.
You may be able to get the results you want from Translucency + Diffision Profile (which is closer to actual plant behaviour, Transparent is for things like glass), which is available from the material type options. However, while this looks great on things like our grass, it appears to have little to no effect on these kinds of meshes, so I presume additional shader magic would be needed.