Retrieving Material Properties

You retrieve a material object's properties by calling the object's IDirect3DMaterial3::GetMaterial method. Unlike using the IDirect3DMaterial3::SetMaterial method, GetMaterial doesn't require much preparation. Before the call, initialize a D3DMATERIAL structure's members to zero and set the dwSize member to the size of the structure, in bytes. The GetMaterial method accepts the address of an initialized D3DMATERIAL structure, and fills the provided structure with information describing the current material properties before returning.