Disable render targets, half draw calls, see no difference

Hi all

So when using the inspector , in the debug tab if i toggle render targets to off , i notice in the statistics it halfs* the draw calls but I see no visual change in the scene. ( in the real time perf viewer the same reduction can be seen in the counts )

I dont know what a render target is exactly , I can only think it is a render texture? I am using post process effects.

Is this just a false report in the inspector?

Obviously if this is really something that can be disabled and is really making draw calls half while having zero visual change in the scene i would want to use it in the app…

but then im thinking why? Why would this even be the situation in the first place. What are these render targets? what are they doing that doubles the draw calls?

(* not exactly half but very close , from 160 to 82 )

Do you mean the dynamic render target texture for shadows etc.?

Can you still see shadows after turning of the render target? I remember the default shadow generator doubles draw calls. It seems to match your description.

I found this example. After turning off render target, the reflected sphere on the render target texture doesn’t update anymore when you move the camera.

And turning off it will stop updating shadow casted by animated model.

2 Likes

i dont even have any shadows enabled , I have an environment map and one point light and some post effects. SSAO, color curves , vignette etc… I didnt see anythnig dissapear or change … let me double check , i will be back later

Inspired by this post, I am curious if the following could be a valid approach to optimize by reducing draw calls:

For static meshes, the shadow can be updated once on demand when light position is changed.
For animated meshed, a separate shadow map texture can be used to keep updating.

An example PG: two shadow generators are created and thus two shadow map texture instances can be found in the inspector: Dude PG with 2 shadow textures

In my case, I have many different houses, castle building blocks, trees, rocks etc, so I have a higher number of draw calls say 60. I have less number or animated meshes that incurs 40 draw calls. If I use a single ShadowGenerator, I would have (60 + 40) * 2 = 200 draw calls.

If I can “freeze” the shadow texture update for static meshes, and let animated models cast shadows on the other texture. Will the draw calls be reduced to 60 + 40 * 2 = 140?

Is it possible to disable shadow map texture per texture instance? For example, how can I make one of the shadows in the dude PG above to stop animate?

@ super idols: @sebavan @Evgeni_Popov

i went and tested again , I see zero change in the scene and can still navigate , but draw calls are half and it is not just incorrect numbers because the actual fps does increase significantly after the draw calls are halved when using a dedicated chip rendering the scene.

It must be post process related im sure. Im pushing to get aother stuff finished , I have deadlines and going into hospital for surgery in a week , so until i have time to dig deeper i cant make PG repos etc.

I will come back to it when I have time but it is rather a serious one I wont forget because this has a big impact on performance on lower end devices. halving the draw calls with no visual change…

You can use the refreshRate property of the render target texture:

Probably if you are not using shadows/layers. If you can make a PG at some point it would help us knowing which subsystem is impacted by the RTT rendering disabling.

3 Likes

Cool. Draw call is reduced from 16 to 11. :grin: