@Jerome8911 Gamestudio by default can only send about 4 internal entity textures to be read by the shader. However Dx9 has the ability to read more than 4 textures/samplers. Superku let me know of a material event function that will allow you the ability to send more internal entity textures to the shader, as long as you keep the same names within the shader:
Code
#include <d3d9.h> //include this at the beginning of your script to use the LPD3DXEFFECT function from the d3d graphics library
...
function mtl_event_terrain() //----------------------- the terrains material event
{
LPD3DXEFFECT _fx = mtl->d3deffect; /// use this new function to grab the correct skin
BMAP* doot5 = ent_getskin(me,5); ///get the bmap pointer of the entity's 5th skin
//------------------------------ent skin 5!
if(doot5!=NULL) //------------- If the entity's 5th skin is not NULL
{
_fx->SetTexture("entTex5",doot5->d3dtex); // force the texture sampler to be the bmap of the entitys 5th skin!
}
}
Now in your shader, as long as you use the same exact name, you can sample this 5th texture!