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

Examples: Add external three-mesh-bvh library demo #23907

Merged
merged 17 commits into from
Jun 28, 2022

Conversation

gkjohnson
Copy link
Collaborator

@gkjohnson gkjohnson commented Apr 16, 2022

Related issue: #23876 (comment)

Description

Adds a demo based on the three-mesh-bvh library. The library is linked to via unpkg so no version has to be maintained in this project. Links to three-mesh-bvh repo included in the page. 3000 bunny raycasts per frame is still at 60 fps on my machine 🎉

Live link:
http://raw.githack.com/gkjohnson/three.js/external-bvh-demo/examples/index.html?q=exter#external_bvh_raycasting

At some point I'll make another one or two with some other queries and add a path tracing demo, as well.

image

And just for fun, 10000 rays at ~24fps:

image

And 40000 at 6fps 😭

image

@gkjohnson gkjohnson requested a review from Mugen87 April 17, 2022 14:46
@donmccurdy
Copy link
Collaborator

I like the idea of including a section in examples for (minimal) showcases of external projects like this. It may help users make the right decision for their projects about when to use the 'official' raycaster/controls/loader/etc. and when to reach for an additional dependency. See also, related challenges in #23526.

Totally a nit — but I wonder if the section should be labeled "community" instead of "external libraries"? Or match the libraries and plugins page? To me it feels better, but maybe just leave this as-is unless at least one other contributor feels the same way. I don't mean to hang this up over naming things. :)

@gkjohnson
Copy link
Collaborator Author

Totally a nit — but I wonder if the section should be labeled "community" instead of "external libraries"? Or match the libraries and plugins page? To me it feels better, but maybe just leave this as-is unless at least one other contributor feels the same way. I don't mean to hang this up over naming things. :)

A name change sounds good to me -- I say we can merge and adjust the name later, though.

"Community" or "Libraries and Plugins" or just "Libraries" all sound good to me. I just wanted it to be clear that these were using logic outside the three.js codebase.

@Mugen87 Mugen87 added this to the r140 milestone Apr 19, 2022
@mrdoob mrdoob modified the milestones: r140, r141 Apr 30, 2022
@gkjohnson
Copy link
Collaborator Author

Ping @mrdoob - is there anything else I can do to get this merged?

@mrdoob mrdoob modified the milestones: r141, r142 May 26, 2022
@looeee
Copy link
Collaborator

looeee commented May 31, 2022

"Community" or "Libraries and Plugins" or just "Libraries" all sound good to me.

What about "Community plugins" or "Community extensions"?

@gkjohnson
Copy link
Collaborator Author

Just changed it to "community plugins" - thanks for the suggestions guys!

@looeee
Copy link
Collaborator

looeee commented Jun 1, 2022

@mrdoob any opinion on adding this new Community Plugins section to the examples?

We can limit it to just a few of the highest quality projects out there, in which case I don't expect there would be many more than five or so examples.

Beside three-mesh-bvh, I can think of @yomotsu's camera controls, @gkjohnson's three-gpu-pathtracer, and @vanruesc's postprocessing as strong candidates.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jun 1, 2022

Sidenote: webgl_loader_ifc should also be moved to the community plugins section.

@mrdoob
Copy link
Owner

mrdoob commented Jun 17, 2022

Sorry for the delay...

I think it'll be better to name the example webgl_raycasting_bvh.
And in the info panel in the example mention that it uses three-mesh-bvh and link to it.

@gkjohnson
Copy link
Collaborator Author

@mrdoob okay I figured it might be nice to have a section to more explicitly promote community efforts - but I just updated the file names!

@looeee
Copy link
Collaborator

looeee commented Jun 18, 2022

have a section to more explicitly promote community efforts

+1 from me 👍

I think it's a missed opportunity to help support the larger three.js community if we don't do this.

@mrdoob
Copy link
Owner

mrdoob commented Jun 21, 2022

@looeee

I think it's a missed opportunity to help support the larger three.js community if we don't do this.

I definitely hear you. I'm just not sure that a section for it is the best solution.

I'm thinking about it from the point of view of the user/developer experience:

In this case I'm imagining the developer learning about the raycaster and going through the examples (which I'm about to clean up) and one of these examples is the bvh one. From there they can jump to learn more about three-mesh-bvh if it fits their need.

I'm thinking we could do something like this:

Screen Shot 2022-06-21 at 3 16 34 PM

[ext] or [comm] or maybe an icon...

I think at the end of the day, we want to do two things:

  1. Showcase the best external libraries from the community
  2. Let the user understand that the example uses a library that is in a different repo

@gkjohnson
Copy link
Collaborator Author

@mrdoob the icon seems like a nice distinction and maybe we can also make the community plugins searchable by some term ("community", "external", "libraries") if users want to take a look at just the community library examples.

@mrdoob
Copy link
Owner

mrdoob commented Jun 21, 2022

@gkjohnson exactly yes 👍

@mrdoob
Copy link
Owner

mrdoob commented Jun 21, 2022

Design wise, I bet @marcofugaro will have opinions 🤓

@marcofugaro
Copy link
Contributor

No design issues 😄

Just UX, maybe the naming ext could be confusing for new users, could it mean "extension"...? Also does comm mean "common"..?

Having the full name would be better in my opinion 🙂 here is how it would look:

image

@looeee
Copy link
Collaborator

looeee commented Jun 22, 2022

@mrdoob that looks good to me :)

I agree with @marcofugaro that the full word "external" looks better. I would probably interpret "ext" as "extension" in the context of examples.

@mrdoob mrdoob merged commit d7452b3 into mrdoob:dev Jun 28, 2022
@mrdoob
Copy link
Owner

mrdoob commented Jun 28, 2022

Thanks!

abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* add external bvh demo

* update new example

* use bunny model

* screenshot

* final updates

* speed improvements

* wording update

* Update external_bvh_raycasting.html

* fixes

* fix links in iframe

* Change ray speed

* Update files.json

* change file name

* Update tags.json
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
* add external bvh demo

* update new example

* use bunny model

* screenshot

* final updates

* speed improvements

* wording update

* Update external_bvh_raycasting.html

* fixes

* fix links in iframe

* Change ray speed

* Update files.json

* change file name

* Update tags.json
@gkjohnson gkjohnson deleted the external-bvh-demo branch February 8, 2023 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants