gui draw calls from disabled camera?

Hi,

I have a camera in my scene, which is responsible for the GUI only. I set up the GUI in the OnGUI methode. The camera is disabled and I render it manually when there is a change in the GUI. I thought, I can save draw calls, if I render the GUI this way right into a render texture and apply only this texture to the main camera. But now I notice a permanent increase of draw calls, if I open a menu. Is the Unity GUI causing draw calls also if the camera is disabled?

The disabled camera shouldn’t be involved in the rendering at all. Can you post the code that opens the menu?

you don’t save a single drawcall actually as you render the gui, you just render it to another texture which in consequence means you actually add a drawcall + add the overhead of the fillrate hunger of a fullscreen overdraw.

Also, ensure that you disable the gameobject on which you have the guiscript when you disable the gui camera so it no longer executes as well. (its overhead is not rendering unless we talk about iOS, its real overhead is the calls to the function itself)

By searching with google and reading the forum I found out, that any GUI Boxes and Labels inside OnGUI() are not rendered into a render texture. Is that right?

@dreamora
The idea is to render the GUI once in a texture and then draw only one texture in any further frame instead of x buttons.

If I have an empty scene, disable the camera component of the main camera and add a script like the following, then I will see the GUI element, if I hit the play-button.

function OnGUI () {
	GUI.Box(Rect(30,10,100,20), "Hallo");
}

This is normal behaviour?