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

Flip issue with ldr (jpg and png) background texture on environment-settings component #21

Open
vincentfretin opened this issue Mar 17, 2024 · 5 comments
Assignees
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@vincentfretin
Copy link
Member

vincentfretin commented Mar 17, 2024

I apparently didn't test that properly when I wrote the code. An hdr background texture works correctly.

@vincentfretin vincentfretin added the bug Something isn't working label Mar 17, 2024
@vincentfretin vincentfretin self-assigned this Mar 17, 2024
@vincentfretin vincentfretin moved this to In Progress in Sponsorship Mar 17, 2024
@vincentfretin vincentfretin changed the title Flip issue with ldr (jpg and png) envmap on environment-settings component Flip issue with ldr (jpg and png) background texture on environment-settings component Mar 17, 2024
@vincentfretin
Copy link
Member Author

I have this code:

if (settings.backgroundTexture) {
// Assume texture is always an equirect for now
settings.backgroundTexture.mapping = THREE.EquirectangularReflectionMapping;
settings.backgroundTexture.flipY = true;
scene.background = settings.backgroundTexture;

flipY true has no effect here. If I change to false, there is no change. I confirmed it's right here we set the background by commenting the scene.background = line. :)
There is something I don't get here.

@vincentfretin
Copy link
Member Author

I have no idea on this one.

@vincentfretin vincentfretin added the help wanted Extra attention is needed label Mar 17, 2024
@vincentfretin
Copy link
Member Author

https://threejs.org/docs/#api/en/textures/Texture.flipY

If I remember I tested loading jpg image for backgroundTexture with environment-settings aframe component you can use directly on a-scene with environment-settings="backgroundTexture: path/to/image.jpg", not through the glb, and I think it worked there using THREE.TextureLoader() (need to confirm that again). So maybe the GLTFLoader uses ImageBitmapLoader indeed, and I think it does from what I wrote in https://aframe.wiki/en/#!pages/memory.md

Not sure how to fix that and what we do differently from hubs code.

@uhunkler
Copy link
Contributor

uhunkler commented Mar 24, 2024

I tried to understand the issue but without success. The thing I noticed was that any change to filpY in the inflateEnvironmentSettings does not have any effect on the background image orientation. May flipY be overridden somewhere else in other parts of the code?

@vincentfretin
Copy link
Member Author

Maybe we need this patch Hubs-Foundation/three.js@928eb3c to be tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
Status: In Progress
Development

No branches or pull requests

2 participants