Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UI Screen Space - Camera FOV - WebGL

Discussion in 'Web' started by robrab2000-aa, Apr 4, 2019.

  1. robrab2000-aa

    robrab2000-aa

    Joined:
    Feb 8, 2019
    Posts:
    117
    I've created a gradient material using shader graph and have it rendering with screen space - camera so that I can have it covering the screen with the 3d objects in front of it. This works great until I adjust the FOV on the camera (through cinemachine), at which point it stops covering the whole screen in WebGL:



    It doesn't do this in the editor. In the editor when you adjust the FOV on the camera, it scales the canvas to still fit the extents of the screen.

    I saw this thread which described a similar issue related to the colour space being used in WebGL: https://forum.unity.com/threads/can...t-scale-when-using-linear-color-space.508476/

    I am certainly using Linear colour space but I have tried building in gamma space instead and the issue persists. There is mention of disabling other effects like HDR and AA however visual fidelity is crucial to the use case and so this isn't really an option.

    As a workaround I could just manually scale the rect transform but really I'd prefer to just get it working correctly this way if possible.