Normal Mapping Question

Posted By: PietroNifosi

Normal Mapping Question - 12/10/09 15:02

Hello everyone,
I have a model of some medieval house exported from max with several materials/textures.
Each texture is about size 512x512.
How can I add normal mapping to the model?
As far as I've managed to understand this shader ->

http://www.opserver.de/wiki/index.php/Normalmapping_Shader_With_full_specmap_support

allows to have a mesh with 3 textures: 1 diffuse 1 normal map 1 specular. And that texture itself has everything in it.

What about my model that has a separate roof texture from wall texture? Am I forced to create a huge texture (avoiding loss of detail) and throw every texture in there, and than re-unwrap everything on max?

Or is there a coding solution to this?
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/10/09 16:34

Oh and by the way, I'm using tiled textures.. therefore even if I manage to recollect all in one textures, I can't just re-unwrap the whole thing cause it won't fit unless I start cropping everything.
Isn't that a bit too extreme?
Posted By: xXxGuitar511

Re: Normal Mapping Question - 12/10/09 17:56

GS has a (somewhat) new feature that automatically pairs diffuse and normal maps. For example, say you skin one part of your mesh with skin1, then place that skins normal map after it (skin2). For the next segment of your model, use skin3 for diffuse, and skin4 for it's normal map.

GS will send the model as segments, rendering the first pair, and then again with the second pair, and so forth...
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/10/09 18:38

Alright alright I like that, can you explain it a bit more in detail? do i need a different shader to it? how does it work exactly? where can i get it?
Posted By: Slin

Re: Normal Mapping Question - 12/10/09 21:33

Just assign the differentz textures in the explained order use any shader you want and you are set.
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/11/09 10:15

well ok but here's is what I did and still no luck:

skin 1 -> texture + connected to the shader .fx

skin 2 -> normal map

skin 3 -> texture

skin 4 -> normal map

etc etc

So far the result I'm getting is only the first texture gets normal mapped, skin 3, 5, 7 etc don't.

Do i have to connect the shader .fx in 3, 5, 7 .. as well?


Posted By: PietroNifosi

Re: Normal Mapping Question - 12/11/09 11:08

ok folks I've been able to connect all the .fx files to the various textures and linked them to their normal maps. The normal mapping seems to work now except my mesh has become somehow transparent, meaning I can see the other side walls rendered as well. I can basically see through it, sort of rendering problem. Any solution? I'm using http://www.opserver.de/wiki/index.php/Normalmapping_Shader this shader.
Posted By: Quad

Re: Normal Mapping Question - 12/11/09 11:22

define it as a material in code insted. and assign it from either wed or code.
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/11/09 11:32

Well I did some additional testing:

basically shader or not, if I import a mdl7 mesh in the game and I lauch it I see it in transparency/wrong rendering. Therefore to fix it I flag it "overlay".

BUT

If i mantain the overlay flagged on a mesh that has a normal map everything will turn invisible and i won't be able to display anything.

So my guess is, there's something i'm doing wrong when i export the mesh.

Basically from max I export in .ASE. Wrong choice?
Posted By: Slin

Re: Normal Mapping Question - 12/11/09 11:48

Check out the textures. Your models are handeled as transparent if the textures are 32bit, which causes sorting problems. You can weather change your texture format or set the PASS_SOLID flag for your material.
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/11/09 13:27

Great thanks for the tip! I've converted my textures to 16bit and now it works just fine.
Posted By: PietroNifosi

Re: Normal Mapping Question - 12/13/09 12:04

What if I want to deactivate the normal maps when the mesh is far away in distance? to gain frame rate that is.

Can I do that? and how? the fx is still in within the mdl file, it's not attached by any script to the mesh, but I guess I could use the "extern" checkbox for that.

Anyway little help here please laugh
© 2024 lite-C Forums