Jump to content
Sign in to follow this  
[aps]gnat

CfgTextureToMaterial n CfgMaterials

Recommended Posts

Ok, can't seem to find anyone (or the Biki) explaining how CfgTextureToMaterial and CfgMaterials work .....

Can someone explain what each of the below lines does / can do ... (um .. maybe a small Tutorial ... pretty please)

And then maybe explain why my gunmetal grey plane seem to be very "washed out" on the sunlight side, not Shiny like I'm trying to get.

Quote[/b] ]class CfgTextureToMaterial

{

class GNTAn12Shine

{

textures[]=

{

"GNT_An12\an12_1.paa"

};

material=#GNTAn12_ShinyBody;

};

};

class CfgMaterials

{

class GNTAn12_ShinyBody

{

ambient[]={1.0,1.0,1.0,1.0};

diffuse[]={1.0,1.0,1.0,1.0};

forcedDiffuse[]={0,0,0,0};

specular[]={0.1,0.1,0.1,0.0};

specularPower=2;

emmisive[]={0,0,0,0};

};

};

Share this post


Link to post
Share on other sites

Ok, so:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class CfgTextureToMaterial

{

class GNTAn12Shine

{

textures[]=

{

"GNT_An12\an12_1.paa"

};

material=#GNTAn12_ShinyBody;

};

};

class CfgMaterials

{

class GNTAn12_ShinyBody

{

ambient[]={1.0,1.0,1.0,1.0};

diffuse[]={1.0,1.0,1.0,1.0};

forcedDiffuse[]={0,0,0,0};

specular[]={0.1,0.1,0.1,0.0};

specularPower=2;

emmisive[]={0,0,0,0};

};

};

if you see, all the numbers in {} are representing the RGBA colors

you must play with those numbers, see how RVMAT files have been written, and try, try try...

First of all, you missed the texture an12_1.paa

The code should be:

Quote[/b] ]class CfgMaterials

{

class GNTAn12_ShinyBody

{

ambient[] = {1.0, 1.0, 1.0, 1.0};

diffuse[] = {1.0, 1.0, 1.0, 1.0}; //CHANGED from {0.0, 0.0, 0.0, 1.0};

forcedDiffuse[] = {1.0, 1.0, 1.0, 1.0}; //CHANGED from {0.0, 0.0, 0.0, 1.0};

emmisive[] = {1.0, 1.0, 1.0, 1.0}; //CHANGED from {0.0, 0.0, 0.0, 1.0};

specular[] = {0.0, 0.0, 0.0, 1.0};

specularPower = 0.0;

PixelShaderID = "NormalMapDetailSpecularMap";

VertexShaderID = "NormalMap";

class Stage1

{

texture = "GNT_An12\an12_1_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

pos[] = {0.0, 0.0, 0.0};

};

};

class Stage2

{

texture = "GNT_An12\an12_1.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

pos[] = {0.0, 0.0, 0.0};

};

};

class Stage3

{

texture = "GNT_An12\an12_1_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

pos[] = {0.0, 0.0, 0.0};

};

};

};

};

If you see, I've just higlighted the files that you don't have still done: the normal map texture and the specular one.

To make the first one, you should use Normal map pugin for photoshop, to make the second one, you must use texView_2. HOW?

in this way:

Open up TexView_2, and open your texture (an12_1.paa), then go to Edit--> Filters... and load from subfolder "filters" (located in texview_2 folder) the file "specularMapFinish.bitfilt". Apply the filter, and wait till the program finishes to apply it to the texture.

Now, save the file with _smdi.paa extension.

ArmA RVMAT have you ever seen this one? wink_o.gif

Share this post


Link to post
Share on other sites

Very nice info Linker Split ... Thx  thumbs-up.gif

Thanks for the RVMAT link too .... looks familiar  wink_o.gif

Just 1 Q. though, is it possible to get a basic shine (like OFP) without having to do the normal map texture and the specular one ?

I ask cuz I hate textures enough already  whistle.gif EDIT and don't have PS

Share this post


Link to post
Share on other sites

Well, I think it's impossible, since I found that RVMAT files are only used to do NormMap and SpecMap...

for example there's this one:

Quote[/b] ]ambient[] = {0.8, 0.8, 0.8, 1.0};

diffuse[] = {0.7, 0.7, 0.7, 1.0};

forcedDiffuse[] = {0.2, 0.2, 0.2, 0.5};

emmisive[] = {0.0, 0.0, 0.0, 1.0};

specular[] = {0.04, 0.04, 0.04, 1.0};

specularPower = 20.0;

PixelShaderID = "NormalMapSpecularThrough";

VertexShaderID = "NormalMapSpecularThrough";

class Stage1 {

texture = "ca\plants\data\fikovnik2_0_non.paa";

uvSource = "tex";

class uvTransform {

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

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

};

};

class Stage2 {

texture = "#(ai,32,32,1)treeCrown(0.1)";

uvSource = "none";

};

class Stage3 {

texture = "#(ai,32,32,1)treeCrownAmb(0.3)";

uvSource = "none";

};

As you can see, there's the normal map texture fikovnik2_0_non.paa which has been applied the Specular map to (through Stage2 and stage3 that I still have to understand how and why they wrote that code)

wink_o.gif

Share this post


Link to post
Share on other sites

What about several config texture to material per single model/config? If there are several textures? - Possible?

EDIT: Yes very possible - found the solution.

Share this post


Link to post
Share on other sites

how about posting it as an example for others smile_o.gif

Share this post


Link to post
Share on other sites
What about several config texture to material per single model/config? If there are several textures? - Possible?

EDIT: Yes very possible - found the solution.

I'm kind of stuck on that one, too. So would you be so kind as to describe how you did it?

Thanks

Share this post


Link to post
Share on other sites

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgTextureToMaterial

{

class ofp2_Metal1

{

textures[] = {

"ofp2tank\ta\ofp2ta_2_co.paa"

};

material = "#ofp2_Metal1";

};

};

class CfgMaterials

{

class ofp2_Metal1

{

ambient[] = {1.0, 1.0, 1.0, 1.0};

diffuse[] = {1.0, 1.0, 1.0, 1.0};

forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0};

emmisive[] = {0.0, 0.0, 0.0, 1.0};

specular[] = {0.2, 0.3, 0.3, 0.6}; //{0.2, 0.3, 0.3, 0.6};

specularPower = 25.0;

PixelShaderID = "NormalMapDetailSpecularDIMap";

VertexShaderID = "NormalMap";

class Stage1 {

texture = "ofp2tank\ta\ofp2ta_2_co.paa";

uvSource = "tex";

class uvTransform {

aside[] = {1, 0, 0};

up[] = {0, 1, 0};

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

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

};

};

class Stage2 {

texture = "ofp2tank\ta\ofp2ta_2_nohq.paa";

uvSource = "tex";

class uvTransform {

aside[] = {3.0, 0.0, 0.0};

up[] = {0.0, 3.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

pos[] = {0.0, 0.0, 0.0};

};

};

class Stage3

{

texture = "ofp2tank\ta\ofp2ta_2_smdi.paa";

uvSource = "tex";

class uvTransform {

aside[] = {1, 0, 0};

up[] = {0, 1, 0};

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

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

};

};

};

};

class CfgVehicles

I havent tried multiples but i dont see why you cant define another material and continue . like ofp2_ffMetal2 etc ...

i have tried all ways and this works for me some say the nohq should be where i have _co but if it aint broke ,i guess.

p.s I believ this is also done by oxygen3 and there is another config inside the odolv40 that is produced along with rvmats. i dont know how strong the shine effects are without all this ,i have only redirected paths from bis models .

Share this post


Link to post
Share on other sites

to add multiple textures, do this:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgTextureToMaterial

{

class Car15_a

{

textures[] = {"bhd_t\car15\Car15_a.pac"};

material = "#Car15_a";

};

class M68_d

{

textures[] = {"bhd_t\car15\M68_d.pac"};

material = "#M68_d";

};

};

then simply:

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">

class CfgMaterials

{

class Car15_a

{

ambient[] = {1.0, 1.0, 1.0, 1.0};

//multiplies color values (color texture R,G,B,A) of the surface that is not lit by main directional light

diffuse[] = {1.0, 1.0, 1.0, 1.0};

//multiplies color values of the surface that is lit by main directional light.

forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0};

//these values help to simulate so called Translucency.

//Part of the diffuse lighting that is reflected on surface in shadow.

//It works similar to ambient but with different component of lighting.

emmisive[] = {0.0, 0.0, 0.0, 1.0};

//Also called Luminescence. Values give amount of light that surface shines by itself. Use it for light sources.

//It will appeal shining but will not light anything around it.

specular[] = {1, 1, 1, 1};

//Used for making so called hotspot (in max it is Specular level+specular color).

//It is part of the light that is reflected from surface.

//Specular is calculated per vertex or per pixel depending on specific shader.

specularPower = 50.0;

//Also called Glossiness. Defines how sharp the hotspot will be.

//Some shaders use IRRADIANCE TABLE instead of this value

PixelShaderID = "NormalMapSpecularDIMap";

VertexShaderID = "NormalMap";

class Stage1

{

texture = "BHD_t\NOHQ\Car15_a_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

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

};

};

class Stage2

{

texture = "BHD_t\SMDI\Car15_a_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

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

};

};

};

class M68_d

{

ambient[] = {1.0, 1.0, 1.0, 1.0};

diffuse[] = {1.0, 1.0, 1.0, 1.0};

forcedDiffuse[] = {0.0, 0.0, 0.0, 0.0};

emmisive[] = {0.0, 0.0, 0.0, 1.0};

specular[] = {1, 1, 1, 1};

specularPower = 50.0;

PixelShaderID = "NormalMapSpecularDIMap";

VertexShaderID = "NormalMap";

class Stage1

{

texture = "BHD_t\NOHQ\M68_d_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

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

};

};

class Stage2

{

texture = "BHD_t\SMDI\M68_d_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.0, 0.0, 0.0};

up[] = {0.0, 1.0, 0.0};

dir[] = {0.0, 0.0, 0.0};

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

};

};

};

};

Share this post


Link to post
Share on other sites

@Linker Split... and, so you're saying the text file values overide the p3d values ok? - cool, good to know, was wondering about that as i havn't tested it.

I guess the only thing then (until we have a ArmA mlod format) to watch is if you're creating 'more' materials that one specifies the correct number of 'stages' for that given 'Shader'.

I've been compiling a list of 'Pixel Shaders' here with a accompanying number of stages that is required. it's an incomplete list atm.

Quote[/b] ]Well, I think it's impossible, since I found that RVMAT files are only used to do NormMap and SpecMap...

for example there's this one:

... and, in some cases specify 'surface properties' through the use of a '.bisurf' file...

Share this post


Link to post
Share on other sites
I guess the only thing then (until we have a ArmA mlod format) to watch is if you're creating 'more' materials that one specifies the correct number of 'stages' for that given 'Shader'.

well, for what I know so far, materials in a RVMAT are composed by: _NOHQ file (the Normal map), the _SMDI file (the Specular map).

So the engine combines the information taken from those 2 files with the texture you use, and then it creates the ingame picture.

... and, in some cases specify 'surface properties' through the use of a '.bisurf' file...

well, the ".bisurf" file is used only for island... so no need to make a new file for a model (also cause i dunno how to implement a bisurf file into a model, or a config)

Share this post


Link to post
Share on other sites
I guess the only thing then (until we have a ArmA mlod format) to watch is if you're creating 'more' materials that one specifies the correct number of 'stages' for that given 'Shader'.

well, for what I know so far, materials in a RVMAT are composed by: _NOHQ file (the Normal map), the _SMDI file (the Specular map).

So the engine combines the information taken from those 2 files with the texture you use, and then it creates the ingame picture.

... and, in some cases specify 'surface properties' through the use of a '.bisurf' file...

well, the ".bisurf" file is used only for island... so no need to make a new file for a model (also cause i dunno how to implement a bisurf file into a model, or a config)

lol, thanks mate... wasn't really looking for 'what is a .rvmat file and what's it used for...' as i'm already well aware... and they do the whole gambit of materials not just 'normal' and 'specular'... the .bisurf is not only used for islands...

you're right to point out that 'new' models don't need to implement 'new' bisurf files... once ArmA modding becomes a bit more sophisticated i'm sure they will be made use of in some splendid ways...

Share this post


Link to post
Share on other sites
I guess the only thing then (until we have a ArmA mlod format) to watch is if you're creating 'more' materials that one specifies the correct number of 'stages' for that given 'Shader'.

well, for what I know so far, materials in a RVMAT are composed by: _NOHQ file (the Normal map), the _SMDI file (the Specular map).

So the engine combines the information taken from those 2 files with the texture you use, and then it creates the ingame picture.

... and, in some cases specify 'surface properties' through the use of a '.bisurf' file...

well, the ".bisurf" file is used only for island... so no need to make a new file for a model (also cause i dunno how to implement a bisurf file into a model, or a config)

lol, thanks mate... wasn't really looking for 'what is a .rvmat file and what's it used for...' as i'm already well aware... and they do the whole gambit of materials not just 'normal' and 'specular'... the .bisurf is not only used for islands...

you're right to point out that 'new' models don't need to implement 'new' bisurf files... once ArmA modding becomes a bit more sophisticated i'm sure they will be made use of in some splendid ways...

well m8, I still can't find a bisurf file used for a model...

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  

×