1. Moderator Applications are open! Find out about this, along with a number of other updates, here.
    Dismiss Notice
  2. Are you a supporter that wants to change your forum name? Just ask an administrator or moderator with a sparkly name!
    Dismiss Notice
  3. Beto's been working hard updating the homepage, and has also made a new app for league results! Please check the announcement for more information.
    Dismiss Notice
  4. You can click here to download a zip file conaining WCL and PL standings/schedules. We will update the file once we've managed to gather (if possible) all the data about IL and MKL.
    Dismiss Notice

Custom Texture Tutorial

Discussion in 'Help & Support' started by Harm, May 11, 2017.

  1. Harm

    Harm Soul on Fire

    • MKBoards Supporter
    • Founding Member
    Joined:
    Feb 17, 2014
    Messages:
    4,606
    Gender:
    Male
    Location:
    Canada
    This thread will be used for tutorials and general support for texture hacking in Mario Kart 8.

    Photoshop is the best program to use for MK8 textures in general and this tutorial will generally revolve around it, I recommend getting it. Paint.NET is the best alternative.

    To begin, here is a list of things that are required in order to begin texturing:
    - BFRES Tool: the thing you will be using to extract and inject textures.
    - yaz0dec: a program that decompresses .szs files to .bfres format.
    - yaz0enc: a program that compresses .bfres files back to .szs format.
    - Paint.NET: an image editing program that you will need to open newly extracted .dds texture files. You can use any image editing program to actually do your textures, but Paint.NET is required for reasons I will explain in detail later.
    - NVIDIA Texture Tools (PHOTOSHOP USERS ONLY): Photoshop plugin required to save .dds files in Photoshop as well as generate mipmaps.

    You can find the first three tools here: http://forums.mkboards.com/threads/the-big-list-of-mk8-modding-tools.32639/
    Paint.NET here: https://www.getpaint.net/
    and the NVIDIA plugin for Photoshop here: https://developer.nvidia.com/nvidia-texture-tools-adobe-photoshop

    Now that you have all the required tools, let's get right into it.


    The 3 main types of texture maps: ALB, SPM and NRM.

    _alb, _spm and _nrm are the most common types of textures you will encounter while texturing. Most of the time you will only need to edit ALB files and sometimes SPM files. For more advanced texturing you could learn to edit NRM but don't ask me because those texture maps scare me. Some characters have other texture maps, like Metal Mario and Pink Gold Peach. To keep things simple right now I will provide a brief rundown of the main 3:

    ALB: The diffuse map. The main texture for your character/kart/course/whatever. These are basically the actual colors of everything and the easiest to edit.

    SPM: The specular map. These texture maps control the "shininess" of your textures. How SPM maps work are as follows, courtesy of superdastar:
    • the lighter the colour, the shinier it gets rendered. want it to be neutral? use a medium-grey, or something that's dark. want it to be extremely shiny? use white. or, want it to have no shine whatsoever? use black.

    • the hue determines what colour shines through the texture.

    • sometimes, specular editing is necessary. some textures use something other than just black or white on their specular map. for example, the Blue Falcon has blue on the body diffuse texture, and a lighter blue in the specular map. if you were to make the body pink and not edit the body in the specular map, you would have blue shining through the pink.

    NRM: The normal map. This map controls how the game renders light on a model and can also add "texture" (making something appear bumpier, smoother, etc) without directly editing the model. Hardest to edit, I literally have no clue how to do it correctly lol


    Decompressing the SZS and extracting the textures.

    The first thing you're going to need to do is find the .szs file of the character, course or vehicle you plan to texture. If you plan to do an item texture or something else that is already in .bfres format you may skip the decompression process, as well as the compression process when you're finished.

    To decompress your .szs file into .bfres format, simply drag the .szs file into yaz0dec and wait. It will create a new file with a .rarc extension. For example, if I were to drag DK.szs into yaz0dec I would receive a file named "DK.szs 0.rarc." Once you got this file, simply change the file extension from .rarc to .bfres. So with "DK.szs 0.rarc" I would rename it to "DK.bfres."

    Now you are ready to extract the textures from the BFRES. Open up the BFRES Tool folder and run bfres_tool.exe. Go to File - Open and select your BFRES file.
    - Note: I recommend you create a new folder with your BFRES in it as the textures will all extract to the same location as it. Wait for BFRES Tool to do its thing (a cmd prompt will show up showing a bunch of texture details while its extracting them, it may take a while for the bigger sized textures) until a pop-up shows up saying "Done." Now BFRES Tool will have a list of "Replace x texture" buttons, you will be using these later of course.


    Opening the .dds files. (for Photoshop users and possibly other programs idk)

    If you don't use Photoshop or opening errors don't even happen to you, skip this.

    Alright so this is the part where you need Paint.NET because for some strange reason the just-extracted DDS files will either not open in Photoshop at all or will open with incorrect colors. I don't know if this happens in other programs such as GIMP but for Photoshop users this is a problem.

    In order to get the DDS files correctly working in Photoshop you will first have to open them in Paint.NET, simply CTRL + S to save them and then they will work with Photoshop. Annoying, I know, but it's the only workaround I know of.


    Saving your textures.

    Since editing is pretty straightforward and entirely up to the user it doesn't need a section in this tutorial. However, how you save your DDS files (in Photoshop specifically) is important.

    When you finish editing whatever you want to it's time to save. When you go to save you will see you have multiple format options in a drop-down menu including DTX1, DTx3 and DTX5. As a general rule, ALB files are always DTX1 unless they have transparency, in this case they are DTx3. SPM maps are usually DTX1 as far as I've seen, NRM maps are DTx3.
    There is a way to find out exactly which texture files are which format but it's actually annoying and I'm too lazy to explain it now so yeah.

    In Paint.NET's save box you may also notice a box to generate mip maps. Leave it unchecked or else really bad things. All you need to touch is the DTX format you save in.

    If you're using Photoshop to save, the NVIDIA DDS Format box will pop up. As with Paint.NET it has a drop-down menu for the DTX formats but with more options, specifically a second DTX1 option. Always use the first one, "no alpha." Unlike Paint.NET however, you must generate mip maps in this box. For most texture files the number of mips will be between 8 and 11, there's a way to know exactly what number as with the DTX format but that's for another time. All that happens is BFRES Tool will give you a "mip map number mismatch" error and you'll have to re-save with a different number of mips until you get it right.


    Injecting your textures and compressing the BFRES.

    The final part of the texturing process. Once you have edited and saved every file you've worked with, it's time to inject them. Injecting them is an extremely self-explanatory process. Just click "Replace x texture" and find your editing texture with the corresponding name. For example if I were replacing "DK_Alb.dds" I would click "Replace DK_Alb" and select my edited DK_Alb.dds.

    Once you have successfully replaced your textures you can now compress the BFRES back to SZS format using yaz0enc. The process is the same as using yaz0dec, just drag the BFRES into yaz0enc and wait. The amount of time it takes depends on the size of the BFRES. Character and vehicle textures only take a couple minutes while course models may take up to 2 hours to compress. Sometimes the yaz0enc cmd prompt box will show a negative percentage, this is normal, don't be alarmed or think it's not working.

    Exactly like yaz0dec, you will get a new file once yaz0enc finishes its compression process. This file will be in .yaz0 format. Simply rename and change the file extension to .szs. For example, I would get "DK.bfres.yaz0" and rename it to "DK.szs."


    Now you're done and your texture is ready to be tested in-game!

    I hope this tutorial was helpful and not too confusing or difficult to understand. I will slowly add to this thread with more advanced texturing tips but I wanted to get the basics up as soon as possible. Happy texturing!
     
    Last edited: May 12, 2017
    Savannah likes this.
  2. xSpade24

    xSpade24

    • Founding Member
    Joined:
    Jul 8, 2013
    Messages:
    4,520
    Gender:
    Female
    Location:
    Rosalina Castle
    Team:
    Mτ - Mulτιvεrsε
    This already looks like a catastrophic problem.

    Interesting o: haven't been in the mk8 scene that much but it's cool they have textures
     
  3. Harm

    Harm Soul on Fire

    • MKBoards Supporter
    • Founding Member
    Joined:
    Feb 17, 2014
    Messages:
    4,606
    Gender:
    Male
    Location:
    Canada
    lol.

    we've had textures for over a yr and we're finally getting into custom models 3 yrs late cuz Bean didn't release his shit
     
  4. tylerr

    tylerr pick up your hearts and avenge defeat WL Staff

    • WL Staff
    Joined:
    Mar 16, 2015
    Messages:
    2,225
    im jizzing myself okay im ready for this
     
  5. xSpade24

    xSpade24

    • Founding Member
    Joined:
    Jul 8, 2013
    Messages:
    4,520
    Gender:
    Female
    Location:
    Rosalina Castle
    Team:
    Mτ - Mulτιvεrsε
    I knew that, I just didn't know they were released finally. I remember the ones bean made.

    The Icy Thwomp Ruins
     
  6. Harm

    Harm Soul on Fire

    • MKBoards Supporter
    • Founding Member
    Joined:
    Feb 17, 2014
    Messages:
    4,606
    Gender:
    Male
    Location:
    Canada
  7. Fruitz

    Fruitz capsule corp. WL Staff

    • MKBoards Supporter
    • WL Staff
    Joined:
    Nov 29, 2014
    Messages:
    446
    Gender:
    Male
    Location:
    California
    Killua likes this.
  8. Harm

    Harm Soul on Fire

    • MKBoards Supporter
    • Founding Member
    Joined:
    Feb 17, 2014
    Messages:
    4,606
    Gender:
    Male
    Location:
    Canada


    yeah uh can we get rid of the X 3 emote LOL
     
    tylerr, Fruitz and ~Maidvelia❤~ like this.

Share This Page