Jump to content
Sign in to follow this  
MrSanchez

How to add chrome/reflection to a weapon? (RVmats?)

Recommended Posts

So as my first weapon mod ever in ArmA 3 I made a revolver. I still suck at texturing so instead of (what I think is) an UV map I actually textured the gun using 4 different .paa texture-files (e.g. brass_co.paa, metal_co.paa, grip_co.paa, etc)
 
cdce83ff11b0a574929d5994f96346fc.png

As you can see it is quite shitty, but yer gotta start out somewhere, init?
Anyways, I am really really curious on how to make this thing shine like the real life variant (after all its metal), reference pic:

Griswold.jpg

 

 

My million dollar question is, how do I make it shiny/specular/glossy? I've looked at just about every RVMat tutorial on google that I could find but I am unable to get it right.

 

I think I'm already failing at the Oxygen part where I select my entire gun, press E for face properties and assign the rvmat as material. Because when I do that in conjunction with a bare-bone rvmat, I end up with an ENTIRELY black gun and 2500 lines of errors in the rvmat all looking like this:

13:11:03 Warning: gunnison\gunnison1860.p3d:1 Error while trying to generate ST for points: 2734, 3075, 2736
13:11:03 Warning: gunnison\gunnison1860.p3d:1 Error while trying to generate ST for points: 2722, 2299, 2777
13:11:04 Warning: gunnison\gunnison1860.p3d:VIEW_PILOT Error while trying to generate ST for points: 1468, 1448, 1469
13:11:04 Warning: gunnison\gunnison1860.p3d:VIEW_PILOT Error while trying to generate ST for points: 1469, 1448, 1447

Can someone help me out?

Share this post


Link to post
Share on other sites

When you say "bare bones RVMAT" what exactly do you mean? I'm guessing from your issue you don't have either an _smdi.paa (specular map) or _nohq.paa (normal map) assigned in the rvmat (More info HERE).

 

Also, regarding those error messages; They are nothing to do with the RVMAT but are "bad faces" within the model. By "bad faces" I mean faces that are made up of points that are of the same X, Y or Z coordinate and are basically a flat line with no 3d surface. I'm sure there is a technical term for such a face, however I am not too experienced with modelling outside of O2 so I don't know it.

Anyway, you can highlight these faces in O2 by going to 'STRUCTURE > CHECK FACES'. This will create a named selection called '* Cannot generate ST coordinates' It may then be easier to identify the issue with each such face.

Share this post


Link to post
Share on other sites

Hi,

Thanks for the answer.

I only have the 4 diffuse maps, nothing else, I was not aware I needed smdi and nohq for the glossy effect. Will I need one of them for every diffuse map?

And yeah the rvmat.. I removed stuff regarding stages because I thought I wouldn't need them, I guess I do need them?

Thanks for the faces tip, I'll see if I can fix that.

Written on my phone, sorry for any spelling mistakes.

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

Hi,

Thanks for the answer.

I only have the 4 diffuse maps, nothing else, I was not aware I needed smdi and nohq for the glossy effect. Will I need one of them for every diffuse map?

And yeah the rvmat.. I removed stuff regarding stages because I thought I wouldn't need them, I guess I do need them?

Thanks for the faces tip, I'll see if I can fix that.

Written on my phone, sorry for any spelling mistakes.

Kind regards,

Sanchez

Yeah, for each diffuse (in ArmA parlance, a _co.paa) you'll need a corresponding normal map and smdi (gloss) map. As for the RVMAT, yes you'll require the stage sections.

 

See below for a reasonably applicable rvmat sample you can feel free to use and edit as necessary where necessary.

class StageTI
{
	texture="#(argb,8,8,3)color(0.5,0,0,0,TI)";
};
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,1};
emmisive[]={0,0,0,0};
specular[]={1,1,1,1};
specularPower=25;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
	texture="SJB_HandgunPack_A3\Data\P220\p220_nohq.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage2
{
	texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage3
{
	texture="#(argb,8,8,3)color(0,0,0,0,MC)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage4
{
	texture="#(argb,8,8,3)color(1,1,1,1,AS)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage5
{
	texture="SJB_HandgunPack_A3\Data\P220\p220_smdi.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage6
{
	texture="#(ai,64,64,1)fresnel(1.61,1.4)";
	uvSource="none";
};
class Stage7
{
	texture="a3\data_f\env_land_co.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};

The Stage1 path, Stage 5 path and 'Specular Power' values you'll probably need to change :D

Share this post


Link to post
Share on other sites

Yeah, for each diffuse (in ArmA parlance, a _co.paa) you'll need a corresponding normal map and smdi (gloss) map. As for the RVMAT, yes you'll require the stage sections.

 

See below for a reasonably applicable rvmat sample you can feel free to use and edit as necessary where necessary.

class StageTI
{
	texture="#(argb,8,8,3)color(0.5,0,0,0,TI)";
};
ambient[]={1,1,1,1};
diffuse[]={1,1,1,1};
forcedDiffuse[]={0,0,0,1};
emmisive[]={0,0,0,0};
specular[]={1,1,1,1};
specularPower=25;
PixelShaderID="Super";
VertexShaderID="Super";
class Stage1
{
	texture="SJB_HandgunPack_A3\Data\P220\p220_nohq.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage2
{
	texture="#(argb,8,8,3)color(0.5,0.5,0.5,0.5,DT)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage3
{
	texture="#(argb,8,8,3)color(0,0,0,0,MC)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage4
{
	texture="#(argb,8,8,3)color(1,1,1,1,AS)";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage5
{
	texture="SJB_HandgunPack_A3\Data\P220\p220_smdi.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};
class Stage6
{
	texture="#(ai,64,64,1)fresnel(1.61,1.4)";
	uvSource="none";
};
class Stage7
{
	texture="a3\data_f\env_land_co.paa";
	uvSource="tex";
	class uvTransform
	{
		aside[]={1,0,0};
		up[]={0,1,0};
		dir[]={0,0,0};
		pos[]={0,0,0};
	};
};

The Stage1 path, Stage 5 path and 'Specular Power' values you'll probably need to change :D

 

Hi, thanks for the answer ;)

 

Are you sure I need a normal map for each diffuse? My model isn't baked or anything like that. I contacted a friend of mine who made a rifle before (he used a rvmat though is still pretty new to it as well), he said I didn't necessarily need a normal map.

What does the normal map have to do with the specular map/glossy in this case? I thought the normal map was just for fine details (making a low poly model look high poly).

 

P.S. Seems like I have a lot of messed up faces :P I would want to ignore it if it didn't spam the RPT every time with 2500 lines >.<

https://gyazo.com/479b27b6176b0103c010265dc9dcb48b

 

Kind regards,

Sanchez

Share this post


Link to post
Share on other sites

Yeah you don't technically NEED a normal-map for each diffuse, but you will require an rvmat for each. You can replace the texture path with some code:

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

I haven't tested that, but it might work.

You will however still require the SMDI, as this is what determines the shine/glossiness of the textures.

 

Also, regarding the messed up faces: Select them in O2 and view them in Buldozer - if you can't actually see the faces (i.e. they're 'internal' faces or otherwise hidden) you can simply just remove the faces. They're throwing errors because they're either 'flat' on 2 out of the 3 dimensions and are essentially just lines, or because the texture has been mapped to them in such a way that it is mapped from the edge rather than on the face.

 

Edited to include PuFu's correction.

Edited by Jackal326

Share this post


Link to post
Share on other sites

Yeah you don't technically NEED a normal-map for each diffuse, but you will require an rvmat for each. You can replace the texture path with some code:

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

I haven't tested that, but it might work.

You will however still require the SMDI, as this is what determines the shine/glossiness of the textures.

 

Also, regarding the messed up faces: Select them in O2 and view them in Buldozer - if you can't actually see the faces (i.e. they're 'internal' faces or otherwise hidden) you can simply just remove the faces. They're throwing errors because they're either 'flat' on 2 out of the 3 dimensions and are essentially just lines, or because the texture has been mapped to them in such a way that it is mapped from the edge rather than on the face.

blank (procedural color) for NOHQ is texture="#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";

 

You can also use a procedural SMDI "texture" if you want that the entire thing glossy, which you don't as far as i can tell

 

https://community.bistudio.com/wiki/Super_shader

https://community.bistudio.com/wiki/RVMAT_basics

Share this post


Link to post
Share on other sites

blank (procedural color) for NOHQ is texture="#(argb,8,8,3)color(0.5,0.5,1,1,NOHQ)";

 

You can also use a procedural SMDI "texture" if you want that the entire thing glossy, which you don't as far as i can tell

 

https://community.bistudio.com/wiki/Super_shader

https://community.bistudio.com/wiki/RVMAT_basics

Cheers PuFu, I've edited my original post to correct my mistake.

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  

×