I have a raw image that has a webcam texture and the raw image and webcam texture are made to fill the screen with an aspect ratio fitter. It works in the editor with multiple resolutions, but when building for web (WebGL or WebGPU), the webcam texture stretches. What would be the cause of the problem? Is it a strictly web-related thing? Find attached a small repo inspired by the following tutorial: https://www.youtube.com/watch?v=c6NXkZWXHnc&ab_channel=N3KEN
Did you log the webcam input texture dimensions? I can imagine that normally you may get 1280x720p and that scales fine but on the web, due to how web technology is one giant molasses of compromises, you may get something quite different like 640x512 if the webcam driver or the browser somehow defaults to that resolution. This test is to make sure the input is what you expect it to be and I have a hunch there.
The oher thing being how the web application is a window in a window in a window on a screen. So check the fullscreen behaviour. If that‘s fine, the issue is likely with scaling the output inappropriately. I can‘t recall exactly but the meaning of things like Screen.width may change on the browser or it might simply not be the values you should be using.
I should’ve mentioned that I’m using the PWA template so the build fills the entire page by default, and indeed I do get weird logs for texture dims like 16, 16. What do you think is the best way to approach this problem if possible in the first place?