Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entities: Add LOD and Load Priority properties to entities. #1709

Open
digisomni opened this issue Oct 25, 2022 · 6 comments
Open

Entities: Add LOD and Load Priority properties to entities. #1709

digisomni opened this issue Oct 25, 2022 · 6 comments
Assignees
Labels
stale Issue / PR has not had activity

Comments

@digisomni
Copy link
Member

digisomni commented Oct 25, 2022

Summary

LOD

We will be adding a few properties under a "LOD" object for the "Model" entity type.

lod: {
    mode: 'auto' // 'auto' or 'manual', if auto then the levels are disregarded and the engine / client's auto LOD system is used.
    levels: [
        0: { url: 'https://google.com/mymodel-slightly-decimated.glb', distance: 5 }, // Can use a new URL for separate models
        1: { url: 'https://google.com/mymodel-very-decimated.glb#NewTree_LOD1', distance: 10 },  // Or you can access the index on that model
        2: { url: '#NewTree_LOD1', distance: 25 } // This will access an index relative to the main model URL for the entity without having to repeat a URL
    ]
}

Engines

  • Babylon.js - Auto LOD
  • Unreal Engine - Nanite

Load Priority

loadPriority: 43

This property is applied to all entity types. It is a number from 1-255 (or whatever a good max integer is for the packet). This property is utilized by a client to determine which asset should be downloaded and loaded first.

@digisomni digisomni changed the title Performance: LOD and Load Priority Performance: LOD and Load Priority Entity properties. Oct 25, 2022
@digisomni digisomni changed the title Performance: LOD and Load Priority Entity properties. Entities: Performance - LOD and Load Priority Entity properties. Oct 25, 2022
@digisomni digisomni changed the title Entities: Performance - LOD and Load Priority Entity properties. Entities: Add LOD and Load Priority properties entities. Oct 25, 2022
@ctrlaltdavid
Copy link
Collaborator

If auto, which level URL should be passed onto the engine - always URL 0?
Load priority values:

  • 0 could mean "don't care".
  • The range 0 - 255 will nicely fit into a single byte in the protocol.

@digisomni
Copy link
Member Author

I think loadPriority should be from lowest to highest, so 0 means load first, 255 means load last. And yup, I picked that range because it fits well for optimized networking. 😊

Auto means use automatic LOD systems, with Nanite that means it automatically scales assets, with Babylon.js it will do the same. There may be systems that try to auto select based on URLs, that would be documented so the user knows to fill in URLs as well as set it to "auto" if they want that feature to work in that specific client/engine.

@digisomni digisomni changed the title Entities: Add LOD and Load Priority properties entities. Entities: Add LOD and Load Priority properties to entities. Nov 24, 2022
@Aitolda
Copy link
Collaborator

Aitolda commented Jan 30, 2023

Kalila asked me to move this from another issue I made.

This is how LOD would work ideally for creators who use tools like blender. I've created 4 LODS for an object (two objects technically), with LOD0 having the full amount of polygons (full detail), and LOD3 having the least. They way LOD typically works is at a certain threshold (specific distance) from the camera (not to be confused with the avatar) the system would automatically choose to render a lower LOD, and even further beyond a lower LOD until it reaches LOD3.

LOD

Notes on implementation can be found here

Why do we want this? I already have a simple script that will generate these LODs with 1 click on any object in blender. If our system can be made to simply recognize the "_LOD1, _LOD2, _LOD3, _LOD3 of any objects in the glb it will make it VERY easy to create large detailed environments.

@digisomni
Copy link
Member Author

I've updated the spec accordingly, so it should be able to handle both cases now.

@Aitolda
Copy link
Collaborator

Aitolda commented Jul 29, 2023

LOD example prototyped in Blender
Video is 2 minutes long. Be sure to unmute

LOD_Prototype.mp4

Copy link

stale bot commented Jan 25, 2024

Hello! Is this still an issue?

@stale stale bot added the stale Issue / PR has not had activity label Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue / PR has not had activity
Projects
None yet
Development

No branches or pull requests

4 participants