I have made a foliage billboard material with a custom node, that makes two things:
- calculates WPO to align a mesh to the camera, for this it uses nodes “Object Position”, “Camera Position” and “Absolute World Position”;
- calculates angle between the mesh and the camera, for this it uses nodes “Object Position” and “Camera Position” (then baset on the angle I choose image from a texture atlas to draw the correct projection).
If I place a separate mesh with this material in my scene, it works correctly (so the custom node written corretly). But if I use this mesh in PCG or in a foliage object - WPO looks correctly, but the angle isn’t calculated correctly - it looks like the node “Object Position” instead of taking the coordinates of each instance, takes the same coordinates for every instance. As for WPO it takes the right coordinates, I think it has to do with the sequence of shader calculation in the engine, does anyone have any thoughts on this, any solutions?