Fix a bug of patch level computation for non-quad faces.

This commit is contained in:
Takahito Tejima 2013-06-18 19:17:41 -07:00
parent edfc9b4bb6
commit 043044827f

View File

@ -175,7 +175,7 @@ uniform isamplerBuffer g_ptexIndicesBuffer;
ivec2 ptexIndex = texelFetch(g_ptexIndicesBuffer, \
gl_PrimitiveID + LevelBase).xy; \
int faceID = ptexIndex.x; \
int lv = 1 << (ptexIndex.y & 0xf); \
int lv = 1 << ((ptexIndex.y & 0xf) - ((ptexIndex.y >> 4) & 1)); \
int u = (ptexIndex.y >> 17) & 0x3ff; \
int v = (ptexIndex.y >> 7) & 0x3ff; \
int rotation = (ptexIndex.y >> 5) & 0x3; \