BrawlBox Tricks

From Custom Mario Kart
Jump to navigation Jump to search
Under Construction
This article is not finished. Help improve it by adding accurate information or correcting grammar and spelling.

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

Opacity

To enable opacity on a mesh/polygon, browse to the mesh's material (This is found in the MDL0, THIS IS NOT THE TEXTURE!!).
Set the following settings:

  • Ref0 and Ref 1: 0
  • Comp0 and Comp1: Always
  • EnableBlend = true
  • 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).

Mipmaps

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.

You need to do three things:

  • 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 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".
  • 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.

Animation

SRT0

Port an Existing Animation

To port an existing animation, such as water, you will need to first export a base SRT0. First, extract a Nintendo track's SZS and then export the course_model.brres, then open it in BrawlBox. Then find AnmTexSrt(NW4R) and open it and export the SRT0 file. Next go into the MDL0, and go into the materials folder and find the material with the water in it. Export the references inside the material. Then click on the material and look which shader it is linked to. This is important, because layered materials need a different Shader than normal materials (otherwise skip the Shader steps). Export that shader. Then go to the textures folder and export the textures with the same names as the references (I.E. yo_wave_tex, ef_prj_glow.) Then open your course_model with BrawlBox. First right click on the BRRES and Import texture animation and import the SRT0. Then open the MDL0 (If BrawlBox can't open it then it's corrupt) and go to materials and find your water. Now import the material references and the shader. Make sure on that the shader links to the material (It's in the options bar).

File:Link shader to material.JPG
Linking a material to shader


Then replace your water texture with the other one you exported and import the others. Make sure they link to the references in the material.

File:Link reference to texture.JPG
Linking a texture to reference.


Then copy the material name and rename the SRT0 entry to the same thing.

Rename the SRT0 entry to the name of the texture name you copied down from MDL0->Materials.


Save and import back into your SZS. DO NOT SAVE YOUR SZS WITH BRAWLBOX! It messes up the file locations and makes the track crash.

CLR0

yet to be done

PAT0

yet to be done

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.

Luckily, 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 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.
  • 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).

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.)

Harry Potter Effect Fix

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).

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.

Don't know what the HP effect is? Harry Potter Effect

Culling

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.

Creating a Minimap

Since some may have trouble with properly creating a Minimap, here is a guide to teach you how to do so with BrawlBox.

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. This allows you to use different Y values in your model.