Jump to content
Sign in to follow this  
Phlogios

Both baked and single-color normal map generate artifacts

Recommended Posts

Hi mates,

So I have made a model of a missile, and it is done and textured and all. But I'm having 2 problems with the RVMAT file that I wrote. I followed Linker Split's tutorial on how to make a basic RVMAT file for an M4, and it all seemed to make sense, but my results are very different from his.

PROBLEM 1 (NORMALS):

My first problem is that the normals are wrong when I am using my normal map. I don't know what else to say about this, so I'll just show you some screenshots and the texture/rvmat files.

This is what it looks like rendered in Blender, so you know that the normals are in fact correct.

(please only download once, dropbox probably has a bandwidth limit)

Blender render

Here is what it looks like after an obj import to oxygen, shown in buldozer:

Buldozer after import

No problems yet!

Here is what it looks like with the rvmat applied (file included further down):

RVMAT applied

As you can see, I have bad normals now.

Here is what it looks like with the color texture applied:

RVMAT with color

I could be wrong, but my guess is that the rvmat file requires a NOHQ map, and what I have is a regular normal map?

If that is true, what's the difference between a NO map and a NOHQ map? I read the wiki article about NOHQ but I don't understand how the texture file is different. Do you have a higher bit depth? How do you guys generate NOHQ maps? Sorry if I have misunderstood. :(

Here is my normal map. It was painted in gimp, just filled the entire image with [128, 128, 255] purple because I want a completely flat normal map just so I know it works. I'll play around with adding bumps and grooves when it does :):

Normal map in PNG format

All my textures are converted to .paa using TexView 2.

Here is my RVMAT file:

RVMAT file

PROBLEM 2 (INVISIBILITY):

It's funny, as I write this, this problem seems to have fixed itself, but I'll describe it anyway so that if someone googles for this problem, they can find a fix.

I had a problem where I could apply the RVMAT file WITHOUT color texture, and the model would show up in Buldozer, but when I gave it a color texture, it disappeared completely. Then I tried adding additional geometry like a cube next to the model, and then I could see the model but it would be transparent and pink-tinted. This doesn't happen anymore, but it seems the problem was the Material Editor program. It saved the wrong settings and didn't overwrite my RVMAT files when I fixed them. The broken file had 0.29 in the alpha channel of the ambient color, and 0 in the diffuse color alpha (I swear I would never use those values myself, it has to be a corruption somewhere). I had to save the material to a new file for it to work.

thanks in advance,

Phlogios

---------- Post added at 05:25 AM ---------- Previous post was at 04:20 AM ----------

Problem 1 remains,

but here is what I found:

This code in the RVMAT file fixed the normals:

texture="#(argb,8,8,3)color(0.5,0.5,1,1)";

but now it is not using a normal map of course.

The fact that it works now makes my belief that my bit depth is wrong stronger.

Here's a new screenshot from buldozer showing the correct normals:

Correct normals

I am playing around with the reflective properties.

Another question has popped up:

In the Super Shader, I'm to specify a path to an environment map. How does this work? I thought the environment map was environment-specific, not material-specific.

Do I have to make an environment map for every model?

---------- Post added at 05:28 AM ---------- Previous post was at 05:25 AM ----------

...and here's another question:

I'm having a hard time finding fresnel constants for paint. This missile has green and blue paint sprayed over a metal surface. What fresnel constants are typically used for regular paint materials?

Edited by Phlogios

Share this post


Link to post
Share on other sites
Hi mates,

PROBLEM 1 (NORMALS):

My first problem is that the normals are wrong when I am using my normal map. I don't know what else to say about this, so I'll just show you some screenshots and the texture/rvmat files.

Looks like you might have to recalculate the normals of your model. Select all of the faces and press f5.

I could be wrong, but my guess is that the rvmat file requires a NOHQ map, and what I have is a regular normal map?

If that is true, what's the difference between a NO map and a NOHQ map? I read the wiki article about NOHQ but I don't understand how the texture file is different. Do you have a higher bit depth? How do you guys generate NOHQ maps? Sorry if I have misunderstood. :(

I think nohq is just a queue to tell the engine which normal map rendering technique to use. There is no difference between normal maps and nohq maps AFAIK.

Here is my normal map. It was painted in gimp, just filled the entire image with [128, 128, 255]

For that you can just use the procedural maps like you say you discovered below.

PROBLEM 2 (INVISIBILITY):

It's funny, as I write this, this problem seems to have fixed itself, but I'll describe it anyway so that if someone googles for this problem, they can find a fix.

I had a problem where I could apply the RVMAT file WITHOUT color texture, and the model would show up in Buldozer, but when I gave it a color texture, it disappeared completely.

Sounds like an alpha problem. Make sure you don't have an alpha channel, or it is completely white, and make sure your map suffix is _co, or _ca if you intend on having more complex alpha blending.

Then I tried adding additional geometry like a cube next to the model, and then I could see the model but it would be transparent and pink-tinted. This doesn't happen anymore, but it seems the problem was the Material Editor program. It saved the wrong settings and didn't overwrite my RVMAT files when I fixed them. The broken file had 0.29 in the alpha channel of the ambient color, and 0 in the diffuse color alpha (I swear I would never use those values myself, it has to be a corruption somewhere). I had to save the material to a new file for it to work.

Sounds like a selection masking issue. If you have faces selected, by default in buldozer, it will mask everything that is not selected in transparent red. You can tweak those settings in the buldozer menu.

This code in the RVMAT file fixed the normals:

texture="#(argb,8,8,3)color(0.5,0.5,1,1)";

but now it is not using a normal map of course.

The fact that it works now makes my belief that my bit depth is wrong stronger.

Try using

#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)

. I'm not sure what difference it will make, but it will identify your map as a high quality normal map.

In the Super Shader, I'm to specify a path to an environment map. How does this work? I thought the environment map was environment-specific, not material-specific.

AFAIK, the material map does not change depending on the environment. The environment map is a reflection map that contributes to the ambient lighting of the object, sort of like IBL.

Do I have to make an environment map for every model?

I would just use the same one for every model. Usually I point to one BIS has already provided, but this creates an external dependency.

I'm having a hard time finding fresnel constants for paint. This missile has green and blue paint sprayed over a metal surface. What fresnel constants are typically used for regular paint materials?

I set up something similar to plastic. Of course, this is an artistic exercise, not a material simulation exercise. Here is a good place to start: http://community.bistudio.com/wiki/Material_templates

Now, these mat templates seem to be based on the end result of the shader, not the actual native settings. So, these would exclude the influence of smdi maps. smdi maps multiply with the settings in the rvmat files per pixel, so if your map is predominantly 50% grey, and your specular colour is mostly 50% grey, the end result will be mostly 25% grey. When you tune the maps and the shaders, you're usually trying to get as much tonal range out of it as you can.

Share this post


Link to post
Share on other sites
Looks like you might have to recalculate the normals of your model. Select all of the faces and press f5.

Sorry, but you have misunderstood the problem. Look at the pictures. There is nothing wrong with my normals and the model renders 100% like it should in Buldozer. It's only when I use my normal map that I painted in GIMP that it breaks. Every pixel in the normal map is [128, 128, 255, 255]. :(

Here is my normal map. It was painted in gimp, just filled the entire image with [128, 128, 255]

For that you can just use the procedural maps like you say you discovered below.

The point of my post is that normal map TEXTURES (as in actually saved in .png on the disk) aren't working. I know that procedural maps work (as you can see if you look at the pictures) but I want a normal map. In the end, I'll want to bake a normal map from a higher quality model in Blender.

Sounds like an alpha problem. Make sure you don't have an alpha channel, or it is completely white, and make sure your map suffix is _co, or _ca if you intend on having more complex alpha blending.

I already told you what fixed the problem ;) I just had to save to a new RVMAT file.

Sounds like a selection masking issue. If you have faces selected, by default in buldozer, it will mask everything that is not selected in transparent red. You can tweak those settings in the buldozer menu.

Well that explains that. ;)

I'm not sure what difference it will make, but it will identify your map as a high quality normal map.

But the code you posted doesn't have a path to a normal map. :( And I'm not even sure my texture IS a HQ normal map, because I don't know what they are. All I know is that it should theoretically work as a tangent space normal map. I'm still inclined to believe that my bit depth is wrong, or that the shader converts the colors to vectors different than Blender.

AFAIK, the material map does not change depending on the environment.

So, if you have an environment map that looks like chernarus with trees and grass, your model will look bad on takistan. Defeats the purpose of the environment map IMO, but there's probably a technical limitation somewhere.

I would just use the same one for every model. Usually I point to one BIS has already provided, but this creates an external dependency.

Is there a way of pointing to it so that it grabs the file from the actual ArmA 2 directory, so that I don't have to store a duplicate for each model?

I set up something similar to plastic. Of course, this is an artistic exercise, not a material simulation exercise. Here is a good place to start: http://community.bistudio.com/wiki/Material_templates

Ah, that's very helpful :)

Share this post


Link to post
Share on other sites
Just so that you know, the convention for A2 is to use "Super" shaders (rvmats). All you need to know can be found here: http://forums.bistudio.com/showthread.php?t=77685

Yes, I am using a super shader now, but the problem remains.

---------- Post added at 05:42 PM ---------- Previous post was at 05:22 PM ----------

I think I have solved it!

The normal map wasn't following the texture naming convention, so it was converted wrong in TexView. Changed the input file's name and the output file's name and it seems to work.

---------- Post added at 05:46 PM ---------- Previous post was at 05:42 PM ----------

A solution to this problem remains missing:

Is there a way of pointing to it so that it grabs the file from the actual ArmA 2 directory, so that I don't have to store a duplicate for each model?

Share this post


Link to post
Share on other sites
Sorry, but you have misunderstood the problem. Look at the pictures. There is nothing wrong with my normals and the model renders 100% like it should in Buldozer. It's only when I use my normal map that I painted in GIMP that it breaks. Every pixel in the normal map is [128, 128, 255, 255]. :(

The point of my post is that normal map TEXTURES (as in actually saved in .png on the disk) aren't working. I know that procedural maps work (as you can see if you look at the pictures) but I want a normal map. In the end, I'll want to bake a normal map from a higher quality model in Blender.

I understood your post perfectly. It looked to me like a good avenue of elimination would be to recalculate the normals of the model in O2. If you want to argue how it's not the normals instead of selecting some faces and pressing f5, that's your choice.

I already told you what fixed the problem ;) I just had to save to a new RVMAT file.

Well that explains that. ;)

I'm not sure what you mean by 'that explains that'. You seemed to be confused about what the pink was. I have two goals here:

To help you understand the tools better. And to elicit responses that give me a better understanding of what your problems are.

But the code you posted doesn't have a path to a normal map. :(

The code I posted *is* a normal map. It is instructions to build a procedural map. It is a blank, one colour normal map in the form of RGB 127,127,255. The difference between your code and mine is that my code gives the engine an idea of what kind of information it is, nothing more.

And I'm not even sure my texture IS a HQ normal map, because I don't know what they are. All I know is that it should theoretically work as a tangent space normal map. I'm still inclined to believe that my bit depth is wrong, or that the shader converts the colors to vectors different than Blender.

Like I said in my previous post, is no difference between a nohq map and a normal map. The suffix just tells texview, buldozer, etc how to handle that file AFAIK.

So, if you have an environment map that looks like chernarus with trees and grass, your model will look bad on takistan. Defeats the purpose of the environment map IMO, but there's probably a technical limitation somewhere.

Will it look bad on Takistan? I think you should load up the editor and place a US Marines unit in Takistan and observe the effect. In my experience, the discrepancy in lighting between the env map and the actual environment seems to be not noticeable, especially when the env map is of similar colour to the surface it's displayed on.

Share this post


Link to post
Share on other sites
I understood your post perfectly. It looked to me like a good avenue of elimination would be to recalculate the normals of the model in O2. If you want to argue how it's not the normals instead of selecting some faces and pressing f5, that's your choice.

I did press F5, and it wasn't the solution because the normals of the model weren't the problem. Pressing F5 actually made it worse because Oxygen 2 joins split edges on recalculation.

I'm not sure what you mean by 'that explains that'.

You explained why it was pink and now I understand why it was pink. :)

In my experience, the discrepancy in lighting between the env map and the actual environment seems to be not noticeable, especially when the env map is of similar colour to the surface it's displayed on.

Ah, good point!

And I seem to have found instructions on how to get the ArmA 2 env map files, so case closed.

Share this post


Link to post
Share on other sites
I did press F5, and it wasn't the solution because the normals of the model weren't the problem. Pressing F5 actually made it worse because Oxygen 2 joins split edges on recalculation.

It shouldn't do that. I think this means there is a problem with the model. What export / import format are you using?

Perhaps if you merge near points it will stop doing that.

Edited by Max Power

Share this post


Link to post
Share on other sites

Merging points will do the exact same thing, because I'm not using Oxygen 2's smoothing calculations. I talked about this in another thread, here:

http://forums.bistudio.com/showthread.php?t=123383

This is getting off-topic ;) We are talking about a problem that I don't even have.

Edit: Actually, an admin should probably lock this thread, since all problems addressed have been solved, and the solutions are posted.

Edited by Phlogios

Share this post


Link to post
Share on other sites

Well, since there is more than just you on the forum, I think leaving it open for people with similar problems would be a good thing. Then you can tell people who have similar problems how you solved them.

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  

×