Swizzling

From Tech Artists Wiki

Jump to: navigation, search

Swizzling is the process of re-arranging vector components. For example, if A = {1,2,3,4}, you could swizzle A to get B = A.wwxy, then B would equal {4,4,1,2}.

This is common with normal map compression, where the best compression can be achieved not with X, Y, and Z vector components responding to R, G, and B, but by swizzling the components to put the X component in the alpha and re-create the Z component in the shader.

Personal tools