Difference between revisions of "BrawlBox Tricks"

From Custom Mario Kart
Jump to navigation Jump to search
m (→‎Fixing Model Holes: Properly capitalized a few things.)
 
(48 intermediate revisions by 21 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 several tricks to do in [[BrawlBox]]. For many parts in this article it's assumed you created the BRRES with CTools. If you want to know how to create a brres with BrawlBox look here: [[Creating a BRRES with BrawlBox]]
+
== Introduction ==
 +
This page describes several tricks to do in [[BrawlBox]].
  
== Opacity ==
+
The [[Creating a BRRES with BrawlBox]] page contains mainly information regarding how to create the BRRES from scratch using BrawlBox, but which also might be useful when editing an existing BRRES.
  
To enable opacity on a mesh/polygon, browse to the mesh's material (This is found in the MDL0, THIS IS NOT THE TEXTURE!!).<br>
+
=== Make Sure BRRES Works ===
Set the following settings:<br>
+
Sometimes you may have a bit of trouble getting a BRRES made with CTools to open with BrawlBox, namely getting the MDL0 to open. There are multiple possible solutions to this problem:
  
* Ref0 and Ref 1: 0
+
*If you have 3ds Max or a similar powerful modelling program, delete any "default material" meshes using 3ds Max, then export using its OBJ exporter.
* Comp0 and Comp1: Always
+
*Re-open your new BRRES with the CTools BRRES Editor. Save, and it should now open with BrawlBox. Remember that you will need to reimport any textures that you want to use mipmaps in BrawlBox, because CTools creates TEX0 files that refuse to display anything but the first mipmap.
* EnableBlend = true
+
*If for any reason the above methods failed, then you can open the SZS with your BRRES in it with the SZS Modifier. Open the Model with the SZS Modifier Model Editor, save, and the model should now work in BrawlBox.
* XLU Material = true (Will become true when you enable blend automatically, so dont worry about this)
 
* EnableAlphaFunction = false (This is for stuff with alpha that doesn't use EnableBlend)
 
* EnableDepthTest = true
 
* EnableDepthUpdate = false
 
  
You can also make a material (more) transparent by setting Constant Alpha Enabled = true and the Value to the value of transparency(0 = opague, 255 = fully transparent).
+
'''Important!''' Sometimes the SZS Modifier will cause textures to become doubled in game after saving them. To resolve this issue, set every non-doubled texture's Texture Coordinate scale to (1,1), and every doubled texture's to (2,2).  
  
== Mipmaps ==
+
If you use [[3ds Max]], you can add XForm UVW for all meshes with U and V 0,5 (Make sure "Apply to entire object" is ticked) to fix this problem. If you use [[SketchUp]], just scale the materials for twice. (For example ''2000'' to ''4000''.)
  
A mipmap is a smaller, more pixellated version of a texture which is stored in most TEX0 files. In a 3D display, smaller mipmaps are rendered at farther distances. The bigger a texture is scaled, the farther you must go to trigger a smaller mipmap. Mipmaps help increase frame rate a little bit, remove the ugly aliasing effect caused by tiled textures in the distance, and can also create the effect of textures changing based on distance. This is used on Rainbow Road on the road, and [[Lunar Spaceway]] on the stars which change color based on how far away you are from them. Mipmap 1 is the closest and biggest, and mipmap 4 or 5 is usually the smallest and farthest, however a TEX0 file can store any number of mipmaps as needed.
+
=== Fix: Facepoint descriptor does not match linked nodes ===
 +
When you want to open a model made with CTools and fixed with SZS Modifier with newer versions of BrawlBox you will get the following error when you try to open your MDL: http://prntscr.com/a3mvcd
 +
BrawlBox will auto fix some issues in your BRRES, but this will make your textures distorted or solid color in game. To repair your textures open the UV folder inside your BRRES and set in EVERY reference "Force Float" and "Force Rebuild" to True. (Don't worry if one of the settings reset itself after you saved your file). Afterwards you still have to set your texture scale to (1,1) in your materials.
  
You need to do three things:
+
== Material Related ==
 +
=== Redirecting Materials ===
 +
Sometimes, if [[creating a BRRES with CTools]], there are duplicate textures. This can create extra materials, adding unneeded strain on the Wii. You can fix this using BrawlBox.
  
* Set mipmaps to display in the material: Browse to the "Materials" folder in the MDL0. Under each material's subfile(s) you will find the setting "MinFilter". Set it to Linear_Mipmap_Linear instead of Nearest.
+
Open your course_model.brres in BrawlBox and open the textures folder.
* Make '''sure''' the TEX0 file the material uses was imported with BrawlBox; '''NOT''' a TEX0 saved in CTools! CTools corrupts TEX0 files anytime it saves in such a way that they cannot display any mipmaps other than the first one. You can do this simply by right clicking a texture in the Textures folder (in the root of the BRRES, not the MDL0), and selecting "replace". Make sure to set the number of mipmaps you want in the texture importer before you hit "okay".
+
[[File:Mat-Redirect-TextFold.png|none|400px]]
* Replace individual 2nd, 3rd, 4th, and 5th mipmaps (as needed). This can be done easily in the [[SZS Modifier]] with minimal quality loss, or with [[Wiimms SZS Tools]] with no quality loss. Editing ONLY textures in the SZS Modifier and saving does not corrupt anything, however be careful not to save the MDL0 in the model editor as this may mess up texture mapping.
 
  
It is best to test mipmaps on a Wii. Dolphin will probably not display mipmaps properly unless you know exactly what you are doing with its settings.
+
Find the file name of the duplicate texture.
 +
Copy down the original texture name.
 +
[[File:Mat-Redirect-Dup-Tex-2.png|left|400px]]
 +
[[File:Mat-Redirect-Dup-Tex.png|none|400px]]
  
== Animation ==
+
Go into the MDL0 and into the Materials Folder.
 +
[[File:Mat-Redirect-MaterialFold.png|none|400px]]
  
=== SRT0 ===
+
Find the material with the duplicate texture.
''yet to be done''
+
[[File:Mat-Redirect-MaterialDup.png|none|400px]]
  
=== CLR0 ===
+
Using the original texture's name, open the material and rename the texture node to that.
''yet to be done''
+
[[File:Mat-Redirect-MaterialRenameOld.png|left|400px]]
 +
[[File:Mat-Redirect-MaterialRenameNew.png|none|400px]]
  
=== PAT0 ===
+
'''Optional:''' You can delete the duplicate texture(s) now.
''yet to be done''
 
  
== Make Sure BRRES Works ==
+
Save the course_model.brres and import it into your SZS.
  
Sometimes you may have a bit of trouble getting a BRRES made with CTools to open with BrawlBox, namely getting the MDL0 to open.
+
=== Opacity ===
 +
Enabling opacity on a mesh/polygon: see [[Creating_a_BRRES_with_BrawlBox#Materials|this section]]. This will fix the [[Harry Potter Effect]].
  
Luckily, there are multiple possible solutions to this problem:
+
=== Culling ===
 +
Special culling settings are mostly used for models which should be seen from both sides like fences. To set the culling, edit the CullMode setting in the material. See [[Creating_a_BRRES_with_BrawlBox#Culling|this section]].
  
* If you have 3DS Max or a similar powerful modelling program, delete any "default material" meshes using 3DS Max, then export using its OBJ exporter.
+
=== Mipmaps ===
* Re-open your new BRRES with the CTools BRRES Editor. Save, and it should now open with BrawlBox. Remember that you will need to re-import any textures that you want to use mipmaps in BrawlBox, because CTools creates TEX0 files that refuse to display anything but the first mipmap.
+
A mipmap is a smaller, more pixelated version of a texture which is stored in most TEX0 files. In a 3D display, smaller mipmaps are rendered at farther distances. The bigger a texture is scaled, the farther you must go to trigger a smaller mipmap. Mipmaps may help reduce GPU load, reduce [[moiré pattern]], and can also create the effect of textures changing based on distance. This is used on Rainbow Road on the road, and [[Lunar Spaceway]] on the stars which change color based on how far away you are from them. Mipmap 1 is the closest and biggest, and mipmap 5 is the smallest and farthest (after that you are too far away to see the texture), however a TEX0 file can store any number of mipmaps as needed.
* If for any reason the above methods failed, then you can open the SZS with your BRRES in it with the SZS Modifier. Open the Model with the SZS Modifier Model Editor, save, and the model should now work in BrawlBox.
 
  
'''Important!''' Sometimes the SZS Modifier will cause texture to become doubled in game after saving them. To resolve this issue, set every non-doubled texture's Texture Coordinate scale to (1,1), and every doubled texture's to (2,2).  
+
*Set mipmaps to display in the material: Browse to the "Materials" folder in the MDL0. Under each material's subfile(s) you will find the setting "MinFilter". Set it to Linear_Mipmap_Linear instead of Nearest.
 +
*Make '''sure''' the TEX0 file the material uses actually has mipmaps. If it doesn't, you can add them in BrawlBox by right clicking the texture and selecting "Re-Encode".
 +
&rarr; See more information [[Creating_a_BRRES_with_BrawlBox#MipMaps|here]].
  
If you use 3DS Max, you can add XForm UVW for all meshes with U and V 0,5 (Make sure "Apply to entire object" is ticked) to fix this problem. If you use Sketchup, just scale the materials for twice. (For example ''2000'' to ''4000''.)
+
&rarr; To make mipmaps with Wiimms Image Tool or to make mipmaps different textures, see [[Encoding_Mipmaps_with_Wiimms_Image_Tool|this tutorial]].
  
== Harry Potter Effect Fix ==
+
== Model Related ==
 +
=== Optimization ===
 +
It is possible to optimize a track's face-point count using BrawlBox's Tripstripper.
  
Open your BRRES in BrawlBox, open the MDL0 subfile, and then open the "Materials" subfolder. Browse to the material that represents a transparent texture that needs fixing, and set the transparent material's EnableAlphaFunction = true.  Next, select the + button beside each material. Select the file the appears under the current selected file, and change the Texture Coordinate's scale from (0,0) to (1,1), as this will avoid your texture from becoming a solid color in game. Repeat the step with each material with each transparent material, and then set every material's (Whether transparent or not) Texture Coordinate scale to (1,1).
+
Open the course_model.brres in BrawlBox and go into MDL0. Right-click and click ''Optimize Meshes''.  
 +
[[File:optimize-course-tut-optimize-dialog.png|none|400px]]
  
'''Important:''' If you are using a texture with opacity (a texture that is partially but not totally transparent), a different fix is needed, which is described at the top of the page; this fix is not necessary.
+
Dialog:
 +
<!--Descriptions will be edited over time.-->
 +
*[CheckBox] - Use Tripstrips - This enables the usage of the tripstripper. Have this on.
 +
*[TextBox] - Cache Size - This often lowers the face-point amount, however it might not. Set this to a lower number.
 +
*[TextBox] - Minimum Strip Size - This says how low BrawlBox can strip the face-point amount. Don't bother changing this one. 
  
Don't know what the HP effect is? [[Harry Potter Effect]]
+
Click ok when done. Now save your BRRES and import into the SZS file. Test in-game.
  
== Culling ==
+
=== Fixing Model Holes ===
 +
BrawlBox is known to occasionally shift vertices around or create a model with a seemingly missing triangle. The corresponding vertex simply was moved. This is possible to edit within BrawlBox, through the model editor. To access this, right-click on the MDL0 file and select "Preview".
  
Special Culling settings are mostly used for transparent materials like fences. It makes you see this texture from both sides instead of one side. To set the culling, edit the CullMode setting in the material. Cull_none =  you can see it from both sides.
+
Click the top of the application to bring down the menu bar. Navigate to Options > Settings and change the scale to 100 to be able to move about your model at a decent speed.
 +
Shift right-click and drag to move, and control right-click and drag to rotate.  
  
== Creating a Minimap ==
+
Then, go to the tools section, and enable the vertex editor option. A toolbox at the bottom should appear, showing the current number of vertices selected. Select your misaligned vertex, and type in the correct coordinates.
  
Since some may have trouble with properly creating a [[Minimap]], here is a guide to teach you how to do so with BrawlBox.
+
{{Custom Track Tutorial}}
 
+
[[category:Tutorials]][[category:Custom Track Tutorial]]
Import your Map model into the CTools BRRES Editor. When importing, make sure to select "Map Model". Name it map_model.brres Save in an SZS, and export export your new map model.
 
 
 
Now open your map_model.brres with BrawlBox. Select "Preview" on the map model. A window with four buttons should appear. Select the one on the right, on the left, & on the bottom. Select "PosLD", which should be all the way to the right.
 
 
 
Now open the SZS containing your map_model.brres with the SZS Modifier. Open the BRRES, then select the model. The SZS Mod's model editor should open. Press "Tools > Minimap Control". Copy the number number from "Left Down". In BrawlBox, look down at the bottom panel, and paste this number into "Translation X". Now copy the second number from "Left Down", and paste it into "Translation Z".
 
 
 
Next, select "PosRU" in BrawlBox. Look at "Right Up" in the SZS Modifer's Minimap control. Do exactly what you did in the previous step; First number goes into "Translation X", and the second number into "Translation Z".
 
 
 
Experiment with editing the Y Translations & both PosLD & PosRU to give your Minimap depth, or if you want to keep your Minimap and alternative dark color apart for the traditional minimap, then leave the Y Translation un touched.
 

Latest revision as of 16:53, 18 December 2022

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

Introduction

This page describes several tricks to do in BrawlBox.

The Creating a BRRES with BrawlBox page contains mainly information regarding how to create the BRRES from scratch using BrawlBox, but which also might be useful when editing an existing BRRES.

Make Sure BRRES Works

Sometimes you may have a bit of trouble getting a BRRES made with CTools to open with BrawlBox, namely getting the MDL0 to open. There are multiple possible solutions to this problem:

  • If you have 3ds Max or a similar powerful modelling program, delete any "default material" meshes using 3ds Max, then export using its OBJ exporter.
  • Re-open your new BRRES with the CTools BRRES Editor. Save, and it should now open with BrawlBox. Remember that you will need to reimport any textures that you want to use mipmaps in BrawlBox, because CTools creates TEX0 files that refuse to display anything but the first mipmap.
  • If for any reason the above methods failed, then you can open the SZS with your BRRES in it with the SZS Modifier. Open the Model with the SZS Modifier Model Editor, save, and the model should now work in BrawlBox.

Important! Sometimes the SZS Modifier will cause textures to become doubled in game after saving them. To resolve this issue, set every non-doubled texture's Texture Coordinate scale to (1,1), and every doubled texture's to (2,2).

If you use 3ds Max, you can add XForm UVW for all meshes with U and V 0,5 (Make sure "Apply to entire object" is ticked) to fix this problem. If you use SketchUp, just scale the materials for twice. (For example 2000 to 4000.)

Fix: Facepoint descriptor does not match linked nodes

When you want to open a model made with CTools and fixed with SZS Modifier with newer versions of BrawlBox you will get the following error when you try to open your MDL: http://prntscr.com/a3mvcd BrawlBox will auto fix some issues in your BRRES, but this will make your textures distorted or solid color in game. To repair your textures open the UV folder inside your BRRES and set in EVERY reference "Force Float" and "Force Rebuild" to True. (Don't worry if one of the settings reset itself after you saved your file). Afterwards you still have to set your texture scale to (1,1) in your materials.

Material Related

Redirecting Materials

Sometimes, if creating a BRRES with CTools, there are duplicate textures. This can create extra materials, adding unneeded strain on the Wii. You can fix this using BrawlBox.

Open your course_model.brres in BrawlBox and open the textures folder.

Mat-Redirect-TextFold.png

Find the file name of the duplicate texture. Copy down the original texture name.

Mat-Redirect-Dup-Tex-2.png
Mat-Redirect-Dup-Tex.png

Go into the MDL0 and into the Materials Folder.

Mat-Redirect-MaterialFold.png

Find the material with the duplicate texture.

Mat-Redirect-MaterialDup.png

Using the original texture's name, open the material and rename the texture node to that.

Mat-Redirect-MaterialRenameOld.png
Mat-Redirect-MaterialRenameNew.png

Optional: You can delete the duplicate texture(s) now.

Save the course_model.brres and import it into your SZS.

Opacity

Enabling opacity on a mesh/polygon: see this section. This will fix the Harry Potter Effect.

Culling

Special culling settings are mostly used for models which should be seen from both sides like fences. To set the culling, edit the CullMode setting in the material. See this section.

Mipmaps

A mipmap is a smaller, more pixelated version of a texture which is stored in most TEX0 files. In a 3D display, smaller mipmaps are rendered at farther distances. The bigger a texture is scaled, the farther you must go to trigger a smaller mipmap. Mipmaps may help reduce GPU load, reduce moiré pattern, and can also create the effect of textures changing based on distance. This is used on Rainbow Road on the road, and Lunar Spaceway on the stars which change color based on how far away you are from them. Mipmap 1 is the closest and biggest, and mipmap 5 is the smallest and farthest (after that you are too far away to see the texture), however a TEX0 file can store any number of mipmaps as needed.

  • Set mipmaps to display in the material: Browse to the "Materials" folder in the MDL0. Under each material's subfile(s) you will find the setting "MinFilter". Set it to Linear_Mipmap_Linear instead of Nearest.
  • Make sure the TEX0 file the material uses actually has mipmaps. If it doesn't, you can add them in BrawlBox by right clicking the texture and selecting "Re-Encode".

→ See more information here.

→ To make mipmaps with Wiimms Image Tool or to make mipmaps different textures, see this tutorial.

Model Related

Optimization

It is possible to optimize a track's face-point count using BrawlBox's Tripstripper.

Open the course_model.brres in BrawlBox and go into MDL0. Right-click and click Optimize Meshes.

Optimize-course-tut-optimize-dialog.png

Dialog:

  • [CheckBox] - Use Tripstrips - This enables the usage of the tripstripper. Have this on.
  • [TextBox] - Cache Size - This often lowers the face-point amount, however it might not. Set this to a lower number.
  • [TextBox] - Minimum Strip Size - This says how low BrawlBox can strip the face-point amount. Don't bother changing this one.

Click ok when done. Now save your BRRES and import into the SZS file. Test in-game.

Fixing Model Holes

BrawlBox is known to occasionally shift vertices around or create a model with a seemingly missing triangle. The corresponding vertex simply was moved. This is possible to edit within BrawlBox, through the model editor. To access this, right-click on the MDL0 file and select "Preview".

Click the top of the application to bring down the menu bar. Navigate to Options > Settings and change the scale to 100 to be able to move about your model at a decent speed. Shift right-click and drag to move, and control right-click and drag to rotate.

Then, go to the tools section, and enable the vertex editor option. A toolbox at the bottom should appear, showing the current number of vertices selected. Select your misaligned vertex, and type in the correct coordinates.