5 ms·
He talked about equirectangular projection. I wonder how he is achieving that, with what kind of shader, I asked the question once, and it seems you cannot do t
by jokoon 8y ago
He talked about equirectangular projection. I wonder how he is achieving that, with what kind of shader, I asked the question once, and it seems you cannot do that with a vertex shader, but maybe a geometry shader?
I already read articles about the pannini projection, which is quite cool, but I guess occulus is facing the same issues and has similar solutions...
- Const-me 8y agoAny shader. You can render a single quad and calculate UV in the pixel shader. Geometrically, this is the most accurate method. You can do without any shaders, write a CPU code that builds a reasonably dense (about 8x8 pixels/triangle) static geosphere mesh with position and texcoord channels. You can also build a reasonably dense grid mesh occupying just the screen with just the positions in clip space, and calculate UV channel in the VS based on the rotation. GS will work too but I’m not sure it makes sense performance-wise. People normally use GS-es to implement small dynamic objects. For static geometry I won’t be surprised an immutable buffer will be faster, just because that’s what hardware & drivers are optimized for. See e.g. this http://www.joshbarczak.com/blog/?p=667 http://www.joshbarczak.com/blog/?p=667
- undershirt 8y agoThese are the steps for transformation that may answer your questions: 1. Cubemap (source) - 360° videos are often sourced from six different images stitched together. 2. Equirect (video) - the cubemap is transformed to "equirect" trivially with a fragment shader—which maps every output pixel to some input pixel. 3. Perspective (output) - Mapping equirect video to a perspective projection is also done with a fragment shader, just using a different transformation depending on the focal point of the user. 4. Pannini (alternative output) - You mentioned this projection, and it's an alternative to the "perspective" projection that allows a wider output FOV that minimizes distortion in the periphery.
- slavik81 8y agoThe transformation from cubemap to equirectangular projection seems unnecessary. Why convert? There's support for cubemap textures on modern hardware, and having a seperate video stream per face would make culling them easy. It wouldn't be as fine-grained as Carmack's end result, but it would be simple and avoids resampling.
- jokoon 8y agoHow would you achieve a 170 degrees pannini projection in real time using opengl? Do I really need a cube map?
- undershirt 8y agoYou can use maps containing fewer faces than a cube, or any partial mapping that covers the 170 degree area you need. I researched this a bit here: https://github.com/shaunlebron/blinky https://github.com/shaunlebron/blinky
- Animats 8y agoIt's no worse than the problem of stretching a texture over a sphere, using UV coordinates. It's doing it at this data rate that's new. Mandatory XKCD: [1] [1] https://xkcd.com/977/ https://xkcd.com/977/