#Impostor generator?
1 messages · Page 1 of 1 (latest)
you'd use something like VisibilityRange: https://docs.rs/bevy/0.18.1/bevy/camera/visibility/struct.VisibilityRange.html
Specifies the range of distances that this entity must be from the camera in order to be rendered.
if you're talking about actually generating the imposters, the original blogpost on them is super detailed and there are a few open-source implementations of them, including the original and the third-party one for Godot here. I believe the tl;dr is that you need to slap the model in question into a completely empty scene and render it from a bunch of different camera angles using an orthographic camera; every angle should have the same orthographic scale, which I believe is calculated from the model's AABB/extents.
in Bevy specifically I would approach this by creating a plugin which takes filepaths to raw assets (i.e. using a glob on the assets folder) and writes them to a separate directory (i.e. assets/imposters). If you take the plugin approach you can start simple by just making a second binary which adds your plugin; if you end up with an editor workflow in the future you can just run your baker in a SubApp.
As for structuring input/output, it's really up to you as the inputs are files and the outputs are files so the plugin is really a black box with no specific API necessary. Given Bevy's migration to assets-as-files, I think it would be appropriate to have one system which scans the directory for input/output files, compares checksums, and adds entities with a RequestImposterBake component on them. Then you have another system which scans for all entities with that component, bakes them one-by-one, and outputs the output files, kinda treating the ECS like a queue. I don't think there's a good reason to use a multiple-camera or multiple-worlds setup for parallelization as the implementation is ultimately going to be GPU-bound on actually rendering the cameras, so you might as well just do everything serially with a for loop over requested imposter baking and each camera point within that bake.
The special sauce here is a camera which renders to a texture. See this example.
Loooks like I need to start doing some coding. I was kinda hoping there aws something premade. 🙂
I think LODs in general are a bit lacking in support right now yeah. It should be relatively simple though, distance check each frame versus the camera and if they are within a range swap the mesh to a different one or billboard/imposter
Frankly I think this is the kind of thing that could be self-contained and upstreamed if done well enough
But yeah I can't find any imposter Lod that's premade...
yeah, it's honestly a bit low hanging fruit at this point imo
i think it is just a part of not many bevy games actually have that many objects/large worlds yet lol
We kinda jumped the gun having big_space but no LoD LMAO
I have my own custom LOD stuff rn but thats because its voxel stuff and normal mesh lod doesnt work well
i might look at implementing that octahedral imposters, looks relatively simple actually
ya lmao
Tbf I think it exists because of foresight, they have some large datasets/rendering sets but their rendering is also not standard i dont think, it's more GIS/point cloud-esque
I'm not entirely sure if that was the reason it was made originally, but the person who developed it initially works there I believe
I don't know the timing
actually crazy how effective this seems at giving very high quality imposters
i think there's a reason it has what I can only describe as a cult following of developers who really want to use it everywhere
tbf it is pretty magical that fornite runs on phones
I get it, automated LODs that look good is basically the entire premise of stuff like nanite because making LODs is a pain in the ass. Something like this which is both cheaper and easier to implement than nanite is a blessing for quick optimization tricks lol
bevy has an open issue for octahedral imposters fyi