- Home /
Transparent shader decreases frame rate. Which material i should use for transparent object?
Hello,
I use transparent shader for displaying shadows of objects in my scene. I didn't use unity's shadows because of too much lag that it create. Besides of transparent shader, i also use transparent texture. The shader that i use, is Standart > Fade shader. When i look Profiler, i see spikes of Camera.Render. I googled it and i found that it happens because of transparent objects. I would like to know which shader i should use for transparent object? Which one would be the correct shader for a lagless game?
Answer by mfahadi · Aug 26, 2015 at 12:42 PM
I had same problem in a project, transparent Shaders are costly. I managed to solve this problem by using Unity built in Particles Shaders. They donot provide the best quality but as you are going to display some shadows so It will work fine for you,
That sounds great mfahadi. How can i use particle shaders? I haven't used them before and if it's possible, could you suggest me a source, please?
I am talking about Unity built in Particle Shaders. Just use this shader "Particles > Additive" or if you are building for mobile then use this "$$anonymous$$obile > Particles > Additive". Sorry I don't know if it is documented any where or not. But it will work for you.
Thanks mfahadi. I have figured out how it works. One more question. Additive doesn't show the shadow texture that i added the shader. But the rest of shaders in $$anonymous$$obile>Particles works great. If i use one of the other shader in $$anonymous$$obile > Particles, does them decreases my framerate too much like the transparent shader does?
I have not worked with shadows so can't really tell what might be the problem with that. No, Unity built in $$anonymous$$obile shaders are great, they don't effect performance so feel free to use any there in $$anonymous$$obile > shaders, I will suggest always use a shader form $$anonymous$$obile Shaders if available.
Thank you so much mfahadi. Now i am working on them. That was the exactly answer that i was looking for about shaders.
Answer by kingcoyote · Aug 25, 2015 at 05:39 PM
Your best bet is to go back to the Unity inbuilt shadows and to tweak the quality settings. Trying to rig up your own shadows is going to cause much more frustration than it's worth.
You can to to Edit -> Project Settings -> Quality to set the quality level.
A lower level, like "Fastest" gives good framerate, but removes some of the nicer looking graphic settings. A higher level, like "Fantastic" looks great, but is sluggish on mobile or older machines.
You can read more about quality settings in the Unity manual: http://docs.unity3d.com/Manual/class-QualitySettings.html
Answer by bekiryanik · Aug 25, 2015 at 08:19 PM
I have already tried to use them but it decreases more frame rate then the shadow i draw. I believe that i can fix the frame rate if i use the correct shader for transparent object. But which one will be that transparent shader. That's the question.
Your answer
Follow this Question
Related Questions
Material.SetOverrideTag seems to be broken for changing RenderType at least. 0 Answers
How to make make an object look like an Opaque but still have Alpha fading effect? 1 Answer
How do I properly apply a transparent texture to a mesh? 2 Answers
How to prevent shader overlap in LWRP Shadergraph. 0 Answers
Alpha in texture showing up white in scene with unlit/transparent shader 1 Answer