supermedium / three.js

JavaScript 3D library.
https://threejs.org/
MIT License
34 stars 33 forks source link

Improve layers implementation #10

Open dmarcos opened 1 year ago

dmarcos commented 1 year ago

Description

We have now a simple implementation:

https://github.com/supermedium/three.js/blob/dev/src/renderers/webxr/WebXRManager.js#L373

It can be tested in

https://aframe.io/aframe/examples/showcase/comicbook/

Can switch layers by pressing thumbstick. Feature only available in immersive mode and Meta Browser on Quest.

I think there are new features available like punch through that I'm happy to incorporate.

@cabanier What do you think? Any code we can incorporate? PRs also super welcome? Thanks!

Solution

n/a

Alternatives

n/a

Additional context

No response

cabanier commented 1 year ago

This commit adds support for hole punching of Quad and Cylinder layers: https://github.com/mrdoob/three.js/pull/25254/commits/ea1fad2b919fd51dfc4fafed68b8859393684f6c

This allows layers to mix with the VR scene. The PR is stuck since January :-\

dmarcos commented 1 year ago

Thanks. Do you think it would be possible to move those WebGLTexture changes somewhere else. WebXRManager for instance? WebGLTexture, WebGLRenderer files have a lot of churn and it's hard to maintain in the fork so I try to avoid as much as possible.

cabanier commented 1 year ago

It's actually only a very small change (1 extra check) but for some reason it looks large in the diff because it got confused.

dmarcos commented 1 year ago

I see, thanks. If you have some time to open a PR against the dev branch in this repo I'll review and merge. Probably quick for you since you're familiar with the code. If busy, no worries. I'll incorporate as soon as I have some bandwidth. Thanks for getting back so quickly

dmarcos commented 1 year ago

The additional changes in the diff could indentation, empty space? I have similar issues sometimes since don't have a three style linter on my editor

dmarcos commented 1 year ago

Some editors set to replace spaces for tabs on save or viceversa