Future of the Imposter Project
Sadly development on the imposters has begun to slow. I was able to show that I could create a shader with no blending, but when it comes to blending I’m not that knowledgeable.
This week I spent the majority of the time trying to figure out a way to blend between three frames in a clean and simple fashion. When exploring this, I found out that a lerp just wouldn’t cut it. When trying to essentially fade from one frame to another, there’s quite a bit of transparent overlap that doesn’t look very good. Below is a screenshot of what I’m referencing.
A lerp might work if the frames were closer together, but rendering more frames would end up defeating the purpose of the imposter system, in my opinion. At this point I’m considering putting the imposter on stand-by while I look into other technical projects. I’ve spent about a month on this project, and in its current state, the system would work well for something like a static camera with static imposters.
What I Tried to do
Here’s a breakdown of what I wanted to accomplish. Below are three clips showing different layers of the imposter group.
The first is the player’s view. In it, we see the camera facing billboard with the texture atlas images changing based on the angle.
The second is the mesh raycast view. Here the camera shoots a raycast to the imposter dome mesh to figure out which tri it’s in / which 3 frames need to blend together.
The third is a triangle mesh generated with a color for each vertex. This works as a way to measure the weight of each vertex. A raycast shoots towards the tri where it reads the RGB color value, then those values are sent over to the blend shader.
Here’s what the current blend looks like on the Left. It’s very choppy due to the raycast reading the black background behind the mesh before it makes the transition to the next tri-mesh. To avoid the black color I could write something that ignores the color entirely or find a way to avoid changing the images when black is read through. On the Right I show what happens when LOD groups are used. Like my post a month ago, Unity has a custom LOD system that lets me drag and drop models into it. When the camera reaches a certain distance from the high-poly mesh, it flips into the frame render. Doing this with a single tree does show some promise in the scene statistics!
Batches: 18 -> 5
Tris: 13.7k -> 1.7k
Verts: 13.9k -> 5.1k
Tris: 13.7k -> 1.7k
Verts: 13.9k -> 5.1k
Development of a tool
Looking ahead, I’ll still work on making the imposter a tool. By creating a one-click editor tool out of this, I will call it complete. I’ll be able to use it for Groundless and future projects. Currently it is partly operational. I have the proper hierarchy instantiate in editor, and everything links up. What’s left is to have the texture atlas save out to the asset directory. In doing so, the texture atlas will be generated a single time and then called upon by any camera facing billboard that needs it. Should be done by next post!
References
Amplify Imposter http://amplify.pt/unity/amplify-impostors/
Happy Tuesday!