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

Add example using three-d #1398

Closed
wants to merge 11 commits into from
Closed

Add example using three-d #1398

wants to merge 11 commits into from

Commits on Mar 22, 2022

  1. Add example using three-d

    https://github.com/asny/three-d recently merged a PR adding
    `glow` support: asny/three-d#210
    This means it is a prime candidate for embedding 3D painting inside
    an eframe app.
    
    There are currently a few kinks that need to be figured out:
    
    When reusing the same three_d context over time (as one should),
    we only get one frame of egui together with three_d, and then after that
    a black screen with just the three_d painting on top.
    
    I need to fix that before merging this PR.
    
    `Shape` is `Send + Sync` and `three_d::Context` is not. This means
    we cannot store a three_d context and send it to the `Shape::Callback`.
    
    So we either need to recreate the three_d context each frame (obviously
    a bad idea), or access it through a `thread_local` hack.
    This PR adds both as examples, with a checkbox to switch.
    
    We could consider making `Shape: !Send + !Sync`, but that would mean
    `egui::Context` could not be `Send+Sync` either (because the egui
    context stores shapes).
    
    This is discussed in #1399
    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    9455851 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7cadfa7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8e8c149 View commit details
    Browse the repository at this point in the history
  4. Fix viewport of three-d example

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    1dc7a41 View commit details
    Browse the repository at this point in the history
  5. Cleanup

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    7f68056 View commit details
    Browse the repository at this point in the history
  6. Refactor VAO

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    0251ef4 View commit details
    Browse the repository at this point in the history
  7. Update three-d

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    ab80b2d View commit details
    Browse the repository at this point in the history
  8. Rename VAO to VertexArrayObject

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    fc57840 View commit details
    Browse the repository at this point in the history
  9. Silence clippy

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    d121245 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    a4acc69 View commit details
    Browse the repository at this point in the history
  11. Update docs

    emilk committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    6710d6d View commit details
    Browse the repository at this point in the history