Re: Turn off continuous rendering in Unity?
We are going to implement support for disabling "Continuous Rendering" in main cameras. That way we will render only when changes happen.
To work properly though, this feature needs Unity preserving the content of the framebuffer between frames. That's on your side, not something Noesis can control.
To work properly though, this feature needs Unity preserving the content of the framebuffer between frames. That's on your side, not something Noesis can control.
Re: Turn off continuous rendering in Unity?
I closed the ticket this without changes because they are not needed. The API already supports all scenarios. When NoesisGUI is being rendered to a main camera, as explained in the documentation, 'NeedsRendering' must be used with a manually repainted camera. Manually repainted cameras must be disabled (the Camera component, not the gameobject) and Render must be invoked when needed, for example attaching the following component:
With this component attached to a camera, our examples only render frames when strictly needed.
Code: Select all
public class Redraw : MonoBehaviour
{
void Update()
{
NoesisView view = gameObject.GetComponent<NoesisView>();
Camera camera = gameObject.GetComponent<Camera>();
if (view.NeedsRendering)
{
camera.Render();
}
}
}
-
- ttermeer-reboundcg
- Posts: 3
- Joined:
Re: Turn off continuous rendering in Unity?
Thank you for the code.
Just a precision for anyone who wants to try it, this does not work in the Unity Editor - only when build. So you need to change the script to enable the camera when you are running inside the editor
Just a precision for anyone who wants to try it, this does not work in the Unity Editor - only when build. So you need to change the script to enable the camera when you are running inside the editor
Re: Turn off continuous rendering in Unity?
Yes, thanks for that clarification. Inside the editor, if the camera is disabled nothing is rendered.
We were debating here if we should do this trick automatically: when Noesis is rendering to camera (not texture) and continuous rendering is enabled we could 'disable' the camera component and pump frames manually. But for now, we decided not to, I think it is too intrusive (changing parameters in the main camera) and probably confusing.
Also we didn't try all platforms, not sure if this trick will work everywhere.
What do you think?
We were debating here if we should do this trick automatically: when Noesis is rendering to camera (not texture) and continuous rendering is enabled we could 'disable' the camera component and pump frames manually. But for now, we decided not to, I think it is too intrusive (changing parameters in the main camera) and probably confusing.
Also we didn't try all platforms, not sure if this trick will work everywhere.
What do you think?
Who is online
Users browsing this forum: No registered users and 0 guests