Skip to content

Instantly share code, notes, and snippets.

@JPBotelho
Created April 4, 2019 16:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JPBotelho/f388d0817b08b90a51247ca22fc9ae47 to your computer and use it in GitHub Desktop.
Save JPBotelho/f388d0817b08b90a51247ca22fc9ae47 to your computer and use it in GitHub Desktop.
/* to map a cubemap into a texture atlas; bottom to top left to right */
float faceWidth;
float faceHeight;
float atlasWidth = faceWidth*3;
float atlasHeight = faceHeight*2;
for(int i = 0; i < 2; i++)
for(int z = 0; z < 3; z++)
GL.ViewPort(z*faceWidth, i * faceHeight, faceWidth, faceHeight)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment