PDA

View Full Version : Using shaders in ArmA



Indy
Dec 10 2006, 10:53
Hi all, maybe you already know that but since there isn't a topic about this i decided to share with you some things i discovered...
First of all i was trying to convert some old addons i did for OFP to ArmA and i was searching for a way to implement normal and specular maps on my models so i took a look at those new rvmat files. Since without the proper tools we are unable to use them as they are used directly by the p3d i began searching for another way. I remembered the old cfgTextureToMaterial that we were using in OFP to add shiny effects on our models and i noticed that some new materials in ArmA do look exactly like the rvmat files. So i tryied to do my own material based on the Javelin rvmat file and i tested it over a BIS LAW model imported from ofp. Here's how it looks like with a fast normal map done with nvidia plugin for photoshop.

http://img164.imageshack.us/img164/8734/law2qi4.th.jpg (http://img164.imageshack.us/my.php?image=law2qi4.jpg)

And here's the code to add on your config:
Note that you'll have to recalculate normals on your p3d


Quote[/b] ]
class CfgTextureToMaterial
{
class LAWMetal
{
textures[] = {"LAW_TEST\law_side.pac"};
material = "#LAWMetal";
};
};

class CfgMaterials
{
class LAWMetal
{
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 = 60.000000;
PixelShaderID = "NormalMapSpecularDIMap";
VertexShaderID = "NormalMap";
class Stage1 {
texture = "LAW_TEST\LAW_side_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 = "LAW_TEST\LAW_side_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};
};
};
};
};


I'm not going to release this as it was just a test to see if it was possible for us to use normal maps before the official tools are released. Hope you found this usefull.

Ti0n3r
Dec 10 2006, 10:58
Woh, that looks pretty good for a 2001 model. Cheers! http://forums.bistudio.com/oldsmileys/biggrin_o.gif

AtStWalker
Dec 10 2006, 10:59
bravo ! great ! http://forums.bistudio.com/oldsmileys/yay.gif

Ian Malcolm
Dec 10 2006, 13:14
Nice! That's great discovery http://forums.bistudio.com/oldsmileys/smile_o.gif

Commando84
Dec 10 2006, 16:41
great discovery, this might help addon people alot http://forums.bistudio.com/oldsmileys/smile_o.gif

Indy
Dec 10 2006, 20:31
another thing that might come useful: by adding a point in the memory lod with selection name "eye" in the position where the eye should look it is possible to use 3d optics on custom addons.

http://img236.imageshack.us/img236/4026/eyeyn7.th.jpg (http://img236.imageshack.us/my.php?image=eyeyn7.jpg) http://img300.imageshack.us/img300/2835/eye2lo4.th.jpg (http://img300.imageshack.us/my.php?image=eye2lo4.jpg)

Chipper
Dec 11 2006, 04:57
Great finds! http://forums.bistudio.com/oldsmileys/yay.gif

Sgt_Eversmann
Dec 11 2006, 07:34
wicked http://forums.bistudio.com/oldsmileys/thumbs-up.gif
too bad that ofp models have that many single textures for one model, would be great to have a M16A4 that just uses maybe 2 Textures and not sharing 5-6 textures. http://forums.bistudio.com/oldsmileys/confused_o.gif

Johannes
Dec 11 2006, 10:23
wicked  http://forums.bistudio.com/oldsmileys/thumbs-up.gif
too bad that ofp models have that many single textures for one model, would be great to have a M16A4 that just uses maybe 2 Textures and not sharing 5-6 textures. http://forums.bistudio.com/oldsmileys/confused_o.gif
what about using the "merge textures" function from O˛ ?

http://www.flashpoint1985.com/cgi-bin....extures (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=50;t=39454;hl=merge+and+textures)

its working very well!

Sgt_Eversmann
Dec 11 2006, 10:55
sounds abit complicated with all that coordinates and uvmapping stuff http://forums.bistudio.com/oldsmileys/confused_o.gif

Sennacherib
Dec 11 2006, 11:27
wicked http://forums.bistudio.com/oldsmileys/thumbs-up.gif
too bad that ofp models have that many single textures for one model, would be great to have a M16A4 that just uses maybe 2 Textures and not sharing 5-6 textures. http://forums.bistudio.com/oldsmileys/confused_o.gif
what about using the "merge textures" function from O˛ ?

http://www.flashpoint1985.com/cgi-bin....extures (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=50;t=39454;hl=merge+and+textures)

its woriking very well!
if your uvmapping is good, you don't need to do that. http://forums.bistudio.com/oldsmileys/smile_o.gif

DM
Dec 11 2006, 11:33
wicked http://forums.bistudio.com/oldsmileys/thumbs-up.gif
too bad that ofp models have that many single textures for one model, would be great to have a M16A4 that just uses maybe 2 Textures and not sharing 5-6 textures. http://forums.bistudio.com/oldsmileys/confused_o.gif
what about using the "merge textures" function from O˛ ?

http://www.flashpoint1985.com/cgi-bin....extures (http://www.flashpoint1985.com/cgi-bin/ikonboard311/ikonboard.cgi?act=ST;f=50;t=39454;hl=merge+and+textures)

its woriking very well!
if your uvmapping is good, you don't need to do that. http://forums.bistudio.com/oldsmileys/smile_o.gif
He was refering to using the texmerge function to reduce the texture count on OFP models, making them more "suitable" for use in ArmA (tho why you'd ever want to http://forums.bistudio.com/oldsmileys/tounge2.gif )

MehMan
Dec 11 2006, 13:51
if your uvmapping is good, you don't need to do that. http://forums.bistudio.com/oldsmileys/smile_o.gif
QFT!

I never understood why they said that my texture count was low when I said I have 3 textures on a large plane.

Then I opened up another addon to discover that it has 4 textures for the fuselage itself.

Ineffective uvmapping IMO.

Norsu
Dec 11 2006, 16:31
Then I opened up another addon to discover that it has 4 textures for the fuselage itself.

Ineffective uvmapping IMO.
You can't do much in Oxygen. You can limit texcount with texmerge function but their uv mapping is still bad http://forums.bistudio.com/oldsmileys/sad_o.gif. Hopefully the new Oxygen has a better solution http://forums.bistudio.com/oldsmileys/smile_o.gif.

MehMan
Dec 11 2006, 16:44
But there are other, better, free applications, such as LithUnwrap. You can use a p3d2obj converter or p3d2ms converter and unwrap it there, ofcourse merging the model into one large group first. Then you can import it back to o2 via the 3ds importer.

ohara
Dec 12 2006, 15:33
New objective have unwrap function, but in old texmerge you still can merge textures, generate ptm file and load this file to O2, that will autamaticaly merge textures in all lods by definition in ptm file (this also posible in o3 - new objective)

Messiah
Dec 12 2006, 15:39
how good is this unwrap function though? http://forums.bistudio.com/oldsmileys/tounge2.gif

ohara
Dec 12 2006, 15:43
Its basic unwrap, main advatage is that u dont need to go back to max to maya if you want something remap, another good think is that it support multiple UV sets, so u can for example separately unwrap normal map or macro map with diferent UV in diferent layer from one material.

Messiah
Dec 12 2006, 15:46
aaah, that sounds good - I wasn't looking forward to having to learn unwrap in 3dsMax for the sake of modding in Arma, so this sound much better (assuming its easy enough to get to grips with)

Indy
Dec 12 2006, 18:55
Its basic unwrap, main advatage is that u dont need to go back to max to maya if you want something remap, another good think is that it support multiple UV sets, so u can for example separately unwrap normal map or macro map with diferent UV in diferent layer from one material.
that's what oxygen was missing http://forums.bistudio.com/oldsmileys/biggrin_o.gif can i ask you how are the new shadows handled in the p3d? I've been trying to make them work but without success. My guess is that there is a new lod dedicated for shadows but i'm not sure about this. Also i noticed that now weapon models do have "component" selections but i can't figure out in which lod and for what purpose. Is this related to shadows or to some other feature?

Kegetys
Dec 12 2006, 19:38
that's what oxygen was missing  http://forums.bistudio.com/oldsmileys/biggrin_o.gif can i ask you how are the new shadows handled in the p3d? I've been trying to make them work but without success. My guess is that there is a new lod dedicated  for shadows but i'm not sure about this.
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.

Indy
Dec 12 2006, 20:13
that's what oxygen was missing http://forums.bistudio.com/oldsmileys/biggrin_o.gif can i ask you how are the new shadows handled in the p3d? I've been trying to make them work but without success. My guess is that there is a new lod dedicated for shadows but i'm not sure about this.
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.
thanks it worked http://forums.bistudio.com/oldsmileys/biggrin_o.gif

ohara
Dec 13 2006, 09:57
Its little bit complicated, we can use 3 diferent kind of shadows. From original OFP u know CPU shadows, they are now used as hybrid shadows for vegetatin and they are casted on lanscape , when stencil shadows are casted on objects. Hybrid and stencil shadows are used when shadow detail are normal or lower, otherwise shadow buffer shadows (SB) are used. CPU shadows are same as was in OFP, stencil shadows use special lods as Kegetis wrote and there could be more stencil shadow lods with diferent detail. stencil shadows must be triangulated, must use sharp edges, model for shadow must have volume (must be closed). SB shadows have also special lod number and could by normal model (simplified), its good if have just one section, not using any materials. There must be property in geometry lod that will say what kind of shadow lod in what situation will be used. We will add full documentation to biki.

Messiah
Dec 13 2006, 10:28
We will add full documentation to biki.
aaah, excellent... I was already getting quite overwhelmed with the projected learning curve as it was

Occitania
Dec 16 2006, 17:55
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?

http://i82.photobucket.com/albums/j262/mateu_oc/arma_frinf1.jpg

Indy
Dec 16 2006, 20:10
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

Occitania
Dec 16 2006, 22:56
http://forums.bistudio.com/oldsmileys/banghead.gif I'm fukin' blind.... Thanks It's working fine http://forums.bistudio.com/oldsmileys/wink_o.gif

DarkGiver
Mar 18 2007, 17:20
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 http://forums.bistudio.com/oldsmileys/smile_o.gif


http://www.darkgiver.ch/images/sg552_shad.jpg

caprera
Mar 18 2007, 19:03
What's exactly is a shader ? I don't see differences in the first screen or in others posted here.... sorry for dumb question...


http://forums.bistudio.com/oldsmileys/band.gif ?? http://forums.bistudio.com/oldsmileys/wink_o.gif

Max Power
Mar 18 2007, 21:44
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.

Sgt_Eversmann
Mar 19 2007, 06:54
What's exactly is a shader ? I don't see differences in the first screen or in others posted here.... sorry for dumb question...


http://forums.bistudio.com/oldsmileys/band.gif ?? http://forums.bistudio.com/oldsmileys/wink_o.gif
What is a shader (http://en.wikipedia.org/wiki/Main_Page)

Synide
Mar 26 2007, 07:32
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?

granQ
Mar 26 2007, 08:08
just make a version of what you want to be "shadow", and be sure to use tringalate and after you done that be sure to reverse the model (Press W).

http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg
http://d5914232.u93.surftown.se/images/articles/shadow_step2.jpg
http://d5914232.u93.surftown.se/images/articles/shadow_step3.jpg
http://d5914232.u93.surftown.se/images/articles/shadow_step4.jpg

Synide
Mar 26 2007, 08:50
Thanks

Max Power
Mar 26 2007, 11:20
just make a version of what you want to be "shadow", and be sure to use tringalate and after you done that be sure to reverse the model (Press W).

http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg
http://d5914232.u93.surftown.se/images/articles/shadow_step2.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
http://d5914232.u93.surftown.se/images/articles/shadow_step3.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
http://d5914232.u93.surftown.se/images/articles/shadow_step4.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
Those all go to step1.jpg

Shadow NX
Mar 26 2007, 12:22
just exchange the number on the link http://forums.bistudio.com/oldsmileys/tounge2.gif

Gux
Mar 26 2007, 15:59
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.
http://img129.imageshack.us/img129/6585/ak51gd8.th.jpg (http://img129.imageshack.us/my.php?image=ak51gd8.jpg)

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

Indy
Mar 27 2007, 09:07
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.

granQ
Mar 27 2007, 09:58
just make a version of what you want to be "shadow", and be sure to use tringalate and after you done that be sure to reverse the model (Press W).

http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg
http://d5914232.u93.surftown.se/images/articles/shadow_step2.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
http://d5914232.u93.surftown.se/images/articles/shadow_step3.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
http://d5914232.u93.surftown.se/images/articles/shadow_step4.jpg (http://d5914232.u93.surftown.se/images/articles/shadow_step1.jpg)
Those all go to step1.jpg
top secret messages have to have some sort of security http://forums.bistudio.com/oldsmileys/wink_o.gif

Fixed the links now, thanks.

Mar 27 2007, 14:51
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.

Indy
Mar 27 2007, 15:19
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

Mar 27 2007, 17:37
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

Gux
Mar 27 2007, 19:17
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.

http://img339.imageshack.us/img339/7427/ak52ii2.th.jpg (http://img339.imageshack.us/my.php?image=ak52ii2.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.

ba2
Mar 28 2007, 09:23
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 :
[IMG]http://img256.imageshack.us/img256.....th.jpg (http://img256.imageshack.us/my.php?image=arma2007032811003981gw8.jpg)

"Shader" hummer:
[IMG]http://img148.imageshack.us/img148.....th.jpg (http://img148.imageshack.us/my.php?image=arma2007032811003781wf9.jpg)
[IMG]http://img20.imageshack.us/img20.....th.jpg (http://img20.imageshack.us/my.php?image=arma2007032811002985px2.jpg)

Anyone could explain me how to solve this bug ?

Regards

s8n
Mar 28 2007, 09:30
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 http://forums.bistudio.com/oldsmileys/confused_o.gif

Indy
Mar 28 2007, 22:05
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.

Gux
Mar 29 2007, 17:02
I'm getting dark spots on with the 'fake' smdi map no matter what. Anyone got regular specular maps working?
http://img232.imageshack.us/img232/1747/ak5specdw4.jpg (http://imageshack.us)

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

ubernoober
Mar 30 2007, 06:26
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.

Jackal326
Mar 30 2007, 06:59
<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&#91;&#93; = {&#34;SJB_M4TEST&#92;tex&#92;M4_Part1.paa&#34;};
  material = &#34;#SJB_M4A1_Part1&#34;;
};

    class SJB_M4A1_Part2
{
textures&#91;&#93; = {&#34;SJB_M4TEST&#92;tex&#92;M4_Part2.paa&#34;};
  material = &#34;#SJB_M4A1_Part2&#34;;
};

    class SJB_M4A1_Attachments
{
textures&#91;&#93; = {&#34;SJB_M4TEST&#92;tex&#92;M4_attach.paa&#34;};
  material = &#34;#SJB_M4A1_Attachments&#34;;
};
};

class CfgMaterials
{
  class SJB_M4A1_Part1
{
ambient&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
diffuse&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
forcedDiffuse&#91;&#93; = {0.000000, 0.000000, 0.000000, 0.000000};
emmisive&#91;&#93; = {0.000000, 0.000000, 0.000000, 1.000000};
specular&#91;&#93; = {0.746000, 0.746000, 0.746000, 1.000000};
specularPower = 14.5000000; //60.00
PixelShaderID = &#34;NormalMapSpecularDIMap&#34;;
  VertexShaderID = &#34;NormalMap&#34;;

class Stage1
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_Part1_nohq.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
};
};

class Stage2
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_Part1_smdi.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
  };
  };
};

  class SJB_M4A1_Part2
{
ambient&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
diffuse&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
forcedDiffuse&#91;&#93; = {0.000000, 0.000000, 0.000000, 0.000000};
emmisive&#91;&#93; = {0.000000, 0.000000, 0.000000, 1.000000};
specular&#91;&#93; = {0.746000, 0.746000, 0.746000, 1.000000};
specularPower = 14.5000000; //60.00
PixelShaderID = &#34;NormalMapSpecularDIMap&#34;;
  VertexShaderID = &#34;NormalMap&#34;;

class Stage1
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_Part2_nohq.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
};
};

class Stage2
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_Part2_smdi.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
  };
  };
};

  class SJB_M4A1_Attachments
{
ambient&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
diffuse&#91;&#93; = {1.000000, 1.000000, 1.000000, 1.000000};
forcedDiffuse&#91;&#93; = {0.000000, 0.000000, 0.000000, 0.000000};
emmisive&#91;&#93; = {0.000000, 0.000000, 0.000000, 1.000000};
specular&#91;&#93; = {0.746000, 0.746000, 0.746000, 1.000000};
specularPower = 14.5000000; //60.00
PixelShaderID = &#34;NormalMapSpecularDIMap&#34;;
  VertexShaderID = &#34;NormalMap&#34;;

class Stage1
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_attach_nohq.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
};
};

class Stage2
{
texture = &#34;SJB_M4TEST&#92;tex&#92;M4_attach_smdi.paa&#34;;
uvSource = &#34;tex&#34;;
class uvTransform
{
aside&#91;&#93; = {1.000000, 0.000000, 0.000000};
up&#91;&#93; = {0.000000, 1.000000, 0.000000};
dir&#91;&#93; = {0.000000, 0.000000, 0.000000};
pos&#91;&#93; = {0.000000, 0.000000, 0.000000};
  };
  };
};
};[/QUOTE]

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.

ubernoober
Mar 30 2007, 07:15
Realy thanks for quick reply Jackal326.

Sennacherib
Mar 30 2007, 07:16
do you have a specular texture? (greyscale specular texture)

Jackal326
Mar 30 2007, 07:19
Here is the texture colour map:
http://sjb.gotf.net/weaponspack/M4_Part1.jpg

And here is the SMDI Specular Map:
http://sjb.gotf.net/weaponspack/M4_Part1_smdi.jpg

ubernoober
Mar 30 2007, 07:22
Yesterday i&#39;ve looked in the MechaStalin&#39;s BMD-1 textures and when I opened his specular or normal textures in PhotoShop it asked for that Swizzling (wtf is that btw?) like original BIS textures. How can we do it that way? It would be great if he (or someone that knows lot about this) can share his knowledge with us.

Thx

ubernoober
Mar 30 2007, 07:26
Oh and one another question - do you guys using the color map (like that nice Jackals above) for creating normal map with nvidia filter or you create new grayscale texture and then you applies nvidia filter for creating bumps?

Sennacherib
Mar 30 2007, 07:47
@<hidden> why do use a color map? you just need a normal map and a greyscale specular map (to make the lights on your object).


Quote[/b] ]do you guys using the color map (like that nice Jackals above) for creating normal map with nvidia filter or you create new grayscale texture and

no and no, you can&#39;t use a simple greyscale texture to make a normal map. you need to draw with grey, black, white colors the details of your textures (bolts etc). then you can use the filter. a normal map must no have colors.

quick example:

http://img264.imageshack.us/img264/1105/bumpeo8.th.jpg (http://img264.imageshack.us/my.php?image=bumpeo8.jpg)
http://img257.imageshack.us/img257/7554/bumpmapdd8.th.jpg (http://img257.imageshack.us/my.php?image=bumpmapdd8.jpg)

pic1-- greyscale bump texture
pic2-- normal map (i use the nvidia filter)

http://forums.bistudio.com/oldsmileys/smile_o.gif

Max Power
Mar 30 2007, 08:14
Oh and one another question - do you guys using the color map (like that nice Jackals above) for creating normal map with nvidia filter or you create new grayscale texture and then you applies nvidia filter for creating bumps?
The nvidia tool converts bump maps to normal maps. A bump map is a map that provides height information in a colourless gradient. Black = Low and White = High. So, for best effect, you would redraw everything so that stuff gets lighter as it gets higher, then convert it to a normal map. The preferred method for normal map generation is to use a high poly model for normal information and apply it to a low poly model.

There are tuts out there that tell you all about how the 3 colour channels work for a normal map and how to effectively edit them, but I can&#39;t seem to find them again. If you want to edit a normal map by hand, you&#39;ll have to look around a bit&#33;

Sennacherib
Mar 30 2007, 08:38
Quote[/b] ]The preferred method for normal map generation is to use a high poly model for normal information and apply it to a low poly model.

no, the two methods are great, because each can be use use for different things.

example: the high polys method is excellent to create a character, but if you need only bolts on a hull, the bump map method is the easy way. http://forums.bistudio.com/oldsmileys/smile_o.gif

Max Power
Mar 30 2007, 19:31
Quote[/b] ]The preferred method for normal map generation is to use a high poly model for normal information and apply it to a low poly model.

no, the two methods are great, because each can be use use for different things.

example: the high polys method is excellent to create a character, but if you need only bolts on a hull, the bump map method is the easy way. http://forums.bistudio.com/oldsmileys/smile_o.gif
True enough, however, given that the hull is probably a more complicated shape than the poly limit would allow for, I, personally, would still generate the high poly model. I would not model ever bolt and screw, though. For that, I would edit the map I generated later. That&#39;s just how I roll.