Poor performance when animating basic camera parameters
Related to this thread: viewtopic.php?f=37&t=8334&p=114396&hilit=memory#p114396
We're animating the clip plane on the camera (in connection with a fog change in the environment), and performance tanks because of the (seemingly unnecessary??) work in OVRDistortionCamera.GenerateMesh. I've removed the clearly unneeded extra array allocations for verts, indices, etc (only allocate them when the mesh size changes), because that creates a large amount of per frame garbage which then frequently triggers the garbage collector. But there's still underlying OVR_GenerateDistortionMesh/OVR_DestroyDistortionMesh that I'm more hesitant to change.
It seems like the distortion mesh is generated upon any camera param change, but looking at the code my guess is that it's only necessary to change based on FOV/resolution changes? Is that correct? If so can this be fixed in the next SDK version?
Thanks,
Borut
We're animating the clip plane on the camera (in connection with a fog change in the environment), and performance tanks because of the (seemingly unnecessary??) work in OVRDistortionCamera.GenerateMesh. I've removed the clearly unneeded extra array allocations for verts, indices, etc (only allocate them when the mesh size changes), because that creates a large amount of per frame garbage which then frequently triggers the garbage collector. But there's still underlying OVR_GenerateDistortionMesh/OVR_DestroyDistortionMesh that I'm more hesitant to change.
It seems like the distortion mesh is generated upon any camera param change, but looking at the code my guess is that it's only necessary to change based on FOV/resolution changes? Is that correct? If so can this be fixed in the next SDK version?
Thanks,
Borut
