Jump to content

system vs editor vs game script and motionblur.


photo

Recommended Posts

What I did.

 

Added A capture button to the Tracker Editor.
I have added active.player to tracker. it basically does what game.player does but it also works in editor mode.

if (engine.editor.isLoaded()) {
    engine.editor.call("controlsSetEnabled",0);
    engine.editor.setPlayer(player);
} else {
    engine.game.setPlayer(player);
} 

  We are capturing from the system script. This is so  I can batch capture while reloading the world between captures to keep timing of animations and world settings consistent.
The capturing code in this case looks like.

Player player = Unigine::getPlayer();
engine.render.renderImage2D(
    player.getProjection(),
    player.getModelView(),
    image,
    width,
    height,
    player.getPostMaterials(),
    RENDER_HDR_DISABLED
);

We also have a second batch capture mode which adds the following code to the system script.

// track initialisation
tracker = new Unigine::Tracker::Tracker();
track = tracker.addTrack(filename);

//in update function.

float pos = (frame-min_frame/max_frame-min_frame)+min_frame;
pos /= unit_time*25;
track.blend(pos,1.f);

What is not working

 

Motion blur. In the case where the camera is being moved by the Editor script and captured from the System script - we are getting a lot less motion blur in the captured frames than we do on the screen. In the cases where both moving the camera and capturing is happening from the system script (batch mode) we are getting a lot more motion blur.

 

Ok what am I missing. How do I get this to work?

Link to comment
  • 2 weeks later...

yes -- we have been using these to tweak the results but what we are seeing on the screen is not what we are getting using engine.render.renderImage2D we have to adjust and then look at the rendered frame sequence to figure out if it is right

Link to comment
  • 2 weeks later...

It is not simple to describe the problem. We have been capturing motion blur perfectly since it was implemented years ago. Something danni has written in his batch capture code has twisted how motionblur works recently. The bizarre thing is that we can see motionblur if travelling into the screen, but not if travelling perpendicular / sideways. If danni disables the batch capture code and we capture normally, things work fine. It seems that there is some kind of scaling or multipllication happening for some axis of movement. We just don't know what in the code danni posted above would cause this behaviour.

 

Thanks.

Link to comment
×
×
  • Create New...