Difference between revisions of "Creating a BRRES with BrawlBox"

From Custom Mario Kart
Jump to navigation Jump to search
(It's difficult to locate as it's evidently not index by search engines.)
(But I remember)
Tag: Undo
 
(42 intermediate revisions by 17 users not shown)
Line 1: Line 1:
{{Under-construction}}
+
This page is a part of the '''Custom Track Tutorial'''. [[Custom Track Tutorial|Back to the main tutorial page]].
  
This page describes how to create a [[Custom Track]] BRRES with [[BrawlBox]], if you only want to use some features of [[BrawlBox]], but create it with [[CTools]], look at [[BrawlBox Tricks]]. This page does not describe how to create a [[Custom Character]], but it may will in the future.
+
== 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 ==
+
== Importing the DAE File ==
To create a brres in BrawlBox you need to import a DAE file, this DAE file needs to be in the 3ds Max 2010 format, OpenCOLLADA or newer versions of 3ds Max won't work. If you have Blender or a version of 3ds Max newer than 2010, export the model in FBX format instead and convert it to DAE with [http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=18817304|Autodesk FBX Converter 2010.2].
+
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 [http://vgmp3.org/DLs/OBJexporterSep2012.zip 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 [https://www.autodesk.com/developer-network/platform-technologies/fbx-converter-archives 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.
+
First, make a new BRRES (''File → New → Brres Resource Pack''). Then right-click the BRRES node and click ''Import → Model''.
 
Use the following settings:
 
Use the following settings:
* Type: Stage/Item
+
[[File:Brawlbox dae settings.png|384px|thumb|center|As of '''BrawlBox v0.77''']]
* Tick: Force float vertices, Force float normals, Force float UV's, Remap materials and Force triangle primitives only (can't be un ticked).
 
* Untick: Add color nodes, if none and Force CCW primitive culling.
 
  
If you are importing a model without vertex coloring, such a model exported as OBJ from Sketchup, imported on 3ds Max and re-exported as DAE, you have to check also "Add color nodes, if none" and "Remap all objects to one color node".
+
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.
  
You might walk against some problems, most noticably 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 doesn't work instead try setting the pivots in 3ds Max. Set all pivots' positions to the origin (0,0,0) and rotate them -90 degrees on the X axis.
+
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've imported it you might wish to rename things for more readability. And you need to change some bone settings.
+
If you have imported it, you might wish to rename things (such as meshes or materials) for more readability.
Go in the MDL0 and change the  to bones and right-click TransN and select Add to parent. Then delete TopN. Also make sure that the model version is set to 11 rather than 9. Now you can save the brres as backup.
 
  
Now go to "Shaders", select Shader 0 and open, then select Stage 0; look for ColorScale and set it from "MultiplyBy4" to "MultiplyBy1"; this will avoid your texture become too much bright.
+
== 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:
  
At this stage before doing anything else save the BRRES file and open it in SZS Modifier and open the model, if the polygon list on the right does not populate with the names of the polygons and you have correctly followed the steps go back to Brawlbox and go to the MDL0's Colors section and make sure that at least one of the colors in each color node has an alpha value of less than 255. You will need to do this anyway for any objects that use a transparent material but this will ensure the stability of the BRRES file. Save again and if the polygon list gets populated correctly in SZS Modifier (the model will either not show or be completely white even when you add the textures, don't worry) you can now move on to fixing the materials, shaders and making other changes to improve the look of your model.
+
[[File:Optimal-Texture-Formats.png|400px]]
  
== Color Nodes ==
+
You should use CMPR for most textures; textures with opacity (partially transparent) should be RGB5A3.
  
You shouldn't have problems if you are importing a model with vertex coloring, but if not (therefore you checked also "Add color nodes, if none" and "Remap all objects to one color node") you have to go to the Colors folder inside the MDL0, click on the only color node which you see (it should be the unique), and in the lateral table click "Colors" and set the color node to:
+
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.
* A: 254
 
* B: 255
 
* G: 255
 
* R: 255
 
  
Now you can save as backup.
+
You should set a number of [[mipmap]]s 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 SZS Tools#wimgt (Wiimms Image Tool)|Wiimms Image Tool]]. [[Adding Mipmaps for CTools Models|See: Creating Mipmaps with wimgt.]]
  
== Materials and Textures ==
+
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).
  
After importing you only have the MDL0, a lot of things need to be set now, and the textures need to be imported. You can import textures with Right-click BRRES -> Import -> Texture.
+
== Shaders ==
Material settings are very important to make your track look good, but it's very complicated. Only the critical stuff is explained here:
+
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 and Shaders ===
+
== 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 have to be ordered by Shader references: Materials with reference to Shader1 must be UNDER Materials with reference to Shader0;<br>Schematically:
+
=== 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.
 +
[[File:Brawlbox material settings.png|800px|thumb|center|Material settings]]
  
*Materials:<br>
+
=== Materials for Textures With Transparency/Opacity ===
A(ref0)<br>
+
To enable opacity on a mesh/polygon, browse to the mesh's material.
B(ref1)<br>
+
; If the texture does not have partial transparency/opacity, also set these settings:
 
+
* Ref0 = 128<br>
*Shaders:<br>
+
* Comp0 = GreaterOrEqual<br>
Shader0<br>
+
* Logic = And
Shader1<br>
+
* Ref1 = 255<br>
 
+
* Comp1 = LessOrEqual<br>
This because, for a strange ad unknown reason, BrawlBox orders the Shaders by the Materials' references: so, if you have<br>
+
; If the texture is translucent/has partial transparency, set following settings:
 
+
* EnableBlend = True<br>
*Materials:<br>
+
* EnableDepthUpdate = False<br>
A(ref1)<br>
+
* XLU Material = True<br>
B(ref0)<br>
+
* CompareBeforeTexture = True<br>
 
+
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'll have, not apparently but in file's level<br>
+
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.
 
 
*Shaders:<br>
 
Shader1<br>
 
Shader0<br>
 
  
You have therefore to order your Materials by Shaders' references to avoid this problem.
+
=== Texture Settings ===
 +
==== Texture Filtering ====
 +
Texture filtering describes how the specific texture is filtered. That can be changed using '''MagFilter''' setting.  
  
=== Materials for Textures without Transparency ===
+
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.<br>
 +
[[File:Mag-Filtering.PNG|400px]]
  
The settings for textures without transparency (fully opague 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 FogSet, which should be 0.
+
==== Mipmaps ====
 
+
[[File:Moire-Pattern-Mipmapping.PNG|500px|thumb|Using mipmaps to eliminate moiré pattern]]
=== Materials for Textures with Transparency ===
+
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é pattern]]s.<br> 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.<br>
 
+
The most common setting is '''Linear_Mipmap_Linear'''; however, other settings are also possible, described below:<br>
For textures with fully opague and fully transparent parts you need some ''additional'' settings. This is to fix the [[Harry Potter effect]].
+
[[File:Texture-Filter-Modes.PNG|500px]]
 
 
AlphaFunction:<br>
 
* Ref0 = 128
 
* Comp0 = GreaterOrEqual
 
* Logic = And
 
* Ref1 = 255
 
* Comp1 = LessOrEqual
 
  
The following settings are also important but should already been set on import. But it's good to check this too:<br>
+
The textures must actually contain mipmaps for this to work (explained above).
Material:<br>
 
*EnableAlphaFunction = True
 
  
Z Mode:<br>
+
===== LOD Bias =====
* EnableDepthTest = True
+
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.<br>
* EnableDepthUpdate = True
+
[[File:LOD-Bias.PNG|400px]]<br>
* DepthFunction = LessOrEqual
 
  
=== Materials for Textures with Opacity ===
+
=== 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.
  
''It still needs to be done, take a look [[BrawlBox Tricks#Opacity|here]]''.
+
== Next ==
 +
It is a good idea to [[testing a track|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 Editing|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.
  
[[category:Tutorials]]
+
== Links ==
[[category:Custom Track Tutorial]]
+
{{Custom Track Tutorial}}
 +
[[category:Tutorials]][[category:Custom Track Tutorial]]

Latest revision as of 08:21, 27 April 2024

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