NEON-BUIDL / DAOtown

The wild west of cipherspace, welcome to DAOtown (WIP!!)
https://neon-buidl.github.io/DAOtown/
7 stars 2 forks source link

Optimization: Modularize asset kit for buildings #12

Open madjin opened 1 year ago

madjin commented 1 year ago

image

To make a bigger world, we need to modularize assets so that we can use gltf-extension for instancing that hyperfy now supports. Here is an example architecture kit from mozilla hubs: https://hubs.mozilla.com/docs/spoke-architecture-kit.html

image

This way we can save on draw calls. Things we want to reuse:

madjin commented 1 year ago

Proposal: Builder App

There's a ton of building asset kits already: https://sketchfab.com/search?q=building+kit&type=models

Instead of making a new asset kit, reinventing the wheel, I think our efforts would be better spent tapping into the power of real-time collaborative world building that Hyperfy enables with an app that allows us to load asset kits and use them with poweruser keyboard / mouse shortcuts.

User should be able to drag and drop into the world, and have snapping so that pieces can fit perfectly next to each other. This can be done with some keyboard shortcuts as well:

We'll be able to tap into the power of open standards like this gltf-extension for GPU instancing, making bigger worlds that are more performant, and other platforms that utilize this extension will be able to load these worlds in and be performant as well.

madjin commented 1 year ago

image image

madjin commented 1 year ago

tldr steps to get instancing to work

can use an asset pallet (see https://github.com/M3-org/base-meshes) to test with, and go from there

madjin commented 1 year ago

there's a cost involved in making something instanced because in threejs you have to specify the amount of instances so if you have 100 completely different models all with "instancing" enabled but theres only 1 of each, that would be horrible

need to be smart about how to go about it in a way that makes sense, like some kind of heuristic that counts how many times an object spawned and shove things >2 into instance

perhaps could add ?instance=true in the asset pallete url so the platform knows to instance? or detect objects after spawning in some kind of manual optimization step for worlds