Lets be frank. Billboarding, if your not using unity’s tree creator for billboarding, is the worst process ever, and I feel like almost no one does it. It is especially annoying if it is implemented towards the end of a game, where teams are trying to rescue frame rates. Like who wants to sit there and go through all their large scale models, or sections in the game, and create custom billboards.
I mean maybe it’s not that bad, and I’m just not very proficient at it to begin with and everyone else has it a lot easier. However, I am done doing wacky box projection on planes and adjusting uvs and lighting in 3ds max. It is horrible.
It is for this reason I am writing my own editor extension.
Sorry if I am ranting, I just need to know if I’m the only one. If you guys have any advice please let me know. Maybe I’m just doing it the hard way or something.
hate it or love it, sometimes it is necessary… I would rather have a distant forest mostly billboarded then full 3d models… save the good stuff for LOD.
So I thought people did handmake billboards. That kind of stuff just seemed so complex for trusting runtime scripts to construct billboards. Not to mention the fact, you’d also have to construct a ton of textures during runtime for that to work.
If this is really how people do it. Consider me impressed.
Before RenderTextures were a thing they did, but RenderTextures have been pretty standard for ages now.
And yes, it is quite a bit of work to make one, but it only needs to be done once per period per cluster/type of objects, and as long as it’s cheaper to do that than to render the things all individually it’s still a win.
This is a screenshot from “Rise of the Tomb Rider”:
Nobody. You’re supposed to automate the process as soon as you realize that you’ll need a LOT of bilboards.
For a start: rather than doing wacky box projection, you can just render those from several angles.
Also, unity has a “sprite” class which you could try using for this purpose, as long as you slap proper shader on it.
Either way, if you’re adjusting uvs, you’re doing something wrong.
I haven’t modeled even one billboard mesh, and automated the hell out of the process.
In this case sprites were rendered in blender, but I would be able to transfer the process to runtime generated textures with no problem whatsoever. Same algorithm.
For trees i used Custom Tree Importer which has a small tool to create billboard, take about 2 minutes per tree. Another tool that will come out, Vegetation Studio, also has some sort of auto billboard and in this one you have nothing to do. There may be other tools or you can make your own, but surely you don’t want to do this by hand.
Wow. My first thought looking at that screenshot was that it looked like one of those old movies where they placed actors in front of another movie and pretended they were part of it. It looks horrible.
That forest is completely unreachable, by the way.
It only looks horrible if you climb on top of a very tall structure, look at the furthest section of a landscape and ZOOM. If you don’t zoom, it is very hard to spot the billboards.
I suppose in this case QA did not account for zooming.
Or it was so out of the field that they didn’t bother allocating resources for something you had to reach to see how bad it is. That’s a perk for dedicated gamer.
Op watch this video to keep your sanity, especially relevant at 20:00
Thank you for the resource. This definitely makes me feel better.
I really like the idea of just being able to do a one click render. Also, the advisable LOD distance is a pretty good idea too. I’ll be sure to add this to my tool that I’m working on.
Hm that is a pretty interesting approach. I think that’s certainly a way to go about it, but I do feel like you’ll lose a lot of quality on those billboards. How is the billboard Generated? Are you always rendering the model? Why not use instancing/batching for something like that?
I really like the idea of automating it, but I’m not sure about the results. Would you still be able to handle lighting? Would you be able to generate normal maps this way?
It’s rendered exactly the same way any other 3D model is rendered in your game. The only difference is where the pixels are put - into a RenderTexture (an “off-screen buffer”) instead of on the screen. You can then use the “pre-rendered” pixels in that texture as many times as you want, pretty much just like drawing a sprite in a particle system.
The idea is that you’re using it for small or distant objects so that this is less of an issue. The trees @neginfinity posted are a great example - they look ugly when zoomed in like that, but when you’re just playing the game you’re not going to notice that background details are a bit flat.
That said, while I’ve never done it I’m sure you could render normal and maybe even depth maps with your billboard texture and use those to provide some degree of individual lighting detail.
You could implement lighting on bilboards, by encoding more information into bilboards. At the bare minimum you’d want normalmap, and ideally also “depth” if you want bilboards cast shadows onto themselves.
Generating normalmaps should be fairly easy, that’s what replacement shaders are for.
Usually bilboards are unlit, though. So if you’re trying to cast shadows on them, you might be moving in a wrong direction. It might be easier to just tint them based on something akin to light probe data, etc.
I’m pretty sure I can make normal maps, and depth maps in unity. So that’s pretty cool.
After toying around with this in unity, I’m pretty much convinced that the runtime mapping is reasonably doable. My issue is getting good results for more unique areas. My alternative is to just render out some billboards using a “1 click” unity editor tool beforehand.
Although if I do that then, I might as well, just render out the other objects beforehand as well. Then I don’t have to worry about having more systems in the scene during runtime. I can also manage the assets better.
I do recommend to try unlit bilboards first, though. Integrating things into unity’s lighting pipeline is not exactly trivial when you want to change depth your objects write into zbuffer. The main problem is global directional light.
Oooof that’s a lot of shader code to take in. I think I got the jist of how to deal with depth. It’s definitely overkill for trees, but it may be useful to have for some large area billboards.
GPU Instancing in Unity is often slower than just submitting a pre-baked chunk of billboards. I created an example how we used to efficiently render character crowds on older hardware.