Created
October 24, 2012 14:30
-
-
Save gashtio/3946392 to your computer and use it in GitHub Desktop.
Obtaining the texture ID of a material in CryEngine 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (viewListener->GetTextureId() <= 0) | |
{ | |
material = gEnv->p3DEngine->GetMaterialManager()->FindMaterial("materials/placeholder_1280_720"); | |
if (material) | |
{ | |
const STexSamplerRT& sampler = material->GetShaderItem().m_pShaderResources->GetTexture(EFTT_DIFFUSE)->m_Sampler; | |
const int texId = sampler.m_pITex->GetTextureID(); | |
viewListener->SetTextureId(texId); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment