- Home /
Performance issue: Camera.Renderer - Drawing - ... - Clear needs 50% CPU ???
Hello community,
my problem is still not solved: When using the profiler, I got this result on an android smartphone (thl 5000):
What is this process Camera.Renderer -> Drawing -> Render.OpaqueGeomentry -> RenderForwardOpaque.Render -> Clear ? It needs about 50% of CPU power in each frame. If you have any ideas or answer, please tell me, I was not able to figure this out in the last days,
jep7
PS On my other phone (honor 6) everything worked fine; the 'Clear' process mentioned above only took 0.2% of CPU.
Yep, same thing happens with me. The Camera.render usually takes the most, but 50% is a lot... Still looking for a fix, i'll tell you when i got one
Hi guys, i'm experiencing this same issue on Samsung Galaxy S6. Did either of you ever identify a potential optimisation technique?
Hi. I also meet same problem with Android Phone. In my phone, Clear need 50% of cpu. I also use VR. I use Google Cardboard, It needs 5 camera for once rendering. And clear is called 4 times. I guess it cause high cost than each camera clear his render target. But I don't know how I can fix this. How do you solve your problem? Please help me. Regards.
Answer by aditya · Nov 03, 2016 at 07:55 AM
Following shader is for UI ... Apply it to each and every UI element and let me know if you've got any better results
Shader "Custom/UI/Fast-Default"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
v2f vert(appdata_t IN)
{
v2f OUT;
OUT.worldPosition = IN.vertex;
OUT.vertex = mul(UNITY_MATRIX_MVP, OUT.worldPosition);
OUT.texcoord = IN.texcoord;
#ifdef UNITY_HALF_TEXEL_OFFSET
OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
#endif
OUT.color = IN.color * _Color;
return OUT;
}
sampler2D _MainTex;
fixed4 frag(v2f IN) : SV_Target
{
return (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
}
ENDCG
}
}
}
Hi @aditya,
Thank you for your response. In my case this shader didn't help as I only had two UI elements, for my VR reticle.
Hopefully it helps the other guys who were having problems :)
Your answer
Follow this Question
Related Questions
Terrible Lag When Starting a Scene Which Eventually Resolves Itself... Graphics Card Issue or Unity? 1 Answer
Profiling: "FFWD Lights" costs 17% performance 0 Answers
Performance spikes 1 Answer
How to solve performance issue with Camera.Renderer->Drawing ? 1 Answer
How to get OpenGL frame capture under XCode in Unity4? 0 Answers