#Impostor generator?

1 messages · Page 1 of 1 (latest)

peak ruin
#

Has someone any idea how to automate Impostors for static objects in Bevy for faraway objects?

frail sable
agile hound
#

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.

GitHub

Octahedral Impostors implementation for Godot Game Engine - wojtekpil/Godot-Octahedral-Impostors

#

The special sauce here is a camera which renders to a texture. See this example.

peak ruin
#

Loooks like I need to start doing some coding. I was kinda hoping there aws something premade. 🙂

karmic hamlet
#

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

agile hound
#

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...

karmic hamlet
#

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

agile hound
karmic hamlet
#

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

karmic hamlet
#

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

agile hound
#

Ohhh is it another foresight project

#

That explains why it's so developed

karmic hamlet
#

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

karmic hamlet
agile hound
#

tbf it is pretty magical that fornite runs on phones

karmic hamlet
swift granite