-
Notifications
You must be signed in to change notification settings - Fork 15
Transforms
Stefan Keim edited this page Jul 24, 2021
·
3 revisions
In addition to regular cubemaps, kubi allows to generate two optimized mappings:
-
Equi-Angular Cubemap (EAC)
C.Brown (2017): Bringing pixels front and center in VR video -
Optimized Tangens Cubemap (OTC)
M.Zucker & Y.Higashi (2018): Cube-to-sphere Projections for Procedural Texturing and Beyond (Ch. 3.2 & Ch. 5)
Both transforms are univariate and therefore very easy to implement. They both significantly reduce the distortion of the cubemap and thus optimize the pixel yield. However, support in other tools and libraries is rather scarce.
error | ltr: regular cubemap, EAC, OTC |
---|---|
area | |
distance |
To ensure the correct representation of a transformed cubemap, the reverse transformation must be performed at some point. The following example shows this for the OTC transformation in a fragment shader.
//FRAGMENT SHADER for OTC
vec3 n = vNormal.xyz; // or vPosition
n /= max(max(abs(n.x),abs(n.y)),abs(n.z));
n = atan(n * tan(0.8687));
gl_FragColor = textureCube(otcSampler, n);
(This is a copies a section of the README.md that allows to link directly without an anchor - I'm looking at you hackernews ;-)