I’ve been experimenting with different techniques to make a billboard material that always faces the camera. My goal is to fake a forest using billboards with trees textures displayed on a 2D plane These billboards will be foliage types that can be instanced using Unreal’s foliage tools so that the planes don’t have to be manually placed (There are more reasons for avoiding the placement of single static meshes on the scene for the billboards, but that’s not the main focus).
This is the plane I’m using, it faces the x axis:
The first technique I tried is commonly used for particle effects, which is very useful. However, it only works when I use translucent blend mode in the material. If I use another blend mode, the material, to put it simply, explodes . This is problematic because a translucent billboard isn’t what I want, and overlapping planes produce noticeable artifacts. The following image shows the function I used for rotating the plane towards the camera:
Edit: To clarify, the output of this material function goes into the world position offset input from the material (Not sure if that needed clarifying)
These are the artifacts, and there’s also a lot of flickering when the planes are far away. This clearly shows why the translucent mode is not useful in this case:
The second technique works only with single static meshes, the idea is to fix the Z axis and calculate the direction in which the plane has to rotate to face the camera. The problem is I can’t figure out how to get the position from each plane instance instead of the InstancedFoliageActor position, this is my progress so far:
I hope someone can help me with this. I would greatly appreciate any suggestions or recommendations for a solution to this problem. Thank you in advance!