Jump to content

Efficiently downloading rendered image


photo

Recommended Posts

Posted

Hi,

what's the best way to go about rendering for playout in a broadcast application?

We need to do two things: 1) Render a full scene that we can then download to the CPU and 2) Show a preview of this scene on the screen (the preview may have a smaller resolution than the full scene). Currently, we're calling renderTexture2D() in render() and downloading that texture. However, that results in the scene being rendered twice - once to the texture, and once on-screen, and that's a performance killer.

I can think of two possible designs:

  1. Render normally and download the rendered scene in swap(). Is that possible? Would it be possible to show the scen in a smaller window in this case?
  2. Render the normal scene to texture for download.Then, render a minimal scene that fills a quad with the texture we just generated.

Do any of these make sense?

Posted

For design 1, have a look at addCallback() and setVirtualResolution() in the Render class. But design 2 should be possible too, simplest might be to render an empty scene with a WidgetSprite over the top.

Posted

I've just implemented design 1. Works perfectly, performance is greatly improved. Thanks!

For future reference: The Screenshot example essentially implements (most of) this strategy.

×
×
  • Create New...