Verge3D active even if window loses focus

Home Forums General Questions Verge3D active even if window loses focus

This topic contains 2 replies, has 2 voices, and was last updated by D3Pixel D3Pixel 4 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #17831
    D3Pixel
    D3Pixel
    Licensee

    Hi

    I just noticed that my GPU was running flat out even though the Verge3D browser tab was not in focus or the active application.

    Shouldn’t it automatically disable the renderer when the browser or tab loses focus to save battery power on mobile devices?

    Thanks

    3D Animation and Web3D services - www.d3pixel.co.uk

    #17832
    Yuri Kovelenov
    Yuri Kovelenov
    Developer

    Hi,

    You can detect if a tab is visible using onblur/onfocus events, and stop or resume the rendering accordingly. To make this work, add the following lines to the runCode function of your application js file:

    See more on using JavaScript here
    https://www.soft8soft.com/docs/manual/en/introduction/Using-JavaScript.html

    3D Verger, the CEO
    LinkedIn | FB | Twitter | VK | 新浪微博

    #17847
    D3Pixel
    D3Pixel
    Licensee

    Thanks for the quick answer Yuri

    3D Animation and Web3D services - www.d3pixel.co.uk

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.