Jump to content
Sign in to follow this  
.granQ.

Cfgtexturetomaterial only for mods?

Recommended Posts

wanted to have the CfgTextureToMaterial thing to our models, i am 99% sure i made "right".. of course could be wrong path i linked to and such, but i still don't see any diffrence, so now i wonder is this just for mods, or could you define just for one addon?

Share this post


Link to post
Share on other sites

It should work with addons as well. Post your CfgTextureToMaterial config here, and someone may be able to see what you are doing wrong.

Share this post


Link to post
Share on other sites

I've played with cfgtexturematerials too and I couldn't see any changes.I'd like to see a working example

Share this post


Link to post
Share on other sites
Quote[/b] ]Will it work with terrain textures too

No, it will not. Only .p3d models use this.

Note: When applied to binarized models, CfgTextureToMaterial should already be present when binarizing.

Share this post


Link to post
Share on other sites
Quote[/b] ]I'd like to see a working example

There is a working example in the main config - AH1 cobra is done using this. I am not sure I understand what part are you missing.

Share this post


Link to post
Share on other sites

Is there any description of what the values in CfgMaterials cause? I messed around with it a bit, but can't really find it out.

<table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">ambient[] = {1,1,1,1};

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

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

specular[] = {0.8,0.8,0.8,0};

specularPower = 20;

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

What do they stand for?

Share this post


Link to post
Share on other sites

hmm, do you mean i have to binarize it together with the code?

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

class CfgTextureToMaterial

{

class SFPMetal

{

textures[]=

{

"\sfp_ikv91\ikv91.paa",

"\sfp_ikv91\ikv91turret.paa",

"\sfp_ikv91\barrel.paa",

"\sfp_ikv91\details.pac"

};

material=#SFPMetal;

};

};

class CfgMaterials

{

class SFPMetal

{

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

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

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

specular[] = {0.2,0.2,0.2,0};

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

specularPower = 5;

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

};

};

very small code, since i am just testing..

Share this post


Link to post
Share on other sites
Quote[/b] ]I'd like to see a working example

There is a working example in the main config - AH1 cobra is done using this. I am not sure I understand what part are you missing.

OK my bad, I think that was the example I used,I will get back at it sometime.

Thanx

Share this post


Link to post
Share on other sites
hmm, do you mean i have to binarize it together with the code?

I think he means you can't binarize your model,then later on add the changes to the .cpp

Can't add it to a already binarized model

Share this post


Link to post
Share on other sites

I had tried this ages ago, but didn't realise it had to be binarized: Note some parts have not had the effect applied to show the difference.

shshiney.jpg

Share this post


Link to post
Share on other sites

now i tested have the code on binned models, on models that isn't binned, and to have the code, and bin the model with it.. nothing works..

maybe "metal" is the default stuff so thats why i see no diffrence.

but can someone explain just what is right and what is not.

Share this post


Link to post
Share on other sites

.granQ. This is the code i used to get the effect in the pics (updated one below)

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

{

class Flkmat_Seaharrier_Chrome

{

textures[]=

{

"FLKseaharrier\tex\sideR.pac", "FLKseaharrier\tex\sideL.pac",

"FLKseaharrier\tex\PtWing.pac","FLKseaharrier\tex\PtWingL.pac",

"FLKseaharrier\tex\stWing.pac","FLKseaharrier\tex\stWingL.pac",

"FLKseaharrier\tex\tailL.pac","FLKseaharrier\tex\tailR.pac",

"FLKseaharrier\c\tailwng.pac","FLKseaharrier\c\wheel.pac",

"FLKseaharrier\c\ord.pac","FLKSeaHarrier\c\parts.pac"

};

material="#FLKSH_Chromed";

};

class Flkmat_Missile_Chrome

{

textures[]=

{

"FLKseaharrier\S\aim9fin.pac","FLKseaharrier\S\aim-9L.pac",

"FLKseaharrier\S\aim-9Lfin.pac"

};

material="#FLKSH_Chromed";

};

};

class CfgMaterials

{

class FLKSH_Chromed

{

ambient[]={.8,.8,.9,1};

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

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

specular[]={0.720000,0.700000,0.80000,0};

specularPower=20;

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

};

};

shshiney2.jpg

Share this post


Link to post
Share on other sites

ohh, now i think i see the error..

you have:

myaddon\mytexture.paa

and i have

\myaddon\mytexture.paa

thank you, got some new energy now, gonna try ;)

Share this post


Link to post
Share on other sites
biggrin_o.gif Sometimes its the little things that create the biggest problems. Post your result here for us to see.

Share this post


Link to post
Share on other sites

Looking good.

I just tried the effect on the black lincoln, and the result is pretty good, except getting the sharp and rounded vertices correct is a royal pain in the ass. (and that aint no donkey smile_o.gif )

Share this post


Link to post
Share on other sites
Guest

If you want to see a good working example of all this, then download Agent Smith's AGS_INDS.pbo smile_o.gif Some very nice work there. wink_o.gif

Share this post


Link to post
Share on other sites

Thanks Col. Klink & Suma for your help and examples. With Col. Klinks settings I was able to make this kind of stuff:

Hawk4.jpg

Note the yellow "stain" on the wing, reflection from the muzzle flashes, just too bad it's just on one side.

Hawk7.jpg

Share this post


Link to post
Share on other sites

waitta minute!!!!!!!!!!!!!!!

" ambient[]={.8,.8,.9,1};

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

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

specular[]={0.720000,0.700000,0.80000,0};

specularPower=20;

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

.......we can make mirror ( reflection) effects here???!!!!! wow_o.gif

Share this post


Link to post
Share on other sites

As far as I know, the effect wont go as far as to create a true mirror-like reflection unfortunately.

For example here I've turned the specular levels really high (a bit too high infact)

redsupershiny.jpg

-as far as I can tell, a really high shine level will get sharper, but it tends to expose all the separate polygons on the model sad_o.gif

Share this post


Link to post
Share on other sites

I'm trying to get this to work, but I'm having zero success. Here's what my cfg sections look like:

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

{

class PRA_Weapons

{

textures[]=

{

"pra_sof\t\m4.pac","pra_sof\t\m68.pac","pra_sof\t\m68_mt.pac","pra_sof\t\m68mt.pac",

"pra_sof\t\mag.pac","pra_sof\t\peq.pac","pra_sof\t\reflex.pac","pra_sof\t\ris2.pac",

"pra_sof\t\ris_1.pac","pra_sof\t\grip.pac"

};

material="#PRA_RifleMetal";

};

};

class CfgMaterials

{

class PRA_RifleMetal

{

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

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

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

specular[]={0.7200000,0.7200000,0.7200000,0};

specularPower=10

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

};

};

I can't see that I'm doing anything wrong there. If that's the case, could it be an issue with Oxygen? A particular setting that the models needs to have? I have binarized the addon, but still no luck. sad_o.gif

Share this post


Link to post
Share on other sites

Para - It looks okay.

Have you copied the ODOL p3d back into the PBO?

Do you have hardware T&L enabled in OFP: Preferences?

Have you tried setting the PRA_Weapons Material to one of

the built in materials (Metal, SpecularGlass, etc)?

Is this _outside_ any other Cfg scope?

Share this post


Link to post
Share on other sites

Yes, I've put the ODOL in the PBO.

Yes, Hardware T&L is on - BIA weapons, and even my own character models have proper lighting. Just not my weapons.

I'm not sure what you mean by being outside any other CFG scope. My texuretomaterials section is the 1st section after the common defines.

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  

×