Game Development Community

Towards multiple terrain detail maps

by Luis Anton · in Torque Game Engine · 06/10/2005 (10:51 am) · 1 replies

Hi,

I'm trying to add multiple detail maps to tge terrain. Right now, I am stuck trying to get a texture handle, because I need it to find the texture's glName.

Here's how I get the texture name and index:

S32 mapIndex = mCurrentBlock->mMPMIndex[0];			  
if (mapIndex != -1) {
    MaterialPropertyMap* pMatMap =   
static_cast<MaterialPropertyMap*>(Sim::findObject("MaterialPropertyMap"));
    const MaterialPropertyMap::MapEntry* pEntry = pMatMap->getMapEntryFromIndex(mapIndex);
  
    TextureHandle t = ????

It works This tells me on which texture I'm standing on. It's sand if on sand, grass if on grass... But then I need their handle, and I can't find how.

Could anyone tell me please how to find a texture handle knowing it's name?

#1
06/10/2005 (1:07 pm)
Luis, take a look at how mEnvironMaps is set up in Interior stuff.

you have to get a texture hande to it at some point like so:

new TextureHandle(pEntry->environMapName, MeshTexture);

this is done in prepforrendering in the interior code

then you can use the textureHandle to get the glname with the appropriately named
->getGLName()