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

Changes to allow stereo images #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vincentfretin
Copy link
Member

This is a non compatible change, so probably will never be merged in this state, but for those wanting to use a stereo image the same as a stereo video, here are the changes needed.
This fixes #27

@vincentfretin
Copy link
Member Author

#26 proposed the same feature, changing the default split value to empty string.
If we want to keep backward compatibility, we could switch to the original geometry (see #43) if split value is empty meaning it's a mono image.

@vincentfretin
Copy link
Member Author

Also the changes break the boxes example, transforming the box to a sphere because a box is a valid BufferGeometry. I'm not sure how we can keep backward compatibility for this case. In the case of the boxes example, the stereo component is just used to set the layer. For this use case, we also have the more generic layers component supporting any layer value, not just 1 (eye:left) and 2 (eye:right).

@vincentfretin
Copy link
Member Author

I actually replaced
https://github.com/oscarmarinmiro/aframe-stereo-component/blob/cb94d3a082e65f5d13c05f52a55a0578ae47f459/index.js#L44-L47
by just

const isValidGeometry = object3D.geometry instanceof THREE.SphereGeometry;

in my fork, only handling sphere geometry, and using the layers component combined with the mirror component for example where you can specify the layers you want to render in the mirror.

@vincentfretin
Copy link
Member Author

In #26 the condition if (isValidGeometry && (material_is_a_video || material_is_a_image && !!data.split)) (here) make the boxes example still work I guess, but if you use a texture on the boxes, you will have the same issue of boxes transforming to spheres :)

@nuess0r
Copy link

nuess0r commented Sep 15, 2023

In this project the aframe-stereo-component was used as basis to show stereo images in JPS format. He did it on top of it instead of doing breaking changes, so it could be of your interest:
https://github.com/dpa99c/stereoscopic-slideshow

@vincentfretin
Copy link
Member Author

Thanks @nuess0r you can indeed have two images, one for left and one for right and just use stereo="eye:left on one, and stereo="eye:right in the other, that's what your linked example is doing.

I'm using my own changes of stereo component for years now with top/bottom images. A few years back I had top/bottom 360 videos and extracted a single frame from it, so I had a single file and I just did this change to make it work with stereo="eye:left;split:vertical and stereo="eye:right;split:vertical.
Here in the different PRs I created I just wanted to contribute back all my changes. If this one is not merged, that's okay, others can still read the changes and discussion here if they want it.

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.

Split not working for images
2 participants