Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Thursday, June 8, for a Q&A with Unity's Content Pipeline group here on the forum, and on the Unity Discord, and discuss topics around Content Build, Import Workflows, Asset Database, and Addressables!
    Dismiss Notice

Bug WebGL doesn't support spotlight cookies under URP?

Discussion in 'WebGL' started by shwhjw, Mar 14, 2023.

  1. shwhjw

    shwhjw

    Joined:
    Mar 15, 2016
    Posts:
    61
    Hi, spotlight cookies were added to URP somewhat recently, but I've found that WebGL doesn't seem to support them when also using URP (they do work the the standard renderer).

    Is this a known issue? Is there a plan to make URP spotlight cookies work in WebGL? I checked the cookie docs and URP docs and there is no mention of WebGL being different.

    Thanks,
    Si.
     
  2. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    176
    they *should* work in WebGL. can you send a sample project that shows the issue? (or better yet, create a bug report so I can get it triaged quickly :) )
     
  3. shwhjw

    shwhjw

    Joined:
    Mar 15, 2016
    Posts:
    61
    Hi Ruba, I did submit a bug report on Sunday in the editor but didn't get any confirmation it'd been sent.

    I've attached a simple example project made with Unity 2022.1.23f1. It's literally just a URP project containing a spotlight with a cookie on a quad:
    upload_2023-3-14_23-20-51.png

    Here is the resulting WebGL build:
    https://sim0wn3d.itch.io/webglcookietest-urp (password is "cookie")
    upload_2023-3-14_23-21-32.png

    So it seems WebGL doesn't support cookies, unless there is something fundamental I missed? I deleted all Quality levels apart from the highest so there's no way it's dropped to lower quality graphics.

    I can try to submit another bug report if you think it's needed.
     

    Attached Files:

  4. shwhjw

    shwhjw

    Joined:
    Mar 15, 2016
    Posts:
    61
    I've just tried it in Edge and the cookie works in Edge! Why not Firefox?
     
  5. shwhjw

    shwhjw

    Joined:
    Mar 15, 2016
    Posts:
    61
    So after more testing, in Unity 2021.3 the simple cookie scene also works in Edge. But for some reason the 3d scene never loads in Firefox (I'm using 111.0 64-bit).
    With Unity 2022.1, the cookie also shows in Edge, and Firefox can load the scene but there is no cookie in the spotlight.
    So seems it might be a problem with the Unity WebGL player in Firefox. Are there any known issues?

    I am still having trouble with my runtime-created cookies in URP + WebGL + Edge (there is no light at all like the spotlights are disabled), but I guess that could be a scripting issue (they work in the Windows build). Will do some more testing over the next few days.
     
  6. unityruba

    unityruba

    Unity Technologies

    Joined:
    Nov 6, 2020
    Posts:
    176
    so, interestingly, when I open your itchio link on my M1 Mac mini and my intel Macbook Pro and I see "cookie" in all three browsers: Firefox 111.0.1, Safari 16.3, and Chrome 111.0.5563.110 (I've attached a screenshot of what I see). Was the expectation that the itchio game wouldn't show me the word "cookie"?
     

    Attached Files:

  7. shwhjw

    shwhjw

    Joined:
    Mar 15, 2016
    Posts:
    61
  8. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    317
    Just to help out;

    I am on Win10.0.19045 Build 19045, Firefox 111.0 and can confirm that I cannot see "cookie" but it works in Chrome.

    Error log on Firefox:

    -------- Shader Universal Render Pipeline/Lit
    -------- GLSL link error: C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call
    Warning: D3D shader compilation failed with default flags. (ps_5_0)
    Retrying with skip validation
    C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call
    Warning: D3D shader compilation failed with skip validation flags. (ps_5_0)
    Retrying with skip optimization
    C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call
    Warning: D3D shader compilation failed with skip optimization flags. (ps_5_0)
    Failed to create D3D Shaders
    --
    WebGL warning: linkProgram: Failed to link, leaving the following log: C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call Warning: D3D shader compilation failed with default flags. (ps_5_0) Retrying with skip validation C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call Warning: D3D shader compilation failed with skip validation flags. (ps_5_0) Retrying with skip optimization C:\fakepath(818,28-67): error X3067: 'int_ctor': ambiguous function call Warning: D3D shader compilation failed with skip optimization flags. (ps_5_0) Failed to create D3D Shaders
    --
    WebGL warning: drawElementsInstanced: Depth texture comparison requests (e.g. `LINEAR`) Filtering, but behavior is implementation-defined, and so on some systems will sometimes behave as `NEAREST`. (warns once)


    Error Log on Chrome:

    [.WebGL-00001DC001542A00] GL_INVALID_OPERATION: Active draw buffers with missing fragment shader outputs.


    Hope it helps.