When I enable shadows of direction light,the vertexs and triangles is three times compares to that without shadows,that is why,I think it should be two times
Because when you enable shadows on the first directional light it now renders the scene at least 3 times, more if you’re using cascades.
Two of the times are obvious if you have a basic understanding of real time rendering, the shadow map and rendering to the screen, which is what you’re probably expecting.
However Unity’s directional shadows work by rendering the scene depth to a texture (the camera depth texture) and then rendering the shadows casting onto that depth texture. When using the forward rendering path, the depth texture is generated by rendering the scene depth to a texture prior to the final forward pass. In the past this let them do a screen space blur on the shadows to soften them, but today they just do a better job of sampling the shadows so it’s not needed for that, but it still lets them reduce the number of the shader permutations needed, and can be faster.
Optionally directional shadows can use cascades, which renders multiple shadow maps at different ranges around the camera. This means higher quality shadows at significantly lower resolution, but it also means some objects can get rendered in every cascade.
I suggest you try using the frame debugger and step through the rendering of a frame. It’s great for getting a better understanding of what’s happening.
Thanks man,I will check the frame buffer now