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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Standard cutout shader working in editor, not in build.

Discussion in 'General Graphics' started by hypnoslave, Jan 11, 2022.

  1. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    428
    Hey all. Just updated to Unity 2021.2.7f1. I've got some materials using the standard shader, set to cutout mode. It looks fine in the editor but in the build, there's no transparency.

    Worked fine before updating the editor.

    Observe these little pixel candles:
    upload_2022-1-10_21-24-10.png

    Any idea?
     
    Itsuchi2 likes this.
  2. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    428
    updated - i included the standard shader in the always included list in the project settings. it took 20 minutes to build all the variants, and it still doesn't work.
     
  3. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    428
    Another update.

    Created a blank project - cutout shader working. Moving over my assets in clumps by exporting packages, to the new proejct... and building. new project still works.

    i have no idea what is going on.

    maybe I'll delete my shader cache!?
     
    Last edited: Jan 11, 2022
  4. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    428
    FOUND IT!!!

    When upgrading from unity 2020.2 to 2021.2, Unity just said "Hey there I see that you're using the built-in render pipeline, but I'm going to go ahead and add the shader graph to your project anyway because F*** you."

    Removing the shader graph from the project fixed this problem.
     
    id0, Gozum, StellarVeil and 12 others like this.
  5. NerdOne

    NerdOne

    Joined:
    Aug 3, 2021
    Posts:
    5
    Thank you, same issue and same solution here.
    What a waste of time...
     
    hypnoslave likes this.
  6. holdingjason

    holdingjason

    Joined:
    Nov 14, 2012
    Posts:
    135
    YOU HAVE GOT TO BE KIDDING ME. Thank you, trying to do a build for the last 5 hours and you just saved my bacon. Not sure how I would have ever found this. Unity WTF.
     
    TigerHix and hypnoslave like this.
  7. hypnoslave

    hypnoslave

    Joined:
    Sep 8, 2009
    Posts:
    428
    Hey! Glad one of my many post-a-question-and-answer-it-myself posts actually helped someone for once.
     
    PNUMIA-Rob likes this.
  8. jessebarker

    jessebarker

    Unity Technologies

    Joined:
    Dec 13, 2016
    Posts:
    6
    To clarify, you are not being given the option to opt out of the addition of the Shader Graph package when upgrading to 2021.2? That definitely doesn't sound correct to me. Would you mind filing a bug on this?
     
  9. Deleted User

    Deleted User

    Guest

    in editor.jpg inbuild.jpg Getting same thing. cutout not working on build. shows the right way in the editor. 2/8/2022 using 2021.2.9f1 on windows pc.
     
  10. Itsuchi2

    Itsuchi2

    Joined:
    Jan 17, 2022
    Posts:
    2
    How do I remove the Shader Graph without creating a new project? This is sooo stupid! I've been working on my game for more than 2 years now and had to delay my new trailer because of this same issue! Been trying to resolve for about 3 hours now. It would probably permanently break my game if I try to port over 2 years worth of work into a new project.
     
  11. Itsuchi2

    Itsuchi2

    Joined:
    Jan 17, 2022
    Posts:
    2
    Fixed. Original poster was correct. Shader Graph f*cks everything up. I found a way to successfully remove the package without creating a new scene. Though it throws a few errors in the console, though all are harmless and do not affect game or build.

    1) Remove the code as shown in the provided images from the manifest and packages-lock json files located in your project/Packages folder and save both.

    2) Locate "Shader Graph" in the Unity editor's Packages drop down list and click "Open File Location".

    3) Delete the shader graph package folder.

    Unity team, PLEASE make the shader graph package removable from package manager window. We DO NOT want that ish and it's messing our projects. Thank you!
     

    Attached Files:

    FaizanBashir and zedz like this.
  12. doomcityofkings

    doomcityofkings

    Joined:
    Apr 11, 2020
    Posts:
    7
    omg I had my project built on HDRP and then I found how miserable that was so I turned back to standard and then I found that problem too until I dropped here to find how miserable unity is
     
  13. majidarif

    majidarif

    Joined:
    Sep 11, 2015
    Posts:
    26
    I am experiencing this too, but what do I do if I want to keep shader graph?
     
  14. SalvoSoftware

    SalvoSoftware

    Joined:
    Feb 4, 2013
    Posts:
    9
    Happened to me as well, but I did a different thing... I removed Visual Effects Graph from Package Manager (had Shader Graph as dependency) and that made cutout materials working again!
     
    LaurieAnnis likes this.
  15. AFriendlyUnityDeveloper

    AFriendlyUnityDeveloper

    Joined:
    Dec 26, 2018
    Posts:
    32
    Oh wow, add me to the list of people who banged their head against this for hours before finding this thread. It took a lot of google searches before this popped up.

    I didn't realize that shader graph breaks cutout shader in builtin pipeline. Is this intended? Is there a way I can use both or am I just out of luck here?

    Keywords for anyone googling in the future: Works in editor but not build, cutout shader, missing objects
     
    TigerHix likes this.
  16. MixxusStudio

    MixxusStudio

    Joined:
    May 9, 2014
    Posts:
    50
    Try Fade instead of Cutout. Worked in version 2022.1.3 when tested building to default Windows standalone. Using Standard shader and keeping Shader Graph package.
     
    caspertaroflatponies likes this.
  17. scyxiaoh

    scyxiaoh

    Joined:
    Dec 20, 2016
    Posts:
    1
    Is Unity going to fix this? Seems like it makes us to choose between build-in standard shader and Shader Graph.
     
  18. SamRock

    SamRock

    Joined:
    Sep 5, 2017
    Posts:
    250
    Thank you so much for saving my time, lot of frustration and 100s of dollar! Yes, I am using GAIA 2021 and when I reported this to the developer , they told me that if I want further support I have to buy their really expensive GAIA PRO 2021. :D

     
    Last edited: Aug 5, 2022
  19. doodlinbee

    doodlinbee

    Joined:
    Feb 15, 2020
    Posts:
    22
    I have the same problem but I actually use shader graph so I don't know what to do
     
  20. Foulancer

    Foulancer

    Joined:
    Aug 1, 2014
    Posts:
    4
    Thanks, this seems to work (Unity 2021.3.6f1 while using Shader Graph in BRP)
     
  21. Revae

    Revae

    Joined:
    Nov 16, 2013
    Posts:
    3
    Yeah, I use the shader graph and the standard shader with cutout and this is aggravating. Just throwing my complaint into the pile so the issue is noticed.

    edit: I just made a shader with the shader graph that uses the cutout rendering mode. Renders normal in-game. Seems to be fine, except that it's over-bright which I compensate for a bit in the graph...
    It's a band-aid, but it works.
     
    Last edited: Aug 12, 2022
  22. LaurieAnnis

    LaurieAnnis

    Joined:
    Jan 24, 2010
    Posts:
    63
    Found this thread because my Standard Cutout materials weren't working in WebGL build but were working fine in editor. I would rather not have to remove Shader Graph, so I switched to Fade, but my understanding is it's less performant than Cutout so I hope this is fixed soon.
     
  23. mmakivic

    mmakivic

    Joined:
    Jul 20, 2017
    Posts:
    1
    I am having this exact same issue, and so far none of the workarounds have fixed it for me. If I remove shadergraph, my IL2CPP mobile build starts throwing errors.
     
  24. zedz

    zedz

    Joined:
    Aug 31, 2013
    Posts:
    233
    This has been messing with my builds for months, today I finally wanted to spend time to come to the bottom of it.
    long story short, yes
    Removing shader graph fixed this issue for me as well :rolleyes::D

    I was sidetracked cause of the message in the editor build log

    Shader error in 'Particles/Standard Surface': Internal error communicating with the shader compiler process. Please report a bug including this shader and the editor log.

    Assuming this was related to the particles/standardsurface cutout shader not working in the build, but no it was shadergraph, now it works, though the above error message is still there
     
  25. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    Bump this... This bug is egregious... Removing URP fixed the error for me.
     
  26. OccaSoftware

    OccaSoftware

    Joined:
    May 24, 2019
    Posts:
    29
    I understand this issue is still occurring.
    1. When importing Shader Graph from the Unity Package Manager into a project using Built-In Render Pipeline, the Editor + Game View on the Unity Editor looks fine.
    2. If you build the project, the Alpha Cutout stops working.
    @Unity,
    • Is there a reason this issue occurs?
    • Is there a recommended workaround?
    • Is there a planned fix in an upcoming release?
     
    LaurieAnnis and TigerHix like this.
  27. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    Pinging @jessebarker who replied to this thread. I know Unity has to deal with thousands of issues every day, but this one should be a high priority issue. This basically made it impossible to have a game that supports both URP and legacy pipeline.
     
    LaurieAnnis likes this.
  28. adamgryu

    adamgryu

    Joined:
    Mar 1, 2014
    Posts:
    171
    I started using the Shader Graph with an old built-in pipeline project, now that it supports the built-in pipeline. I was going crazy trying to figure out why this old shader was no longer working. I'll have to stop using the shader graph for now.
     
    TigerHix likes this.
  29. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    outside_visitor and Tony_BG like this.
  30. dragonalumni

    dragonalumni

    Joined:
    Jun 25, 2021
    Posts:
    31
    I got hit by this add 2 more days of head scratching due to a Unity bug. The one just before this was TMPro GUI and standard fighting over ztest if they share materials.. Really annoying stuff here.
     
  31. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    Sadly the fix didn't make it to 2021.3.14f1... Hope next minor version will fix it, this is really a release blocker. :(
     
  32. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    Hey, can any @Unity staff confirm why the issue is now under consideration again for 2021.3.x? It was under review just a few days ago.

    upload_2022-11-29_18-3-6.png

    We need this fix *desperately* and very unhappy to see the status rolled back to under consideration. 2022.x versions are far too unstable for us to upgrade. Any insights into why?
     
  33. catfink

    catfink

    Joined:
    May 23, 2015
    Posts:
    175
    Is Unity seriously saying for it's latest LTS release that you have to chose now - shader graph or cut out shader, pick one as you can't have both? Making me seriously wonder what LTS is about if this is the case.
     
    Sluggy likes this.
  34. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    Asked customer support. Got this response:

    Hi, The fix will be backported to the 2021.3 stream, but developers are waiting for another fix first, so that it can take some time.

    Which is good to hear - at least it is getting fixed! But how long? Well. *shrugs*
     
    catfink likes this.
  35. unity_1A8C24A0E9A2FCC2A46C

    unity_1A8C24A0E9A2FCC2A46C

    Joined:
    Jan 28, 2022
    Posts:
    3
    This is off topic but Heeyy are you "The Last Hero Of Nostalgia"'s Developer?? I recognized the game by picture. I played your game on Steam and want to say that your game is very amazing and fun :D I can't believe I found a question from the developer of a game I liked. Never mind, it just always seems to me that the developers of my favorite games are always something far and unattainable
     
    TigerHix likes this.
  36. Roan-Albers

    Roan-Albers

    Joined:
    Jan 28, 2013
    Posts:
    9
    Glad I found this thread, wow haha, speechless. I couldn't for the life of me figure out why certain materials didn't properly work. Thanks all! Can confirm that setting 'Cutout' to 'Fade' works.
     
  37. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    152
    What the F*** lol. Welp, following
     
  38. jonm1999

    jonm1999

    Joined:
    Feb 2, 2019
    Posts:
    1
    I'm so annoyed with this bug. I just spent 3 days trying to fix it. I've heard a lot of people say to remove Shader Graph. The problem with that is I need Shader Graph for certain effects in my project to work. The solution that worked for me was to install and convert all my materials from built in render pipeline to URP. I also ran into some errors while converting everything to URP so I had to remove my entire Library folder and restart Unity. Finally after several headaches I have Shader Graph AND URP installed and cutout is finally working.
     
  39. nicolasdemauroy

    nicolasdemauroy

    Joined:
    Nov 11, 2020
    Posts:
    16
    Merry Christmas to you all.

    Hi, I have exactly the same problem for my (first) Unity game to be released end of march 2023, and I plan to participate in Steam fests from late Jan. So I assume the proper fix will arrive too late. I am looking for a risk-less fix

    I need advice from experienced developers here. Is removing Shader Graph reversible ?

    I tried putting my textures my Material to Fade instead of cutout, and while it fixes the cutout issue, I have the problem that the plants 'emit' light at night (more precisely, they are behind a wall and there is a light on the other side of the wall, so it should be in the shade of the wall, but this somehow does not work). I would appreciate any suggestion how to fix that.
     
  40. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    This issue will probably fixed in 2021.3.17f1 (according to the issue tracker), which should be released on Jan 2nd. I also have a project pending release exactly because of the same bug, so let's hope it gets fixed ASAP :/
     
    LaurieAnnis likes this.
  41. TigerHix

    TigerHix

    Joined:
    Oct 20, 2015
    Posts:
    68
    I finally found a workaround. It's an ugly fix, but it's better than waiting for Unity's patch that may or may not come on Jan 2nd. You can use a third-party shader that supports the cutout rendering mode that does not depend on Unity's standard cutout shader. For me, the toon shader lilToon (Rendering Mode = Cutout) worked because I am looking for flat/anime look anyway. I wrote some code that basically set every cutout material to use lilToon's cutout shader at runtime (for build, you will have to include "Hidden/lilToonCutout" in the "Always Include Shaders" list in the graphic settings). Sure there are some performance implications, but it's much better than cutout materials not working at all. ;)
     
    TaylorCaudle likes this.
  42. animap

    animap

    Joined:
    Jul 1, 2018
    Posts:
    2
    for removing Shader Graph from your project, just find it in the PackageManager and press remove!
     
    LaurieAnnis likes this.
  43. Myterian

    Myterian

    Joined:
    Apr 11, 2014
    Posts:
    1
    Just had the same problem and upgraded to 2021.3.19f1 and it works now out of the box
     
  44. AFriendlyUnityDeveloper

    AFriendlyUnityDeveloper

    Joined:
    Dec 26, 2018
    Posts:
    32
    LaurieAnnis likes this.
  45. TaylorCaudle

    TaylorCaudle

    Joined:
    Feb 8, 2018
    Posts:
    152

    Confirmed to be working with ShaderGraph installed on Built-In as well?
     
  46. AFriendlyUnityDeveloper

    AFriendlyUnityDeveloper

    Joined:
    Dec 26, 2018
    Posts:
    32
    Yes, this is exactly my setup. Did not work before, now it does work.
     
    LaurieAnnis likes this.
  47. unity_028AE3B1F1BC5DECE8AD

    unity_028AE3B1F1BC5DECE8AD

    Joined:
    Jul 31, 2022
    Posts:
    89
    Ahh, another bug. Spending more time debugging unity than my own buggy project nowadays. Unity will end up having more bugs than the amazon forest. Can't even remove shader graph from my project as it just keeps coming back.