So, about those custom textures

Draco_2kDraco_2k Evil Genius Join Date: 2009-12-09 Member: 69546Members
edited December 2009 in NS2 General Discussion
<div class="IPBDescription">Thermonuclear donkeys and more explained</div>Anyone else figure out anything yet? I'll post what little I figured so far to start off..

The general process seems simple enough: create a .psd file in your materialsrc folder, accompany it with a .material file, hit build (as per <a href="http://../flash/launchpad_builder_tutorial.swf" target="_blank">video tutorial</a>). But that'll net you only the diffuse map, a very shiny one, too: the texture won't be transparent or glowing or whatever you want it to be. If you want to add additional detail (you probably do), you'll have to delve into the material file:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->   <material>
                   <maps>
                        <map type="texture" value="materials/MyMaterial.dds" />
                   </maps>
               </material><!--c2--></div><!--ec2-->

Generally, for every new map type you'll have to copy the "map type" line over with new paths and parameters. The trick is to know the keywords, and which part of your .psd these maps sample.

<!--QuoteBegin-References+--><div class='quotetop'>QUOTE (References)</div><div class='quotemain'><!--QuoteEBegin--><b>Name - "keyword" - Source - Details</b><i>
</i>
Diffuse map - "texture" - RGB
Normal map - "bump" - RGB
Specular map - "specular" - Alpha - White areas reflect light, black areas don't
Illumination map - "emissive" - RGB - Colour areas glow, black areas don't
Transparency map - "opacity" - Alpha - White areas are opaque, black areas are see-through<!--QuoteEnd--></div><!--QuoteEEnd-->

So, to set where shiny bits of your material are you'll want to create an Alpha channel for your .psd and have something like this to go with it:

<!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->   <material>
                   <maps>
                        <map type="texture" value="materials/MyMaterial.dds" />
                        <map type="specular" value="materials/MyMaterial.dds" />
                   </maps>
               </material><!--c2--></div><!--ec2-->

All of this is, of course, a shot in the dark. Anyone know any better?

<u>Notes:</u>
-You'll generally always want your texture to have an Alpha channel (otherwise it'll render shiny by default); specular maps seems to be sourced mainly from the "texture" document's Alpha.
-Illumination maps currently don't seem to display in the editor (model viewer works fine).
-Builder crashes if you try to process a document with more than one Alpha channel.
-Builder currently ships without certain necessary files and may crash on build attempt. To fix that, download <a href="http://developer.nvidia.com/object/texture_tools.html" target="_blank">nVidia Texture Tools</a> and copy all .dll's and nvcompress.exe from the resulting "bin" directory into "utils" one in the NS2 folder.

Comments

  • ArkArk Join Date: 2009-08-15 Member: 68489Members
    edited December 2009
    I believe there storing spec in the "diffuses" alpha channel to save on memory. I've only seen a separate specular file when they need full colour specular or gloss map which in the case of gloss, go's in the specs alpha..

    So if you just load a full diffuse in the editor, you can see it gets 100% spec, so you need to add an alpha channel and bring its colour to black to remove the spec.

    In the case of gloss maps and/or full coloured spec, thats when you need to use a seperate image. Look at the mining_cart.material and its related .dds files under the refinery props to see an example.
  • Draco_2kDraco_2k Evil Genius Join Date: 2009-12-09 Member: 69546Members
    <!--quoteo(post=1744410:date=Dec 20 2009, 05:03 PM:name=Ark)--><div class='quotetop'>QUOTE (Ark @ Dec 20 2009, 05:03 PM) <a href="index.php?act=findpost&pid=1744410"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->I believe there storing spec in the "diffuses" alpha channel to save on memory. I've only seen a separate specular file when they need full colour specular or gloss map which in the case of gloss, go's in the specs alpha..

    So if you just load a full diffuse in the editor, you can see it gets 100% spec, so you need to add an alpha channel and bring its colour to black to remove the spec.

    In the case of gloss maps and/or full coloured spec, thats when you need to use a seperate image. Look at the mining_cart.material and its related .dds files under the refinery props to see an example.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Thanks for that, amended OP accordingly. Gloss mapping sounds pretty tricky...
  • ArkArk Join Date: 2009-08-15 Member: 68489Members
    edited December 2009
    Gloss basically goes together with the spec to define the tightness (white) and broadness (black) of the speculars highlights.
  • PsympleJesterPsympleJester Join Date: 2008-04-06 Member: 64024Members
    Woot testing a window now... Ill post results in like 5 mins. :)
  • Draco_2kDraco_2k Evil Genius Join Date: 2009-12-09 Member: 69546Members
    <!--quoteo(post=1744414:date=Dec 20 2009, 05:41 PM:name=Ark)--><div class='quotetop'>QUOTE (Ark @ Dec 20 2009, 05:41 PM) <a href="index.php?act=findpost&pid=1744414"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Gloss basically goes together with the spec to define the tightness (white) and broadness (black) of the speculars highlights.<!--QuoteEnd--></div><!--QuoteEEnd-->
    That's deep. Hope I can figure out a way to test it.
  • PsympleJesterPsympleJester Join Date: 2008-04-06 Member: 64024Members
    Lol epic fail you can get a window to work if you use noise as your opacity but it looks TERRIBLE ... obveously... xD
    Funny light effects though... :|
    Yeah im thick and though opacity was gonna be on a gradients as opposed to on off... oh well. :)
  • KarrdeKarrde Join Date: 2003-05-13 Member: 16264Members
    Hmmm, just of note, on the subject of textures. If and when people start producing good quality textures, we should try to set up some sort of database somewhere down the line. I'm a fail mapper but I know I'm ten times worse in PS :P
  • ArkArk Join Date: 2009-08-15 Member: 68489Members
    Glass is hard to do at the current stage. Don't think you can do proper transparency yet as its a transparency mask (opaque or claer), therefore now variation in between.
  • PsympleJesterPsympleJester Join Date: 2008-04-06 Member: 64024Members
    Hahah yep Ark thats what I just discovered. :P
    I accidentaly made a texture from NS1 though so...

    (the one that was like weeds?)
    Like a camoflauge pattern where 1 of the colours is invisible.
  • sloppy_joesloppy_joe Join Date: 2002-12-25 Member: 11527Members
    edited December 2009
    I'm having a problem, when I go to build I get this message:
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>1> 'C:\Program' is not recognized as an internal or external command,
    1> operable program or batch file.</div>
    I made the texture with gimp with a psd type first is 512 x 512 pixels the second 128 x 256.
    It accepts my material file so it has to be my texture file any suggestions?

    Ok never mind I copied all the files in the nvidia bin into the utility and It compiled and works now.
  • Kouji_SanKouji_San Sr. Hινε Uρкεερεг - EUPT Deputy The Netherlands Join Date: 2003-05-13 Member: 16271Members, NS2 Playtester, Squad Five Blue
    edited December 2009
    I got a few textures (remade) from ns1 with the following material settings:

    <!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1--><material>
        <maps>
            <map type="texture" value="materials/custom/light3a.dds" />
            <map type="bump" value="materials/custom/light3a_normal.dds" />
            <map type="emissive" value="materials/custom/light3a_illum.dds" />
        </maps>
    </material><!--c2--></div><!--ec2-->
    made them trough photoshop before the build program was released, it is indeed quite shiny and loses the bumpmap when too close or to far away. Also the emissive render type doesn't work. I'll have a look at the builder to tomorrow, I'm doing it wrong for the emissive type...


    [edit]
    light3a (have a look in the halflife.wad :P)

    also transparant alpha maps are quite easy using photoshop
  • XuaxinodalXuaxinodal Join Date: 2002-12-19 Member: 11158Members, Constellation
    I was playing around with a few textures and noticed if I used a 72dpi image that I had to use 1024 pixels to equal 128 inches in the editor (1:1 scale).

    Based on my numbers above, the editor seems to run textures at 8dpi. Has anyone else run into this?

    Does the builder not care about the DPI of the source file and just look at raw pixels? Or is some conversion taking place here?
  • DalzigDalzig Join Date: 2009-06-02 Member: 67629Members
    Usually, when dealing with computers, only printers actually care about DPI. Everything else is done pixel by pixel.
Sign In or Register to comment.