Search Unity

Bug Errors in console when selecting objects on scene

Discussion in 'Visual Effect Graph' started by Qriva, Oct 11, 2021.

  1. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    Currently I am not 100% sure if this is bug or maybe I did something that is not allowed.
    When I select object on a scene (actually when I click inside scene view), every time I do this there are errors in console like this:

    upload_2021-10-11_16-19-46.png
    I couldn't notice any harmful things yet, it just spams the console.
    This happens only during playmode (and I guess only in editor). I have no repro steps yet, but from my observation it happens when there are active enemies with VFX. Also from the message this might be related to the fact I use "_MainTexture" property name in shader, is this not allowed? (ironically, error says I should)
     
  2. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Hey @Qriva ,

    I might be wrong, but I think Sprite Render components (and maybe others) need the reference name of your exposed Texture to be specifically "_MainTex", because it is hard-coded to look for it. Could it be something like this?
     
  3. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    There are no sprite renderers on my scene I think, but this is right there are hardcoded _MainTex here and there, I remember one from UI shaders for example. The problem is it comes from VFX for sure, because when enemies are dead it stops appear in console.
    Furthermore, as you can see it comes from output of system with name "Circle Flare" and shader used there uses _MainTex as property name:
    upload_2021-10-12_6-31-36.png
    This is very strange, it says "please use _MainTex", but it's already there - can't check it now, but I guess it might even cause error itself.
     
  4. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    How are you having Blend Mode visible when using a VFX ShaderGraph?
    Unless I'm drawing a blank, I believe the Shadergraph should override all Output properties and Enums are not supported for you to have implemented this on your own. Might be something strange happening half-way between an Output and a ShaderGraph.
     

    Attached Files:

  5. Qriva

    Qriva

    Joined:
    Jun 30, 2019
    Posts:
    1,314
    [visible confusion]

    Um, it was there from some time xD. I mean there are no blend options in shader graph and it looked intentional as there is opaque in dropdown too, plus it works (blend) correctly unlike normal URP shaders.
    In any case this is not something I made - my unity version 2020.3 with 10.7 packages.
     
  6. VladVNeykov

    VladVNeykov

    Unity Technologies

    Joined:
    Sep 16, 2016
    Posts:
    550
    Ah, my bad, it's the original Shadergraph integration (I spend time on the newest versions so haven't seen that in some time :D) In 2021.2 onwards it's a bit different and way better :)

    Right, I tried it in 10.7 and indeed it looks like it doesn't like _MainTex as a name (for transparent particles).

    It looks resolved in the new ShaderGraph integration I mentioned, and even in 10.x if you rename _MainTex to anything else, the issue no longer reproduces.

    Please let me know if this has some blocking point that cannot be resolved with the rename.
     
    Qriva likes this.