Jump to content

HDR with multiple scenes rendering


photo

Recommended Posts

Posted

Hi,

We are using Unigine to render multiple scenes 'simultaneously'.

All scenes are loaded into one world and each one has it's own NodeDummy set as 'WorldParent', so we can just enable or disable each scene with one Node::setEnabled() called on parent.

Each scene/view is rendered to separate target (window) and everything is working perfect except HDR.

Because scenes are being rendered in a sequence one after another and Unigine is using luminance calculated for 4 frames before - image is blinking - it's using luminance calculated for another scene/view. I realize it's not a common usage of this engine, but this is what we need.

 

I was trying even to lock luminance with min_luminance and max_luminance set to the same value (but different for each scene), but it founds out that it's still using luminance from 4 frames before. This problem can be solved in RenderPost::renderHDR with simple:

 

luminance_texture = last_luminance_texture;

before:

/////////////////////////////////
// hdr bright texture
/////////////////////////////////

 

With this change, engine is still evaluating current luminance to due to 4 frames before, but then it uses the one calculated now instead of the old one and it's not braking adaptation when luminance is not locked (with a single scene).

 

Can you confirm that this change doesn't break anything? Or maybe someone can propose any better solution, so we can still use automatic eye adaptation with multi-scene support.

 

PS. Motion blur is working fine when we render each scene from another instance of Player.

 

Edit:

I've just found, that when hdr_adaptation parameter is small enough (smaller than ifps*4) linear interpolation between old luminance and new one always returns the new one. With this parameter we only loose 'smoothness' of eye adaptation, but we do not need to lock luminance to a fixed value.

All we need now is this fix in RenderPost::renderHDR, is it possible to patch your sources in newer versions with this? If not we still can patch it on ourselves after every update.

×
×
  • Create New...