Texture Stage Inputs (Windows Embedded CE 6.0)
1/6/2010
The primary inputs into a texture stage are a texture map and a set of texture coordinates to index the map. The number of coordinates in the set should match the number of dimensions in the texture, or else a blend error of D3DMERR_DRIVERINVALIDCALL will result.
The amount of available memory that can be allocated for textures is roughly approximated by the IDirect3DMobileDevice::GetAvailableTextureMem method.
It is possible to change the current texture map bound to a stage with the IDirect3DMobileDevice::SetTexture method.
The transformation layer determines which texture coordinate sets are passed to each stage. It is up to the application to correctly program the transform layer to output appropriate coordinates to the enabled stages.
It is only necessary for a texture stage to have a texture map and coordinates if it uses the map as an input.
There are also two texture registers whose values are maintained from stage to stage. The two registers are the current register, and the temporary register. The registers hold color values. The current register is initialized with the diffuse color for the pixel. The temporary register is initialized to black (0x00000000). Each texture stage may read from these registers as input, and may output a color into them for the remaining stages. After all of the enabled stages have been executed, the value of the current register is the output of the texture mapping cascade.