Quote: "g_mViewProj
What is that?... ViewProjection? WorldViewProjection?"
Following the naming conventions, that should be a global view projection matrix.
The
g_ prefix is used to indicate it is a global variable (available to all shader functions), the
m prefix is used to make it clear that the variable is a matrix.
ViewProj is obviously just short for view-projection, which, as WLGfx said above, is a combined view and projection matrix, in other words a matrix that you transform worl-space positions with to get them into screen space using your rendering camera's settings.
There is no way to set custom matrices to a shader constant from the standard DBPro library.
Here is a function that follows the standard of all other "set effect constant ...." functions in the DarkSDK; you can put this in, create a dbSetEffectConstantMatrix(int iEffectId, char *szConstantName, int iMatrixId) wrapper function for it and export that if you use the official open source solution and rebuild the DBProBasic3DDebug.dll file:
DARKSDK_DLL void SetEffectConstantM ( int iEffectID, SDK_LPSTR pConstantName, int iMatrix )
{
// get constant ptr
LPD3DXEFFECT pEffectPtr = SetEffectConstantCore ( iEffectID, pConstantName );
if ( pEffectPtr )
{
// apply value to constant
D3DXHANDLE hParam = pEffectPtr->GetParameterByName ( NULL, (char*)pConstantName );
D3DXMATRIX matData = g_Types_GetMatrix ( iMatrix );
pEffectPtr->SetMatrix ( hParam, &matData );
}
}