Ok, I'm trying to understand how the face of a cubemap is selected using the coordinates supplied to textureCube()
. From the spec, I gather the coord with the biggest magnitude defines the face.
For example these coords (-0.2, 0.7, 0.65)
would select the Y+ face of the cube map, but these (0.2, 0.3, -0.8)
would select the Z- face.
Am I right in my understanding?
A Cubemap Texture is a texture, where each mipmap level consists of six 2D images which must be square. The 6 images represent the faces of a cube. The texture coordinate used to access a cubemap is a 3D direction vector which represents a direction from the center of the cube to the value to be accessed.
Cube maps provide a fairly straightforward and efficient solution to rendering stable specular highlights. Multiple specular highlights can be encoded into a cube map texture, which can then be accessed by interpolating across the surface's reflection vector to supply coordinates.
Specular Indirect Lighting is stored in an array of cubemaps. These are defined by the Reflection Cubemap objects. They specify where to sample the scene's lighting and where to apply it.
Indeed you are. This is the simplemost way to select the face of a cube, given a direction from the center.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With