c-frame / aframe-gltf-model-plus

gltf-model-plus component to load glb file with hubs extensions
https://c-frame.github.io/aframe-gltf-model-plus/
Mozilla Public License 2.0
10 stars 3 forks source link

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

Open vincentfretin opened 2 months ago

vincentfretin commented 2 months ago

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

vincentfretin commented 2 months ago

I have this code: https://github.com/c-frame/aframe-gltf-model-plus/blob/cf6805c80b50f9bef5331bfb202b94d22901aa4a/src/inflators/environment-settings.js#L81-L85 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 commented 2 months ago

I have no idea on this one.

vincentfretin commented 2 months ago

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 commented 1 month ago

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?