Jump to content
Sign in to follow this  
Indy

Using shaders in ArmA

Recommended Posts

Hi Indy, I've made a new weapon following your instructions about the shaders. But my weapon have no shadow? Do you have the same trouble with your LAW?

follow kegetys instructions above and it should work

Share this post


Link to post
Share on other sites

Thank for your discover about the use of shaders in arma.. but i have a question:

the _nohq file is the normalmap file and is easy to generate with nvidia plugin.. but what's the use of the _smdi ? Glossmap ? does anyone knows how to generate a proper one ?

thank smile_o.gif

sg552_shad.jpg

Share this post


Link to post
Share on other sites

What's exactly is a shader ? I don't see differences in the first screen or in others posted here.... sorry for dumb question...

band.gif ?? wink_o.gif

Share this post


Link to post
Share on other sites

I wonder if it would be possible, then, to create a flir script that applies different shader and texture properties to models, to make them lighter in colour than the background. This. in combination with the apperture script might make some clever flir images.

Share this post


Link to post
Share on other sites
Quote[/b] ]There is a new LOD, you can use it in O2 lite by creating a new LOD with resolution of 10000. In it should be the model used to make the shadow volume, it needs to not have any holes in it (O2 lite 'structure/topology/find non-closed' can be used to find these) and it must be made of only triangles... If the shadow LOD is incorrect you get a whole bunch of warnings in the rpt file.

Please excuse the noob question... So how would one go about creating this 'shadow volume'.

As per Keygety's quote above I obviously create a new LOD with resolution 10000. Yip got that.

Is this new LOD a copy of an existing LOD that is modified?

Or, is it a completely empty new LOD?

And, what goes in this LOD, specifically.

Is it an abstract of a more detailed LOD that is offset?

Basically I'm asking - How do I create a shadow LOD in O2 for an MLOD so as to bring it on over to ArmA?

Oh, and yes I did do forum searches for 'Shadows' and 'Shadow Volumes' prior to posting without significant hits.

Links or any info. to get me running in the right direction would be appreciated.

Cheers, Sy.

PS. On a slightly related topic... Anyone want to collaborate on deducing version 40 please let me know.

PS2. Oh... Keygetys... I can understand the relative ease with which you may have guessed or deduced a 'Shadow Volume LOD' was needed.... But, how on earth would you devine that it needed a resolution of specifically 10000?

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Those all go to step1.jpg

Share this post


Link to post
Share on other sites
but what's the use of the _smdi ? Glossmap ? does anyone knows how to generate a proper one ?

It's a specular map with higher bit depth apparently. Regular spec map I'm familiar with, but this I don't know what tools there is for. Anyone know?

Also, I'm having some glitches with a normal map. It's sort of flickering between on and off when moving around.

Here's how it looks on my model, top one is with and the other without normalmap. It changes depending on which angle it gets lit.

ak51gd8.th.jpg

Anyone know what's going on? Is it because I don't have a smdi yet or is it texture compression?

Share this post


Link to post
Share on other sites

i have a similar bug on my law although is less noticeable, i think that it's caused by the missing swizzle tag on our textures.

If you open a BIS normal map file in photoshop with Kegetys tools it will ask you if you want to apply swizzling.

I think it changes the way how Normal and Specular maps are handled by the engine. But of course i may be wrong, this is just a guess.

As for specular maps, i created a new file in photoshop with the background color value taken from a BIS specular map. I then added a new layer with my texture and modified the blending mode (i think to Highlights) so that only scratches and texts will be seen on the specular with white color. I don't think this is the right way of doing it but i guess that without some kind of tools it can't be done otherwise.

Share this post


Link to post
Share on other sites

Those all go to step1.jpg

top secret messages have to have some sort of security wink_o.gif

Fixed the links now, thanks.

Share this post


Link to post
Share on other sites
Guest

just a question, but is this the way i should do my Normal mapping, by adding the huge section inside my CFG for every object that needs the normal mapping... The reason why im asking is that I am about to start adding the Normal maps, and I have almost 140 objects that will get the BUMPmapping/normal maps.

I would like to avoid my CFG becoming a potential nightmare.

Share this post


Link to post
Share on other sites
just a question, but is this the way i should do my Normal mapping, by adding the huge section inside my CFG for every object that needs the normal mapping... The reason why im asking is that I am about to start adding the Normal maps, and I have almost 140 objects that will get the BUMPmapping/normal maps.

I would like to avoid my CFG becoming a potential nightmare.

Yes you have to do it for every texture that will need a normal\specular map. I think you should wait for some tools that will allow us to write materials directly in the p3d files and using the config way just for testing purpose

Share this post


Link to post
Share on other sites
Guest
just a question, but is this the way i should do my Normal mapping, by adding the huge section inside my CFG for every object that needs the normal mapping... The reason why im asking is that I am about to start adding the Normal maps, and I have almost 140 objects that will get the BUMPmapping/normal maps.

I would like to avoid my CFG becoming a potential nightmare.

Yes you have to do it for every texture that will need a normal\specular map. I think you should wait for some tools that will allow us to write materials directly in the p3d files and using the config way just for testing purpose

Cool thanks! that was the answer i was looking for...

Ribbit

Share this post


Link to post
Share on other sites
i have a similar bug on my law although is less noticeable...

Great tip, thanks! I made a quick and crude spec map with that pinkish background and it worked. The flickering stopped and everything.

ak52ii2.th.jpg

The shader values needs tweaking and the maps are just quick ugly ones for testing. But it works!

Now I just need to generate a proper normalmap from my highpoly mesh and sort out some smoothing.

Share this post


Link to post
Share on other sites

Hi! I'm trying to get shaders for a new model of hummer (some parts and textures from SEF's model,will be changed in future) , but I've some problems with them and I wonder if any of you could help me.

Normal Hummer :

http://img256.imageshack.us/img256.....th.jpg

"Shader" hummer:

http://img148.imageshack.us/img148.....th.jpg

http://img20.imageshack.us/img20.....th.jpg

Anyone could explain me how to solve this bug ?

Regards

Share this post


Link to post
Share on other sites
Hi! I'm trying to get shaders for a new model of hummer (some parts and textures from SEF's model,will be changed in future) , but I've some problems with them and I wonder if any of you could help me.....

I think you just overbrighted the specular map - make the "shining" parts a bit darker (i haved similiar problem), but i may be wrong confused_o.gif

Share this post


Link to post
Share on other sites

As it seems a lot of you are experimenting with this i've decided to release the law in the state it is now.

I haven't worked much on it since my last update as i didn't have a lot of time. Actually i think that the model should be redone with more polys especially for the tube, but it's just pointless doing it now, i just tested what i needed.

So if you want to take a look on how i did it here's a rapidshare mirror for the file.

http://rapidshare.com/files/23251398/IND_LAW.rar.html

Special thanks goes to Freshman that provided me reference photos of the tube and the sight texture i'm currently using.

Remember that this is alpha version, unfinished and with several issues, should be used just for testing purpose.

Share this post


Link to post
Share on other sites

I'm getting dark spots on with the 'fake' smdi map no matter what. Anyone got regular specular maps working?

ak5specdw4.jpg

I guess we'll have to wait for the tools to get quality specular maps.

Share this post


Link to post
Share on other sites

Hello All,

I've tried Indy's config and ok it worked. But I was able to define only one material, so how can i define 2 or more materials eg. metal and wood? I have tried many ways to write it in right config but write me error if have 2 materials defined. Sorry but my lack of knowledge of writing configs is limiting for me.

So again mz noobish question - can someone post working part of config with 2 or more materials defined with Indy's CfgMaterials.

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 SJB_M4A1_Part1

{

textures[] = {"SJB_M4TEST\tex\M4_Part1.paa"};

  material = "#SJB_M4A1_Part1";

};

    class SJB_M4A1_Part2

{

textures[] = {"SJB_M4TEST\tex\M4_Part2.paa"};

  material = "#SJB_M4A1_Part2";

};

    class SJB_M4A1_Attachments

{

textures[] = {"SJB_M4TEST\tex\M4_attach.paa"};

  material = "#SJB_M4A1_Attachments";

};

};

class CfgMaterials

{

  class SJB_M4A1_Part1

{

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

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

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

emmisive[] = {0.000000, 0.000000, 0.000000, 1.000000};

specular[] = {0.746000, 0.746000, 0.746000, 1.000000};

specularPower = 14.5000000; //60.00

PixelShaderID = "NormalMapSpecularDIMap";

  VertexShaderID = "NormalMap";

class Stage1

{

texture = "SJB_M4TEST\tex\M4_Part1_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

};

};

class Stage2

{

texture = "SJB_M4TEST\tex\M4_Part1_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

  };

  };

};

  class SJB_M4A1_Part2

{

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

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

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

emmisive[] = {0.000000, 0.000000, 0.000000, 1.000000};

specular[] = {0.746000, 0.746000, 0.746000, 1.000000};

specularPower = 14.5000000; //60.00

PixelShaderID = "NormalMapSpecularDIMap";

  VertexShaderID = "NormalMap";

class Stage1

{

texture = "SJB_M4TEST\tex\M4_Part2_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

};

};

class Stage2

{

texture = "SJB_M4TEST\tex\M4_Part2_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

  };

  };

};

  class SJB_M4A1_Attachments

{

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

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

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

emmisive[] = {0.000000, 0.000000, 0.000000, 1.000000};

specular[] = {0.746000, 0.746000, 0.746000, 1.000000};

specularPower = 14.5000000; //60.00

PixelShaderID = "NormalMapSpecularDIMap";

  VertexShaderID = "NormalMap";

class Stage1

{

texture = "SJB_M4TEST\tex\M4_attach_nohq.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

};

};

class Stage2

{

texture = "SJB_M4TEST\tex\M4_attach_smdi.paa";

uvSource = "tex";

class uvTransform

{

aside[] = {1.000000, 0.000000, 0.000000};

up[] = {0.000000, 1.000000, 0.000000};

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

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

  };

  };

};

};

Thats the code for my M4A1s to test out the normal maps etc. Also, for the SMDI file,s I just used a pink layer (colour code: ff29ff), with 90% opacity, blending it with only the red and blue layers (not green), so it worked quite well.

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  

×