Normal Map - Models with multiple textures

Posted By: DWilki

Normal Map - Models with multiple textures - 06/17/07 15:38

So, I've had quite a bit of success with various shaders. One problem I see is that model geometry with multiple textures will not work with shaders. At least I cannot find a way for them to work. By this I mean the following:

1) Create a model
2) Assign multiple textures and UV on the mesh
3) Import into med and "Manage Skins"
4) For some of models, I may have up to 7 or 8 textures assigned.

In the past, my solution has been to merge all textures into one larger texture (1024x1024) and then re-do the uv layout. This is a lot of extra work. It would be much easier to manage the models and textures if I didnt need to do this.

Is their a way to work with models and assign shaders to models with multiple textures? Hope that makes sense.

As an example, other engines that I work with allow me to assign shaders at the texture level with materials. It doesnt matter that the model has multiple textures becuse the materials and shaders are managed at the texture level.

I think I may just be missing something.
Posted By: DWilki

Re: Normal Map - Models with multiple textures - 06/17/07 15:50

Actually, I may have answered my own question. Let me know if this is correct. This information is from Taco Cohen's Introduction to Shader Programming:

"Since engine version 6.40.5, you can assign materials to (a part of) a model in MED. In MED, go to Edit > Manage Skins. If there is a skin already, click [Skin Settings], if there is no skin yet, click [New Skin]. Check the “Effect Setup” and “Texture” Boxes and choose an effect file (.fx) and a texture file."

This way, it doesnt matter how may textures are assigned to a model, I would just assign the .fx file in the Mana Skins properties.
Posted By: xXxGuitar511

Re: Normal Map - Models with multiple textures - 06/17/07 16:40

The engine should auto manage your skins for normalmapping. Simply pair your skins...

ex:
skin1: Diffuse01
skin2: Normal01
Skin3: Diffuse02
skin4: normal02
etc.
Posted By: DWilki

Re: Normal Map - Models with multiple textures - 06/17/07 19:45

Quote:



ex:
skin1: Diffuse01
skin2: Normal01
Skin3: Diffuse02
skin4: normal02
etc.




Thats good news. So, in the case of the FX file where I have (using your shader) entSkin1 and entSkin2, these variables will automagically know to pair skins 3 and 4 and 4 and 5 etc as diffuse and normal maps? From your code below:

sampler ColorMapSampler = sampler_state
{
Texture = <entSkin1>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};


sampler BumpMapSampler = sampler_state
{
Texture = <entSkin2>;
MinFilter = Linear;
MagFilter = Linear;
MipFilter = Linear;
AddressU = wrap;
AddressV = wrap;
};
Posted By: xXxGuitar511

Re: Normal Map - Models with multiple textures - 06/18/07 02:38

From what I've read and heard, yes. Though I have actually never tested this. I'm working towards [finally] purchasing SPHERE so I can actually use these shaders in a project with > 30 fps...
© 2024 lite-C Forums