Creating a BRRES with BrawlBox

From Custom Mario Kart
Jump to navigation Jump to search

This page is a part of the Custom Track Tutorial. Back to the main tutorial page.

Introduction

This page describes how to create a Custom Track BRRES from scratch with BrawlBox and BrawlCrate. You will import the model from an exported DAE into MDL0, import the textures into TEX0 and edit some settings inside the MDL0 to make your model look right in-game. This page contains information that is useful even after your BRRES is created, even if it was made with another program.

Importing the DAE File

To create a BRRES in BrawlBox, you need to import a DAE file, preferably in the 3ds Max format.

  • The default settings in the 3ds Max DAE exporter are usually correct.
  • If you are using SketchUp, the best option is to export the model as OBJ using the OBJ Exporter plugin, and import it in 3ds Max, then export as DAE. If you do not own 3DS Max, export the model from Sketchup as an OBJ and convert it to an FBX file with Autodesk FBX Converter 2013.3, then choose FBX 2013 as the Destination format, then convert that FBX to DAE.
  • If you are using Blender, export the model in FBX format. After you have your FBX file, convert it to a DAE file with the tool above.

First, make a new BRRES (File → New → Brres Resource Pack). Then right-click the BRRES node and click Import → Model. Use the following settings:

As of BrawlBox v0.77

The DAE will then be converted into an MDL0 file, which will be in the 3DModels(NW4R) folder inside the BRRES. If you are making the course model, make sure the MDL0 is named "course". This applies to any other BRRES you might be replacing.

A ModelVersion different from 11 or other incorrect settings will make the game freeze. You might walk against some problems, most noticeably randomly moved faces/polygons and rotated models. This can be fixed by swapping the Axis Conversion setting when exporting the model, from Y-up to Z-up or vice versa. If that does not work, instead try setting the pivots in 3ds Max. Set all pivots' positions to the origin (0,0,0) and rotate them -90° on the X-axis.

If you have imported it, you might wish to rename things (such as meshes or materials) for more readability.

Importing the Textures

You can import the textures by right-clicking the root or using the Edit drop-down menu and selecting Import → Texture (or Folder; in this case, put all your textures on a folder and select it). Make sure you set the texture format to a format supported by Mario Kart Wii. When choosing texture format, it is recommended to follow the chart below:

Optimal-Texture-Formats.png

You should use CMPR for most textures; textures with opacity (partially transparent) should be RGB5A3.

The textures will be imported as TEX0 files inside the Textures(NW4R) folder in the BRRES. The references which point to them are located in the Materials section of the MDL0. If any textures are missing or referenced incorrectly, the game will crash. You can rename the textures and references to fix this if needed.

You should set a number of mipmaps for each texture you import. Three is usually a good amount for normally sized textures. Large textures might use more and smaller ones might use less; you will have to experiment with this. You will also need to make the Material use those mipmaps (see below). The mipmaps that BrawlBox creates are more suitable for Super Smash Bros. Brawl. If you want to use higher quality, more Nintendo-like mipmaps, you should create your TEX0 textures with Wiimms Image Tool. See: Creating Mipmaps with wimgt.

At this point, before editing shaders or materials, you should test your model in-game to see if it will load (even if you have not made the KCL or KMP yet).

Shaders

The default shader created by BrawlBox will work correctly in Mario Kart Wii; however, it is usually too bright. Navigate to the Shaders folder under the MDL0 to edit them; open Stage0 from Shader0, look for ColorScale and set it from "MultiplyBy4" to "MultiplyBy2" or "MultiplyBy1". This will set how bright your textures will be in-game. If you are not happy with any of the settings, you can experiment with the "Default Color" setting when importing the DAE.

Materials

Material settings are very important to make your track look good. Note that messing too much with the material settings will most likely result in definitions which are incorrect or unsupported by Mario Kart Wii. Navigate to the Materials folder under the MDL0 to edit them. Some of it is explained here:

Materials for Normal Textures

The settings for textures without transparency (fully opaque textures) are almost completely right after importing. The only changes they require are for the light channels. Under SCN0 References you should have all set to -1 except FogIndex, which should be 0. Also, make sure everything under "Z Mode" is set to True.

Material settings

Materials for Textures With Transparency/Opacity

To enable opacity on a mesh/polygon, browse to the mesh's material.

If the texture does not have partial transparency/opacity, also set these settings
  • Ref0 = 128
  • Comp0 = GreaterOrEqual
  • Logic = And
  • Ref1 = 255
  • Comp1 = LessOrEqual
If the texture is translucent/has partial transparency, set following settings
  • EnableBlend = True
  • EnableDepthUpdate = False
  • XLU Material = True
  • CompareBeforeTexture = True

You also have to browse to the mesh under the "Objects" section in the MDL0 file and set the Draw Pass to XLU (Transparent) for each mesh/polygon with partial transparency. This should prevent the Harry Potter Effect. You can also make a material (more) transparent by setting Constant Alpha Enabled = true and the Value to the value of transparency (0 = opaque, 255 = fully transparent). However, this setting doesn't ensure a model without the transparency settings above becoming transparent.

Texture Settings

Texture Filtering

Texture filtering describes how the specific texture is filtered. That can be changed using MagFilter setting.

The most common option is Linear (bilinear sampling) that makes texture more blurry, which as a result makes the textures smoother. Nearest (point sampling) will make the texture look pixelated.
Mag-Filtering.PNG

Mipmaps

Using mipmaps to eliminate moiré pattern

Mipmaps are smaller versions of the textures, which are displayed when you are further away from the models, to improve the visuals of your track. Your textures will look smoother and you can heavily reduce moiré patterns.
For mipmaps to be displayed, you can change the default MinFilter setting when importing using BrawlCrate. If not, you must navigate to the texture reference under each material and change the MinFilter option.
The most common setting is Linear_Mipmap_Linear; however, other settings are also possible, described below:
Texture-Filter-Modes.PNG

The textures must actually contain mipmaps for this to work (explained above).

LOD Bias

When using mipmaps, textures may become blurry if the texture LOD result is larger than expected and small mipmaps are referenced. To adjust this, you can change LOD Bias setting. Increasing the bias will make mipmaps appear closer; decreasing will make them appear further away.
LOD-Bias.PNG

Culling

The CullMode setting is set to "Cull_Inside" by default. This will make the "inside" of the models invisible and the outside visible, which is the usual setting. Setting it to Cull_Outside will make the opposite side of the model visible (the blue side in SketchUp) and setting it to Cull_None will make all sides of the model visible. This should be used for models which can naturally be seen from both sides, such as fences.

Next

It is a good idea to test the scale of your model as soon as possible, so follow the Solidity tutorial to make your track solid. You will also need to edit the KMP to put the start position over the track. You can see more stuff that can be done with BrawlBox in the BrawlBox Tricks page. Refer back to this tutorial as needed as you continue to refine your model.

Links