1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

Making Shaders for completely new LHs

Discussion in 'Civ4 - Creation & Customization' started by Osakasayama, Oct 29, 2012.

  1. Osakasayama

    Osakasayama In decline

    Joined:
    Jul 6, 2010
    Messages:
    66
    Location:
    St. Louis
    So, I've been playing around with converting units from other games, and I've managed to make a prototype leaderhead.:)

    The problem I have is with the Shaders, since I have a completely new model, and Firaxis shaders don't look good on it.
    I tried to follow some tutorials out here, but I can't find one about making the shaders, not using preexisting ones...

    Is there a way to make them in GIMP or some other tool?
     
  2. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Shaders are functions within the graphics engine of the game, used to render the models. Some of them display a different set of texture maps effects. There is no way to actually make a new one, you can only apply them.

    Typically, shaded LH models use the TLeaderheadShader_20, allowing to render with a Normal-Bumpmap, a Specular and a Reflection map (besides the actual diffuse color map).
    If lacking these maps a nonshader version of the LH can be made. It only uses a diffuse map, with no additional 3D-effects. You can however paint or "bake" some of the effects (like say light and shadows) on the diffuse map to make it look better.

    The textures needed can be created in a few different tools (GIMP among them), basically by painting them.
    But since you are converting Models, there should be texture coming with them. So you probably only heed to adjust things like contrast or color palette to match with the Civ4 look.

    So what exactly is it you are trying to make?
     
  3. Osakasayama

    Osakasayama In decline

    Joined:
    Jul 6, 2010
    Messages:
    66
    Location:
    St. Louis
    Here's a screenshot.
    Spoiler :


    Its from Koei's "Warriors Orochi", which is a unhistorical ;) combination of "Dynasty Warriors" and "Samurai Warriors". It has most of the graphics in both games, plus some originals.

    The model has some blue glows on the face, but they can't be seen in nifscope.
    It has been nifswapped into Elizabeth's shader nif, so I'm assuming its something to do with that. Is there a place to edit lighting in nifscope?

    The model had a rectangular 512*1024 texture, but could there be potential problems with it? I'm just afraid of going through so much work of remaking them. :shifty:
     

    Attached Files:

  4. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Unless you can see these blue stains on the texture, there should be nothing wrong with that.
    Still, if nothing else helps, you could try and desaturate the blue colour channel a little bit, to make the texture respond less noticeable to the blueish light.

    I don't remember exactly how the leaderheads are lit - probably a combination from ambient lightning applied by the engine plus some spotlights for highlights and atmosphere. It is quite possible that there is a blue spotlight somewhere. If so, you should be able to find it (NiPointLight or something) and maybe change the colour, or just remove the offending light source.
     
  5. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,481
    Most of the time it is rather hard to find out these errors without being able to look at the leaderhead oneself. So if you like you could upload your leaderhead so we can take a look at the nif.
     
  6. Osakasayama

    Osakasayama In decline

    Joined:
    Jul 6, 2010
    Messages:
    66
    Location:
    St. Louis
    Here's the nif. The LH still needs some adjustments, but it is mostly done.

    I'm assuming its the "bloomfactor" that caused it to go blue in-game, but I don't have a clue on where to set that at...:confused:
     

    Attached Files:

  7. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    You could just 'Remove Branch' the Bloom-thingy with Nifscope. Or change it's colour, if you feel, removing it will make the LH miss highlights or something.
     
  8. SaibotLieh

    SaibotLieh Emperor

    Joined:
    Sep 25, 2009
    Messages:
    1,481
    The leaderhead was not completely shadered yet. The meshes still missed these entries:
    Spoiler :


    TLeaderheadShader_20 might also work, I am not really sure...

    Furthermore you did not have the necessary dds files. A shadered mesh needs a diff file (the coloured texture), a norm file (the "topography" of the mesh), a spec file (how reflective the mesh is) and a env_mask (how strong the env texture is reflected). The env texture is the elizabeth_gold_env.dds in this case.

    I've added all these to the leaderhead. Since you already seem to know a bit about NifSkope I hope this example already helps you. Otherwise just ask.

    As you will see, the leaderhead still looks a bit strange in the game. The next step is to adjust the three diffuse lightsources (key, fill, bak) as well as the ambient color. Furthermore each diffuse lightsource has a specular value as an own node. An finally you have the BloomFactors and BloomColorChannelMix nodes, which seems to make the light more fuzzy with higher values.

    You can change the intensity and the colour of all these lightsources by modifying the dimmer value and the Diffuse/Specular Color of the respective nodes:
    Spoiler :



    Furthermore you can change the direction of the three diffuse lightsources by changing their Translation values:
    Spoiler :



    To see how the changes effect the leaderhead just start the game and look at the leaderhead in the 'pedia first. Then minimise the game, change some values, save the leaderhead and maximise the game again. Now change to a different leader and back again to the leaderhead you are working on at the moment. The game should then load the leaderhead with the new settings.

    Hope this helps. :)
     

    Attached Files:

  9. Osakasayama

    Osakasayama In decline

    Joined:
    Jul 6, 2010
    Messages:
    66
    Location:
    St. Louis
    Okay, after some trial and error, I think I've got the gist of it, I think:)

    But getting back to my original question, how could I make those 4 .dds files?
    Is it doable in programs like Paint.net or GIMP?
     

Share This Page