Billboard Imposters
Last week I played around with Unity's LOD system during my journey into the realm of optimization. This week I took a step in the direction of billboards and render textures as a form of optimization. Below are a few images of the initial tests. On the left is a model and it's billboard imposter. When rendered from a single angle, it reads well in the player camera. The only issue is that when the player starts to walk around it, they would just see the empty space behind it and not the side of the tree. To avoid this, I tried adding more render textures from more angles. 9 to be exact: increments of 45 degrees and a top-down render. On the right is a view of all these render textures put together. Not too pretty looking...
In an attempt to smooth the transitions between the billboards and hide the unnecessary ones, I began playing with shaders and writing a script that would determine which planes were facing the camera. The script was easy. Using the plane's normal and finding the dot product between it and the difference of the plane transform and camera transform, I was able to find the planes facing the camera. I set the others to inactive. This sort of helped, but the planes were still unblended and didn't achieve the effect I wanted
I started playing wish shaders to work with the blending, but nothing worked in my favor. Using any form of transparency didn't help the billboards because they ended up rendering in a strange order. I'll have to find some other method for blending
The last method I tried was to use a mask and blur the edges of the billboard. It sort of worked, but there were still extra sides that should have been hidden. Take the images below for example, the billboard imposters look somewhat convincing, but aren't too practical. I'm researching what I can with this form of optimization. My main inspiration is a blog on ShaderBits by Ryan Brucks of Epic Games. I'll be reading into what he's done, as well as other resources I find online in order to learn more about this process and just learn about optimization overall.
References
Happy Tuesday!