• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Sagan200 · Aug 24, 2020 at 05:18 PM · shadermaterialrenderer

materials turn pink after changing render pipeline asset

Hello,

I already red many different threads in this forum or elsewhere and I can't find a real solution. My problem is, I want to make a glowing outline, so I followed some tutorials and started using URP. This works so far, but if I change the Standard Shader Asset in the Graphics tab of my project settings, the Particle-systems I used got pink. I found out that this is because their is missing some references to the material, so I looked up and the material the particle system uses is the Default-Particle System. This material uses the standard unlit shader. How can I fix this, so I can use the Standard Shader from unity like before and my own which I created. I already tried Upgrade Project materials to URP materials. But I get the following error:

Outline_Material material was not upgraded. There's no upgrader to convert Shader Graphs/Outline_Shader shader to selected pipeline

To clarify, I just started working with shader. Just for a glowing outline effect. I called the shader Outline_Shader and the material which uses the shader Outline_Material. I want to add this material to all sprites which should have an glowing outline. Thats my idea in theory. I know this sort of questions have been posted several times, but I can't find any solution thats working.

alt text

edit: I just tried everything in a completly new project. I installed URP, add the asset in the project settings under graphics and the particle material changed to pink. Everything seems right, following other tutorials. But the next step (edit > RP > URP > Upgrade material) will not change anything.

unbenannt.png (242.3 kB)
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image MerpysoupStudio · Aug 24, 2020 at 07:59 PM 0
Share

You will likely need to rewrite this shader in a urp compatible way and then upgrade materials, but don't forget a backup before you make big changes like changing the render pipeline.

avatar image Sagan200 MerpysoupStudio · Aug 24, 2020 at 08:06 PM 0
Share

Thanks for the fast answer. But how can I do this?

avatar image MerpysoupStudio Sagan200 · Aug 25, 2020 at 01:53 PM 0
Share

I would recommend removing the shader from your project, keeping it somewhere else, upgrading materials and then re-importing the shader after it is back to normal.

4 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Aviryx · Aug 25, 2020 at 04:16 PM

(This material uses the standard unlit shader) How can I fix this, so I can use the Standard Shader from unity like before and my own which I created.


The Built-In Render Pipeline and Scriptable Render Pipeline (URP/HDRP/Custom) are incompatible. This means you can not just mix and match different things from different pipelines. SRP fundamentally changed a lot of things. This is one of the reasons Unity is so persistent on pushing people to use ShaderGraph instead of writing custom HLSL as they keep changing it (only recently did URP get realtime support for shadows on point lights)


The only conceivable way to do what you want is to either


1) Redo your work in a single pipeline 2) Create your own customer shader that matches the Standard Shader (which is pretty hard as Unity keeps changing the names of stuff and there is not much to go on in therms of reference)


The problem that you will run into is that Unity has changed the names for various things in URP/HDRP so you are going to have to frankenstein a shader together if you want it to work.


URP Shader Template


https://gist.github.com/phi-lira/225cd7c5e8545be602dca4eb5ed111ba


Standard Unlit Shader


 Shader "Particles/Standard Unlit"
 {
     Properties
     {
         _MainTex("Albedo", 2D) = "white" {}
         _Color("Color", Color) = (1,1,1,1)

         _Cutoff("Alpha Cutoff", Range(0.0, 1.0)) = 0.5

         _BumpScale("Scale", Float) = 1.0
         _BumpMap("Normal Map", 2D) = "bump" {}

         _EmissionColor("Color", Color) = (0,0,0)
         _EmissionMap("Emission", 2D) = "white" {}

         _DistortionStrength("Strength", Float) = 1.0
         _DistortionBlend("Blend", Range(0.0, 1.0)) = 0.5

         _SoftParticlesNearFadeDistance("Soft Particles Near Fade", Float) = 0.0
         _SoftParticlesFarFadeDistance("Soft Particles Far Fade", Float) = 1.0
         _CameraNearFadeDistance("Camera Near Fade", Float) = 1.0
         _CameraFarFadeDistance("Camera Far Fade", Float) = 2.0

         // Hidden properties
         [HideInInspector] _Mode ("__mode", Float) = 0.0
         [HideInInspector] _ColorMode ("__colormode", Float) = 0.0
         [HideInInspector] _FlipbookMode ("__flipbookmode", Float) = 0.0
         [HideInInspector] _LightingEnabled ("__lightingenabled", Float) = 0.0
         [HideInInspector] _DistortionEnabled ("__distortionenabled", Float) = 0.0
         [HideInInspector] _EmissionEnabled ("__emissionenabled", Float) = 0.0
         [HideInInspector] _BlendOp ("__blendop", Float) = 0.0
         [HideInInspector] _SrcBlend ("__src", Float) = 1.0
         [HideInInspector] _DstBlend ("__dst", Float) = 0.0
         [HideInInspector] _ZWrite ("__zw", Float) = 1.0
         [HideInInspector] _Cull ("__cull", Float) = 2.0
         [HideInInspector] _SoftParticlesEnabled ("__softparticlesenabled", Float) = 0.0
         [HideInInspector] _CameraFadingEnabled ("__camerafadingenabled", Float) = 0.0
         [HideInInspector] _SoftParticleFadeParams ("__softparticlefadeparams", Vector) = (0,0,0,0)
         [HideInInspector] _CameraFadeParams ("__camerafadeparams", Vector) = (0,0,0,0)
         [HideInInspector] _ColorAddSubDiff ("__coloraddsubdiff", Vector) = (0,0,0,0)
         [HideInInspector] _DistortionStrengthScaled ("__distortionstrengthscaled", Float) = 0.0
     }

     Category
     {
         SubShader
         {
             Tags { "RenderType"="Opaque" "IgnoreProjector"="True" "PreviewType"="Plane" "PerformanceChecks"="False" }

             BlendOp [_BlendOp]
             Blend [_SrcBlend] [_DstBlend]
             ZWrite [_ZWrite]
             Cull [_Cull]
             ColorMask RGB

             GrabPass
             {
                 Tags { "LightMode" = "Always" }
                 "_GrabTexture"
             }

             Pass
             {
                 Name "ShadowCaster"
                 Tags { "LightMode" = "ShadowCaster" }

                 BlendOp Add
                 Blend One Zero
                 ZWrite On
                 Cull Off

                 CGPROGRAM
                 #pragma target 2.5

                 #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
                 #pragma shader_feature_local _ _COLOROVERLAY_ON _COLORCOLOR_ON _COLORADDSUBDIFF_ON
                 #pragma shader_feature_local _REQUIRE_UV2
                 #pragma multi_compile_shadowcaster
                 #pragma multi_compile_instancing
                 #pragma instancing_options procedural:vertInstancingSetup

                 #pragma vertex vertParticleShadowCaster
                 #pragma fragment fragParticleShadowCaster

                 #include "UnityStandardParticleShadow.cginc"
                 ENDCG
             }

             Pass
             {
                 Name "SceneSelectionPass"
                 Tags { "LightMode" = "SceneSelectionPass" }

                 BlendOp Add
                 Blend One Zero
                 ZWrite On
                 Cull Off

                 CGPROGRAM
                 #pragma target 2.5

                 #pragma shader_feature_local _ALPHATEST_ON
                 #pragma shader_feature_local _REQUIRE_UV2
                 #pragma multi_compile_instancing
                 #pragma instancing_options procedural:vertInstancingSetup

                 #pragma vertex vertEditorPass
                 #pragma fragment fragSceneHighlightPass

                 #include "UnityStandardParticleEditor.cginc"
                 ENDCG
             }

             Pass
             {
                 Name "ScenePickingPass"
                 Tags{ "LightMode" = "Picking" }

                 BlendOp Add
                 Blend One Zero
                 ZWrite On
                 Cull Off

                 CGPROGRAM
                 #pragma target 2.5

                 #pragma shader_feature_local _ALPHATEST_ON
                 #pragma shader_feature_local _REQUIRE_UV2
                 #pragma multi_compile_instancing
                 #pragma instancing_options procedural:vertInstancingSetup

                 #pragma vertex vertEditorPass
                 #pragma fragment fragScenePickingPass

                 #include "UnityStandardParticleEditor.cginc"
                 ENDCG
             }

             Pass
             {
                 Tags { "LightMode"="ForwardBase" }

                 CGPROGRAM
                 #pragma multi_compile __ SOFTPARTICLES_ON
                 #pragma multi_compile_fog
                 #pragma target 2.5

                 #pragma shader_feature_local _ _ALPHATEST_ON _ALPHABLEND_ON _ALPHAPREMULTIPLY_ON _ALPHAMODULATE_ON
                 #pragma shader_feature_local _ _COLOROVERLAY_ON _COLORCOLOR_ON _COLORADDSUBDIFF_ON
                 #pragma shader_feature_local _NORMALMAP
                 #pragma shader_feature _EMISSION
                 #pragma shader_feature_local _FADING_ON
                 #pragma shader_feature_local _REQUIRE_UV2
                 #pragma shader_feature_local EFFECT_BUMP

                 #pragma vertex vertParticleUnlit
                 #pragma fragment fragParticleUnlit
                 #pragma multi_compile_instancing
                 #pragma instancing_options procedural:vertInstancingSetup

                 #include "UnityStandardParticles.cginc"
                 ENDCG
             }
         }
     }

     Fallback "VertexLit"
     CustomEditor "StandardParticlesShaderGUI"
 }

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Sagan200 · Aug 29, 2020 at 03:35 PM

Hello guys. I just solved this problem with a friend and created a material with a shader based on the URP and added a texture to this material which comes close to the original particle system texture. Thanks for your help guys. This thread can be closed, if Threads are getting closed here.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MrDude · Mar 31, 2021 at 12:58 PM

@Aviryx I still want to know why my material, that works fine as a Unity Standard material, when I click on the menu option to convert it from Unity Standard to URP it then makes my material show only pink. Why is that? I thought Standard to URP/Lit was allowed so.... why is it doing that?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Symo7 · Jul 12, 2021 at 01:28 PM

I got this when converting from standard to URP materials - all I had to do was:

  1. Edit -> Render Pipeline -> Upgrade Materials...

  2. Create (in Project tab) Rendering -> URP -> Pipeline Asset (Forward Renderer)

  3. Project Settings -> Graphics -> Set 'Scriptable Render Pipeline Settings' to the settings created in 2

  4. Project Settings -> Quality -> Do the same as 3 for the 'Rendering' settings.

Gradually the pink materials got sorted (clicking on them makes them refresh).

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

219 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Changing two different objects renderer colour 1 Answer

How Do I Partially Change The Material of An Object On Collision? 1 Answer

Changing Shaders HDR Color results in different Color. 1 Answer

Is there any way to create a dynamic material when no materials have been compiled? 2 Answers

Reduce Skid Mark Alpha Gradually 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges