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

Merge data textures and VBOs into same SceneModel class #1117

Closed
wants to merge 78 commits into from

Conversation

xeolabs
Copy link
Member

@xeolabs xeolabs commented Aug 7, 2023

Changes in this PR

  • Unify vertex buffer object (VBO) and data texture (DTX) modes into the same SceneModel class
  • SceneModel is then no longer an abstract type - becomes a concrete class
  • Update loader plugins to instantiate SceneModel
  • VBOSceneModel and PerformanceModel alias SceneModel for backwards compatibility
  • Create set of examples to separately test each SceneModel model definition and rendering mode

Also:

  • Make LoD culling work for data textures and VBOs
  • Make View frustum culling (VFC) work for DTXs and VBOs
  • Make snap-to-vertex/edge work for DTX and VBOs
  • SceneModel will automatically select whether to use VBOs or DTX internally, for each contained object.
  • SceneModel will use VBOs for some objects, and DTX for others, as required.
  • It will always attempt to use DTX by default for objects that don't have textures.
  • SceneModel will use only use DTX for objects that have triangles, and always use VBOs for objects with point or line primitives.

However for testing, and when we want to force data textures, we can force SceneModel to use data textures for all objects that have triangles, like so:

const sceneModel = new SceneModel(viewer.scene, {
        id: "table",
        position: [0, 0, 0],
        scale: [1, 1, 1],
        rotation: [0, 0, 0],
        edges: true,
        forceDTX: true
    });

Terms

  • VBO = Vertex Buffer Objects
  • DTX = Data Textures
  • VFC = View Frustum Culling
  • LoD - Level-of-Detail culling

Just a heads-up @tmarti and @Kurtil - please hold off on any big PRs to master branch for the next few days. This PR makes some big refactorings of your recent PRs, unifying them into the same SceneModel class. Small PRs should be OK though, if they're small enough to enable me to manually copy them into this branch.

@ghost
Copy link

ghost commented Aug 7, 2023

👇 Click on the image for a new way to code review

Review these changes using an interactive CodeSee Map

Legend

CodeSee Map legend

@xeolabs xeolabs self-assigned this Aug 7, 2023
@xeolabs xeolabs added the enhancement New feature or request label Aug 7, 2023
@xeolabs xeolabs added this to the 2.4.0 milestone Aug 7, 2023
@xeolabs xeolabs marked this pull request as draft August 7, 2023 21:04
@xeolabs xeolabs marked this pull request as ready for review August 31, 2023 22:39
@xeolabs xeolabs closed this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant