Week Seven
Textures and Cubemaps
Slides from class
Reading: Textures
Reading: Cubemaps and Skyboxes
Reading: Cubemaps and Skyboxes II
Textures are 2D or 3D buffers of 1D,2D,3D or 4D data.
Billboards
Billboards are rectangles with textures attached to them, which always face the camera
Graphics:webgl_gfx_frame_billboards.html
Code: https://github.com/wolftype/200c/blob/gh-pages/scratch/webgl_gfx_frame_billboards.html
2 Textures
Multiple textures can be applied by sending ids to with glUniform1i
and activating textures with glActiveTexture
.
Graphics:webgl_gfx_textures.html
Code: https://github.com/wolftype/200c/blob/gh-pages/scratch/webgl_gfx_textures.html
Cubemap
Cubemaps are a set of six textures that can be used to create an environment “skybox” that we sit inside of. As we are in a right-handed coordinate system, the positive Z direction is behind you and the negative Z direction is in front of you.
Graphics:webgl_gfx_cubemap_skybox.html
Code: https://github.com/wolftype/200c/blob/gh-pages/scratch/webgl_gfx_cubemap_skybox.html