compositor layer using for render 360 video make render result judder
my team use UNDERLAY layer which shape = Equirect to render 360 video. the idea comes from oculus video app which looks like using UNDERLAY to make picture more sharp. platform is unity 2017.3.1 + oculus sdk 1.26
but i figure out OVROverlay.cs (oculus sdk 1.26) using
is anyone can explain what i do wrong with underlay? or give me some theory suggestion for Equirect underlay?
(new frame come then do render is save a lot of performance. but if i make render in every frame, judder occurs still)
private bool PopulateLayer(int mipLevels, bool isHdr, OVRPlugin.Sizei size, int sampleCount, int stage) which make gama correct & copy texture into overlay SwapChain. because of blit operation kills performance, i do not need to render each frame until new frame come, i modify OVRoverlay's code looks like: void PopulateLayer()
{for (int eyeId = 0; eyeId < texturesPerStage; ++eyeId)
{Texture et = layerTextures[eyeId].swapChain[stage];
if (et == null)
continue;
// render for 360 top-bottom video
//textures[0] is videotexture from video file
if (eyeId == 0)
Graphics.CopyTexture(textures[0], 0, 0,
0, textures[0].height / 2, textures[0].width, textures[0].height / 2,
et, 0, 0, 0, 0);
else
Graphics.CopyTexture(textures[0], 0, 0,
0, 0, textures[0].width, textures[0].height / 2,
et, 0, 0, 0, 0);
ret = true;
}
}
void Render()
{
GetCurrentLayerDesc();
CreateLayer();
CreateLayerTextures();
LatchLayerTextures();
PopulateLayer();
SubmitLayer();
}
void LateUpdate()
{
if (newFrameCome)
Render();
}
but when using underlay to play video, video texture judders ( looks like media player play frame not in a queue) once in a few secs.
you can download the render result from https://www.dropbox.com/s/rhi4mjtwmj9ndn7/problem.mp4?dl=0. do not directly look at website, you need download and seek the video into 0:20, there are some dog running and they position looks like blink, the judder phenomenon occurs once in few secs. but without underlay and using mesh to render, the video looks like right no judder.
the original video you can get from https://www.dropbox.com/s/tqdc9g8a48pkdph/normal.mp4?dl=0, you can seek into 0:07 and compare with the underlay version.
is anyone can explain what i do wrong with underlay? or give me some theory suggestion for Equirect underlay?
(new frame come then do render is save a lot of performance. but if i make render in every frame, judder occurs still)
