Jump to content
Sign in to follow this  
Delta Hawk

2 normal maps for a material???

Recommended Posts

 I'm making a large, detailed, wooden object and I'm running into issues with texturing it.  I've found out using the multi-shader works perfectly for some parts but not for others.

 

I would like to create a material that has two normal maps, one for the wood grain and the other for the overall object.  Does anybody know how to do this?  Thanks.

Share this post


Link to post
Share on other sites

 I'm making a large, detailed, wooden object and I'm running into issues with texturing it.  I've found out using the multi-shader works perfectly for some parts but not for others.

 

I would like to create a material that has two normal maps, one for the wood grain and the other for the overall object.  Does anybody know how to do this?  Thanks.

would you not just create them both as selections within the model? It's no different to having metal and plastic parts, all you do is select the areas that use the plastic/wood, assign the texture, and rvmat, and continue the same thing for the metal parts  ?

I think it's also similar to creating the NVG lense glow effect, it may have the NVG texture, but you can still assign it a different rvmat, whilst the rest of the NVG uses the one associated with the texture.

Share this post


Link to post
Share on other sites

No, that's not what I mean.  Take a look at this hatchway. 

example1.jpg

 

 

It has an overall normal map for the edges and timber joints so they're not so sharp looking.  But unfortunately the wood grain isn't very high res like the wood planks next to it (I'm using the multi-shader material for the wood planks)

 

example3.jpg

 

 

What I want to do is layer a second normal map on top of it and tile it so I can get a high res wood grain similar to the wood planks next to the hatchway.

 

example2.jpg

 

So I'm looking for a material that will allow me to layer two normal maps on top of each other, the object normal map and a second tiled normal map. 

 

This obviously would mean adjusting the tile size either in the .rvmat like below....

 

class Stage1
{
    texture = "textures\something_nohq.paa";
    uvSource = "tex";
    class uvTransform
    {
        aside[] = {8,0,0};
        up[] = {0,8,0};

        dir[] = {0,0,0};
        pos[] = {0,0,0};
    };
};

 

or using two UV channels in oxygen with the second channel for the second normal map.  But I don't know how to make a material .rvmat like this.

Share this post


Link to post
Share on other sites

ah gotcha, best place is to ask on discord I'm not familiar with using 2 rvmats for a single source object unless they're both done via selections.

  • Like 1

Share this post


Link to post
Share on other sites

Ok, where would I find this discord?  I know it's a development site but where would I find it?  Thanks.

Share this post


Link to post
Share on other sites

BI uses "detailmaps" for this. The texture extension is "_dt" and "_dtsmdi" (mainly for buildings). 

 

Example of a detail map in rvmat file:

class Stage2
{
texture = "a3\data_f\detailmaps\wood2_512_dt.paa";
uvSource = "tex";
class uvTransform
{
aside[] = {8,8,0};
up[] = {-8,8,0};
dir[] = {0,0,0};
pos[] = {0,0,0};
};
};
 
This is an example of a BI detail map (as in path above):
wood2_512_dt.jpg
 
Hope it helps ;)

Share this post


Link to post
Share on other sites

what you are trying to achieve cannot be done (there is no shader that will allow you to overlay 2 distinctive nohq (normals) maps

 

edit: dt are not normals maps ;)

  • Like 1

Share this post


Link to post
Share on other sites

what you are trying to achieve cannot be done (there is no shader that will allow you to overlay 2 distinctive nohq (normals) maps

 

edit: dt are not normals maps ;)

 

Yes agreed, however to get a similar effect dt maps could be used. For a hatchway that should be fine I guess.

  • Like 1

Share this post


Link to post
Share on other sites

The problem with using detail maps is there's no way to turn it off in a texture afaik.  For example if my hatch had bolts drawn in the texture then the wood grain from the detail map would be overlaid : /   Also I would still be forced to use large textures like 2048x2048 or worse, 4096x4096 : (

 

In all honesty I think I might go the multi shader material route.  At least then I'll get an overall AS and MC map with high res diffuse and normal map for the wood grain, then use different multi-shader maps for bolts, nails, planks .etc.  There will be so much crud and dirt with the MC map I might be able to cover the sharp edges on the map. 

 

Kind of like what I did in these picture...

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-05%2022-48-41-23.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-05%2022-49-04-32.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-05%2022-49-28-51.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-05%2022-49-37-50.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-08%2021-56-38-33.png

 

I could also smooth the model and reinforce the edge with an edge loop at the cost of more polys to get a similar effect.  Also shadows and overcast clouds cover up the normal map anyways, so in that case I'd rather using the multi-shader shader with ambient occlusion verses using a large 4096x4096.

  • Like 2

Share this post


Link to post
Share on other sites

 

I could also smooth the model and reinforce the edge with an edge loop at the cost of more polys to get a similar effect.

Polygons are not the "driving" force for performance. It's vertex normals. So you will not necessarily have worse performance with that approach. A corner of a cube with all sharp edges would have 3 vertex normals. A corner of a cube with all in one smoothing group would have 1 vertex normal. So if you chamfer your model, but assign it all to one smoothing group and use weighted normals you should be able to get a fairly decent and smooth look, without too much (if any) performance impact. Also stitch all your UV's as good as possible (every uv split is like a sharp border). That's the best method when working with tiled textures.

 

Star citizen use the same for their ships. https://www.reddit.com/r/starcitizen/comments/3ogi3o/im_an_tech_artist_in_the_industry_and_id_love_to/Only thing that stops you from doing the exact same in A3 is the lack of blending an alpha map with normal (a decal) with the background color. Also, alpha maps with 8bit alpha still have problems (receive no shadows).

  • Like 1

Share this post


Link to post
Share on other sites

Polygons are not the "driving" force for performance. It's vertex normals. So you will not necessarily have worse performance with that approach. A corner of a cube with all sharp edges would have 3 vertex normals. A corner of a cube with all in one smoothing group would have 1 vertex normal. So if you chamfer your model, but assign it all to one smoothing group and use weighted normals you should be able to get a fairly decent and smooth look, without too much (if any) performance impact. Also stitch all your UV's as good as possible (every uv split is like a sharp border). That's the best method when working with tiled textures.

 

Damnit.  Why didn't I realize that before?  *throws liqueur bottle at wall*  And I'm the one that tells everyone about hard edges verses smooth edges and how hard edges takes up more polys than smooth edges.  I could reinforce my edges with edge loops (what I call it) and it would just be almost the same as if the model had hard edges.

 

 

Only thing that stops you from doing the exact same in A3 is the lack of blending an alpha map with normal (a decal) with the background color. Also, alpha maps with 8bit alpha still have problems (receive no shadows).

 

There is "decaling" in arma...sort of.  If you look at the deck of my ship I used 3 1024x1024 textures, one that's nothing but planks, one that's nothing but planks and rows and rows of nails, and the final texture of planks, rows and rows of nails and plank end joints.  I use the multi-shader (usually used for terrain and buildings) to show the different textures where I need them.

 

I'm very excited to try this because a lot of my deck beams and ledges have split UV tiles (or islands).  With it being hard edges and together the normal texture blends over to the wrong face.  So I have to split the uv parts which takes up so much room.  Now I don't have to set up the model like that.

Share this post


Link to post
Share on other sites

I did some experiments with my ship to test out the lag chamfering the edges.  I got some pretty interesting results.

 

So if you chamfer your model, but assign it all to one smoothing group and use weighted normals you should be able to get a fairly decent and smooth look, without too much (if any) performance impact.

 

I don't think there is a way of editing the normals in oxygen but surprising the normals seem to be weighed more to the larger face than the smaller adjoining face negating the need to fight with thousands of normals.

 

To test out the performance impact of chamfering the edges I first took all of the deck beams with sharp edges and no chamfering and made 6 copies of the object (about 60,000 polys) and got a frame rate of 63-64.  I then replaced it with deck beams with smooth edges and chamfering (the poly count increased about 150%) and got a similar frame rate of 63-64.  You can't tell the difference from this far away but the chamfered edges look a lot better.

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-26%2022-38-16-43.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-09-26%2022-57-48-15.png

 

I went ahead and tested the whole process chamfering the edges and using the multi-shader on the riding bitts (I put the riding bitts on the quarter deck to test them out).  It turned out great but I'm getting odd lighting anomalies on some faces.

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-10-01%2012-05-35-61.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-10-01%2012-05-51-13.png

 

https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-10-01%2012-06-10-58.png

 

Unfortunately there's a cost of doing this.  It seems I have to redo all of my UVs because somehow chamfering the edges has broke 3ds max's uv stitch tool :(

Share this post


Link to post
Share on other sites

I don't think there is a way of editing the normals in oxygen

you can only recalc normals with F5 in O2. But if you do not do it, it keeps the normals from the import (when using fbx or 3ds)). So you would use normalweighting in max and import.

 

Unfortunately there's a cost of doing this.  It seems I have to redo all of my UVs because somehow chamfering the edges has broke 3ds max's uv stitch tool

Then you are likely doing something not the right way. Most important however is, that you stitch as much as possible (and even stretch some stuff) - otherwise you will not have "free" edgechamfer.

It turned out great but I'm getting odd lighting anomalies on some faces.

Any example? With weighted normals and simple chamfer, you have to controll your triangulation. If you don't it can lead to "bumpy" normal weighting. Here is an example of triangulating a cylinder, applying one smoothing group and normal weight:

Left is standard triangulation, Right uses one extra point in the middle. Notice how the left one is uneven. You can fix that manually, but it's tedious hand work and can get destroyed when you need to edit the mesh again for some reason.

2016-10-0203_20_09-thkxuep.png2016-10-0203_20_31-th22u8e.png

When you do chamfer everything, keep in mind that you also have to create res LOD still, and that is where it could become problematic.

  • Like 1

Share this post


Link to post
Share on other sites

Also remember that if you can't stitch most of the object properly, with as little seams as possible, you are not efficient in any way, you are simply spending on top of what you would have with default seperate smoothinggroups. So don't chamfer everything blindly.
The version in the UV bottom right would not save you any vert normals. The one in the top does, and it is almost equal to a non-chamfered one with all sharp smoothinggroups. Top left has 90 Vertnormals (compared to 80 of nonchamfered, hard edged) due to the unavoidable UV seam, Bottom right has 120 vert normals.
2016-10-0217_08_07-th46u43.png

  • Like 1

Share this post


Link to post
Share on other sites

Then you are likely doing something not the right way.

 

Yes, I chamfered the edges after I unwrapped it.  I tried to get it to stitch correctly, including exporting it as an obj and reimporting it.  Usually that clears up any glitches in the model but it didn't with stitching.  I have to redo the UVs anyways since most of it was broken up.  I just feel like to take one step forward I'm taking two steps back for something that'll never work :(

 

This https://dl.dropboxusercontent.com/u/28808032/pictures/arma3%202016-10-02%2013-32-24-65.png is an example of the weird lighting anomaly.  You can see it the most on the right timber of the riding bitts coming straight up from the deck.  I can show you the wireframe if you like but I think it has something to do with my specular settings.

 

Below is an example of 3ds' normals and oxygen normals.  I did nothing to the normals in oxygen.  You can try it on your end.  The normals seemed to be weighed more to the large face than the adjoining face, which is great because now I don't have to deal with modifying thousands and thousands of normals.

 

normal%20example.jpg

Share this post


Link to post
Share on other sites

 

deal with modifying thousands and thousands of normals.

there are scripts to accomplish that for max (google for normal weighting script)

  • Like 1

Share this post


Link to post
Share on other sites

there are scripts to accomplish that for max (google for normal weighting script)

 

That's the thing, I don't have to use any scripts.  ArmA has weird normals.

 

Anyways I think I'm happy with the results.  I haven't done the different shader parts with the tree nails and bolts yet.  I think this proof of concept has validated the use of chamfered edges with the multishadar .rvmats.  Thanks for the tip!

 

arma3%202016-10-23%2012-25-49-24.png

  • Like 1

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×