The Starport
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord
  • Register
  • Login

Adding glowmaps to models

Scheduled Pinned Locked Moved Tutorials
11 Posts 8 Posters 17.8k Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    Guest
    wrote on global:last_edited_by,
    #1

    After repeated requests, i’‘ve decided to do a tutorial on adding
    glowmaps to models. This means lights that glow on the model in the dark, ideal for
    ships, bases and in some cases, planets. You can still add running lights if you want
    but that i’‘ll leave up to you. This tutorial is not for the faint hearted and requires
    patience but trust me, the results are worth it. I’'m assuming that those that attempt
    this know a bit about the general subject as this is not for noobs.

    Tools you will need:

    -A decent graphics editing program, Paintshop, Photoshop or some program that can deal
    with TGA and DDS texture formats

    -A copy of UTF editor


    First thing you need to do is locate the texture for your model which normally sits in
    the MAT file for your ship. You need to extract this with the UTF editor. Look for the
    file in the texture library section by clicking on the name, another node will open up,
    either MIP0 or MIPS, click on that and EXPORT it using the editor. The texture file
    will have a TGA file extention which is fine if its a TGA texture. It might also be a
    DDS one in which case change the extention to DDS so you can edit the texture in your
    graphics program, don’'t worry about importing the mipmaps into your graphics program
    if its a DDS texture. Also some ships have multiple textures, you need to find the one
    that you want to edit, not all of them will need glowmaps.

    NOTE

    Freelancer uses the TGA format to display textures in game, these can be quite large
    which is why lots of people including myself, prefer using the DDS format as this cuts
    down on space and significantly reduces the texture file size.

    A lot of new ships only use one texture file, 256x256, 512x512 and so on so here’'s one
    i extracted earlier,

    Colonial Raptor
    http://i5.photobucket.com/albums/y155/Wargibbon/General%20stuff/colrap1coxtex.jpg

    Next thing you need to do is to create the glowmap itself which is exactly the same
    image as above but very dark, usually achieved by lowering the brightness and contrast
    but you may have to experiment with this. This is where you add any engine glow or
    lights to the model by simply going over the original section in the texture and adding
    nice bright colours for the areas you want to make glow in the dark. Resave it and most
    importantly, RENAME it so it looks like this,

    Colonial Raptor glowmap
    http://i5.photobucket.com/albums/y155/Wargibbon/General%20stuff/colrap1coxtexi.jpg

    Once this is all done you need to decide what format to save it as. In this case
    because the texture is one simple square one, we can convert it to DDS format so make
    sure you save it as such and save it with no alpha channel.


    Now comes the fun part, for this you need the UTF editor so open up the MAT file of
    your model so it looks like this,

    UTF 1
    http://i5.photobucket.com/albums/y155/Wargibbon/General%20stuff/utf1.jpg

    Now in the version you guys will have you will only see three sections, the Dt_flags,
    Dt_name and Type sections. The glowmaps are added to the Et_flags and Et_type sections
    which you have to create. You do this by adding two new nodes to the first tree where
    the original texture name is, in this case, colrap1coxtex.

    Once you’'ve added the two new nodes you will have two nodes that have New node next to
    them. Highlight the first one, rename it to Et_flags and edit it as an int array. You
    need to add two numbers, first 64, press enter than add 0

    Highlight the second node and rename it Et_name and edit it as a string. You must enter
    the name of your glowmap texture here so i’'ve put colrap1coxtexi.tga in mine. It has a
    TGA extention even though its a DDS texture as explained before.

    Lastly, two nodes up is the node called Type. Edit this as a string and add Et on the
    end so it reads DcDtEt.


    Now we’'re on the home stretch. You need to add the new glowmap texture to the texture
    library in UTF editor so it looks like this,

    UTF 2
    http://i5.photobucket.com/albums/y155/Wargibbon/General%20stuff/utf2.jpg

    A new node needs to be added to the texture library section so go ahead and do this.
    Once done you will have a node with New node next to it. Highlight it and rename it
    using the glowmap texture name. Once this is done, add a new node to the new glowmap
    texture name and rename this either MIP0 for a TGA texture or MIPS for a DDS texture.

    Once this is all done, you need to import the new glowmap to the MIP0 or MIPS node, so
    highlight it and IMPORT the new texture.

    Save everything to your MAT file of choice and that should do it. Make sure your trees
    look EXACTLY like they do in the UTF images above or it won’'t work.

    Enjoy!

    1 Reply Last reply
    0
  • M Offline
    M Offline
    Mini_Me
    wrote on global:last_edited_by,
    #2

    Good stuff there Gibbon 🙂

    Just perhaps one addition of note:
    Et cannot be used on an animated texture. Ec can, but that’s only one color, not a map like above.

    Edit:
    Humph, well perhaps it only bugs when used on a mesh-within-a-mesh then. (shell with transparency, ani under)
    I had left the animation values exactly the same as found in the nomad mothership, used on the walls there.
    Texture anim works with DcDtEc perfectly, but change it to DcDtEt or DcDtEcEt and nada.
    Had the same problem on another ship; texture in question here has alpha. DcDtEcTwo. Add Et into the mix and no animation. Same unchanged deltas.

    Both use it on a mesh beneath another transparent textured mesh, which may have something to do with it.

    1 Reply Last reply
    0
  • L Offline
    L Offline
    LancerSolurus
    wrote on global:last_edited_by,
    #3

    Look at the cityscape cmps, there are alot of animated glow maps there. I have also successfully used it for an animated engine glow on the Sovereign.

    1 Reply Last reply
    0
  • B Offline
    B Offline
    Bejaymac
    wrote on global:last_edited_by,
    #4

    That’s because your trying to animate two textures as one, the Dt tex & the Et tex, and from my own fiddling around with material animations, I found that FL just doesn’t like that. The reason the nomads work is that they don’t use “glow maps” as such, they use BtOcOtTwo rather than EcEt and call a “special animation” by using “nomad = true” in the shiparch.

    “Ec” has two funtions, when used with a texture it acts like the Oc node and allows you to control the strength of the “glow”(if it’s missing FL uses the default (0.800000)). On it’s own it acts like the Dc node and is used to apply a “diffuse” color to the area, but because you have Ec or EcEt in the “type” FL gives it the default “glow” setting.

    1 Reply Last reply
    0
  • L Offline
    L Offline
    LancerSolurus
    wrote on global:last_edited_by,
    #5

    **By taking an example from ocean_green.cmp, you should be able to get 2 different textures to animate. I was able to get it to work with 1 texture or 2, looks better with 2 IMO.

    Notice the red texture at the front of the nacelles, it is animated with 1 glow texture.

    Create a MaterialAnim node in your CMP (not the MAT file), make this node attached to the root node ( \ ),
    Create a new child node under this and give it a name you will recognize as the texture name. I use the texture name without the _lod1.3db

    Create 3 more nodes under this new node, naming them
    MACount
    MAFlags
    MADeltas

    In MACount, set it to 1 for a single animation
    In MAFlags, set it to 2 (texture shift)
    In MADeltas add this
    1.000000
    1.000000
    1.000000
    1.000000
    0.000000
    1.000000
    1.000000
    1.000000
    1.000000
    0.000000
    These usually come in groups of 5 floats, don’t ask me what they do, I’ve forgotten. I did this almost 2 years ago.

    This should give you a sliding animation. Just remember, the entire texture slides so make sure your model is separated out properly.

    Forgot to add this, under Cmpnd, you have to add a second MaterialAnim node.
    Build it the same way as the one above with one single difference. The MAFlags should be 64 in this one.**

    1 Reply Last reply
    0
  • M Offline
    M Offline
    mknote
    wrote on global:last_edited_by,
    #6

    @Lancer:

    **…

    …**

    …

    …

    …

    Mother…

    I was hoping that was what you meant when you said Sovereign but… damn. That is a beaut!

    MK

    1 Reply Last reply
    0
  • L Offline
    L Offline
    LancerSolurus
    wrote on global:last_edited_by,
    #7

    **Here is a full sized image…

    http://www.galacticenigma.com/Pix/SovereignFull.jpg**

    1 Reply Last reply
    0
  • M Offline
    M Offline
    Mini_Me
    wrote on global:last_edited_by,
    #8

    Thank ya gentlemen, more fun stuff to play with. Sorry for steering the thread a bit askew in the process.

    1 Reply Last reply
    0
  • C Offline
    C Offline
    Chili
    wrote on global:last_edited_by,
    #9

    Just read this one… what a nice guide thanks for sharing.

    I take it you can use the same technique with starsphere models?

    Also can you rename the .3db files exported by ms3d to .cmp for this purpose? Still to try it out but see no reason why not.
    When I get time……

    1 Reply Last reply
    0
  • O Offline
    O Offline
    OPR8R
    wrote on global:last_edited_by,
    #10

    starspheres dont have “dark parts/shadows”… so why would you want glow maps there?

    (to answer your question: yes you can create glowmaps there but they would look like the normal textures)

    1 Reply Last reply
    0
  • K Offline
    K Offline
    Kremit
    wrote on global:last_edited_by,
    #11

    After the mission where you snatch the proteos tomb (sp…) and blow up Tekagi… I’ve always wanted to make Trent’s eyes glow similar to the shade of color on the ships I’ve cloned, retextured and added (not replacing originals) to game… I’m not very good with .thn’s or .ale’s which is how Tekagi’s eye, head and hands generate the effects during the Cutscene.

    Since I’m no good at editting the arrays of long numbers, I was hoping I might be able to accomplish something similar with the pi_pirate5_head.dfm that trent’s character uses. I noticed there is already a glow map for the eyes, but no bright colors in it… just looks like a black 32x32 image (mip0). After changing it to a color similar to my ships, I recompiled the dfm with Freelancer XML Project… same way I extracted the necessary images by bulk.

    After that failed to glow, I confirmed in UTF that the images did update in the texture library. Also confirmed the int array for Material Library\eyetealblue\Et_flags looks like:
    64
    0

    Also string value for Material Library\eyetealblue\Et_name was already pointing to the tga reference in Texture Libraries that holds all the mip maps. Also confirmed, since there isn’t an Ec_??? in the file, that Material Library\eyetealblue\Type is: DcDtEt.

    Still failed in both cutscenes and just normal character walking between bar/equipment room/ship dealer, etc… So I tried to apply a 60% opacity to Trent’s eyes, hoping the glow might shine through, but still nothing…

    Can this method be done to the .dfm? or do I need to do it through the .thn’s using .ale references? Is it possible to place a hardpoint or “mount” a light in the head’s skull that would illuminate the desired color I’m looking for and shine through the, now, semi-transparent eyeballs? Also willing to try any other ideas to accomplish this feat other than manually editting .ale’s and .thn’s in notepad…

    1 Reply Last reply
    0

  • Story Mission level requirement
    C
    CommanderArgelo
    0
    11
    52

  • Crash Offsets
    J
    josbyte
    0
    231
    251.4k

  • Capital ships shield collision detection
    C
    CommanderArgelo
    0
    3
    17

  • Dropping a phantomloot cargo from an NPC
    C
    CommanderArgelo
    0
    5
    26

  • Incorrect Shield Value on HUD
    C
    CommanderArgelo
    0
    4
    19

  • @Adoxa - Wheel Scroll plugin improvements
    AingarA
    Aingar
    0
    3
    20

  • Release: Advanced Renderer v. 1.1 beta 1
    S
    SWAT_OP-R8R
    3
    50
    428

  • German Mod Tutorials? 2024 Mod Tutorial?
    S
    SWAT_OP-R8R
    0
    18
    66
  • First post
    Last post
0
  • Categories
  • Recent
  • Users
  • Groups
  • Starport Blog
  • Knowledge Base
  • The Forge
  • Discord