Forum Discussion
tlopes
12 years agoHonored Guest
Dev Feedback on OVR SDK 0.3.1 Preview
Hey guys, it looks like you're cramming a whole lot of features in to this release! Here's my first impressions with the new Distortion Renderer code in the new SDK: (Disclaimer: I mostly looked at...
jherico
12 years agoAdventurer
"tlopes" wrote:
Since you guys are rendering a 2D grid for the Distortion Mesh, I'm almost entirely certain that you could be using a TRIANGLESTRIP (8194 indices required, not counting strip/row restarts) rather than a TRIANGLELIST (24576 indices required). This saves a massive amount of index buffer space and is likely faster to render the distortion mesh.
They may be trying to minimize the difference between OpenGL and DirectX. On GL you can't use glPrimitiveRestartIndex unless you're working with 3.1 or higher.
"tlopes" wrote:
How did you guys arrive at the conclusion that 8192 triangles per eye was an optimal number for the distortion renderer? Wouldn't larger numbers of triangles result in lower linear interpolation stretch error? Did it just hit the point of diminishing returns as 8192 "looks good enough"?
LibOVR/Src/Util/Util_Render_Stereo.cpp contains some text about this
//-----------------------------------------------------------------------------------
// ***** Distortion Mesh Rendering
// Pow2 for the Morton order to work!
// 4 is too low - it is easy to see the "wobbles" in the HMD.
// 5 is realllly close but you can see pixel differences with even/odd frame checking.
// 6 is indistinguishable on a monitor on even/odd frames.
static const int DMA_GridSizeLog2 = 6;
static const int DMA_GridSize = 1<<DMA_GridSizeLog2;
static const int DMA_NumVertsPerEye = (DMA_GridSize+1)*(DMA_GridSize+1);
static const int DMA_NumTrisPerEye = (DMA_GridSize)*(DMA_GridSize)*2;
It looks like they tested by alternating frames between some per-pixel calculation and the mesh calculation, and discovered that it's indistinguishable at a grid size of 2^6, or 64x64 vertices, which comes out to 8192 triangles. The code in that file also shows that they're alternating the direction of the triangles depending on the quadrant being rendered in order to minimize the effect of the interpolated mesh values varying from the computed distortion value at the vertex. i.e. the long edge of the triangle is always orthogonal to the distortion radius.
Interesting stuff.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 5 years ago
- 10 months ago