Sorry, but I don’t think you understand the premise of my original question.
Visualization being a general term does not necessarily mean your specific use cases. And, no, I’m not going to render to images and caching them on a server. I’m not sure where that came from.
I have previously successfully did the exact thing on iOS, where I took control of the rendering loop callback by removing the CADisplayLink managed by Unity, and manually calling -[UnityAppController repaintDisplayLink] whenever the native UI side has updated data that requires visualization re-render, thanks to the fact that Unity ships their native shims in source code form. That change is crucial, because even with OnDemandRendering on the Unity side, without any manual code changes on the native side, Unity would still be requesting the screen to refresh at frame rate, even though redraws are skipped on the Unity side per renderFrameInterval, so the CPU cannot rest when the user has no input on the app or does not change the data that would invalidate the visualization. The power consumption level becomes unacceptable for a viewer/editor app that for most of its runtime is sedentary.
Unity being a “realtime renderer” doesn’t really matter here, since user won’t be directly interact with the Unity view itself, so if Player Loop does not have to run, then it shouldn’t run to not prevent the CPU from resting due to unnecessary work.
// This is where Unity re-renders the screen. Copied straight from the Xcode project.
- (void)repaintDisplayLink
{
if (!_didResignActive)
{
UnityDisplayLinkCallback(_displayLink.timestamp);
[self repaint];
}
}
I have examined the JavaScript shims that Unity ships for WebGL player, and I’m not seeing anything similar, hence my question directed to Unity WebGL staff.
Unity utilizes Window.requestAnimationFrame() browser API to sync with the display. This API will cause the browser to prepare a repaint of the webpage content, and how much overhead a call of this wastes when no repaint is actually necessary is entirely up to the browser’s implementations, and I’d assume in worst conditions everything will be repainted, hence the aforementioned power consumption issue.
If you say that by calling Window.requestAnimationFrame(), Unity will not cause the webpage to redraw, then I’d like to see where you get that information from.