-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Lua APIA request to add a new function.A request to add a new function.ShadersThe issue relates to shaders.The issue relates to shaders.
Description
Description
Functions ITexture:GetMappingWidth, ITexture:Width, ITexture:GetMappingHeight, ITexture:Height can't get a lightmaps size. Therefore, I propose to add a function GetLightmapPageSize. This will simplify manual work with lightmaps.
if (!IsErrorTexture(g_pMaterialSystem->FindTexture("[lightmap0]", ""))) // Boundaries check
{
int nLightmapWidth;
int nLightmapHeight;
g_pMaterialSystem->GetLightmapPageSize(0, &nLightmapWidth, &nLightmapHeight);
ConMsg("nLightmapWidth: %d; nLightmapHeight: %d\n", nLightmapWidth, nLightmapHeight);
}
-- thanks mutezeroOther methods (invalid):
ITexture* m_pLightmapTexture = materials->FindTexture("[lightmap0]", TEXTURE_GROUP_LIGHTMAP);
if (m_pLightmapTexture) {
int nLightmapWidth = m_pLightmapTexture->GetActualWidth();
int nLightmapHeight = m_pLightmapTexture->GetActualHeight();
ConMsg("GetActualWidth: %d; GetActualHeight: %d\n", nLightmapWidth, nLightmapHeight);
int nLightmapWidth2 = m_pLightmapTexture->GetMappingWidth();
int nLightmapHeight2 = m_pLightmapTexture->GetMappingHeight();
ConMsg("GetMappingWidth: %d; GetMappingHeight: %d\n", nLightmapWidth2, nLightmapHeight2);
}Alternatively:
pShaderAPI->GetLightmapDimensions(&nLightmapWidth, &nLightmapHeight);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Lua APIA request to add a new function.A request to add a new function.ShadersThe issue relates to shaders.The issue relates to shaders.