BMD file

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search

Editor's note: This page is under construction.

Pikmin 2's 3D models exist inside .bmd files.

Material data[edit]

SuperBMD can dump the material data of a model into a handy JSON (JavaScript Object Notation) file. This dump outputs a mat.json file and a texheader.json file. mat.json contains the data related to the model's material. This section will document these JSON files instead of the actual material format used by Pikmin 2.

mat.json[edit]

"Name" Name of material that is being defined.
"Flag" Material flag value. A value of 1 is used for almost all solid materials, while 4 is used for transparent materials.
"ColorChannelControlsCount" Amount of color channel controls.
"NumTexGensCount" Amount of texture generators.
"NumTevStagesCount" Amount of tev stages.
"Textures" The list of textures that the material uses, in square brackets
"IndTexEntry"
"HasLookup"
"IndTexStageNum"
"TevOrders"
"TexCoord"
"TexMap"
"Matrices"
"Matrix"
"Exponent"
"Scales"
"ScaleS"
"ScaleT"
"TevStages" This TevStages does not do much, and is not as important as the following TevStages.
"TevStage"
"IndTexFormat"
"InTedBiasSel"
"IndTexWrapId"
"IndTexWrapS"
"IndTexWrapT"
"AddPrev"
"UtcLod"
"AlphaSel"
"CullMode" Determines which faces to render. "None" shows both sides of the face, "Front" shows the back side of the face, "Back" shows the front side, and "Both" does not show the face at all.
"MaterialColors"
"ChannelControls"
"Enable"
"MaterialSrcColor"
"LitMask"
"DiffuseFunction"
"AttenuationFunction"
"AmbientSrcColor"
"AmbientColors"
"LightingColors"
"TexCoord1Gens"
"Type"
"Sources"
"TexMatrixSource"
"PostTexCoordGens"
"TexMatrix1"
"Projection"
"Type" Determines what the texture does. 0, 1, and 7 are the most used.
"EffectTranslation"
"Scale" The bigger the number, the smaller the texture is scaled on the material.
"Rotation"
"Translation"
"ProjectionMatrix"
"PostTexMatrix"
"TevOrders"
"TexCoord"
"TexMap"
"ChannelId"
"ColorSels"
"AlphaSels"
"TevColors"
"KonstColors"
"TevStages" The T-E-V stands for Texture Environment Unit. It is a rendering engine that uses input sources to achieve special effects. Has several possible options, for both the Color and the Alpha. "TexColor" or "TexAlpha" uses the texture's color or alpha, respectively. "Konst" uses a Konst color. "RasColor" or "RasAlpha" uses rasturized color. "ColorPrev" or "AlphaPrev" uses the previous stage's color or alpha, respectively. "One" uses 1, "Half" uses 0.5, and "Zero" uses 0. If all inputs are set to Zero, the image will appear black in-game.
"ColorInA" One of the 4 color inputs.
"ColorInB" One of the 4 color inputs.
"ColorInC" One of the 4 color inputs.
"ColorInD" One of the 4 color inputs.
"ColorOp" Short for ColorOperator, couple of different available options. "Add" makes this equation be used: ColorInD + (ColorInA + (ColorInB * ColorInA)) "Sub" is similar, except ColorInD is subtracted instead.
"ColorBias" A small multiplier, it has no large effect. Leaving this at "Zero" usually works fine.
"ColorScale" "Scale_1" multiplies the result by 1 (so nothing changes), "Scale_2" multiplies the result by 2, and "Scale_4" quadruples it. "Divide_2" divides result by 2, giving a lower value.
"ColorClamp"
"ColorRegId" The channel the result is put into. TevPrev = The final output channel. TevReg0 = first output channel. TevReg1 = second output channel. TevReg2 = third output channel.
"AlphaInA" One of the 4 alpha inputs.
"AlphaInB" One of the 4 alpha inputs.
"AlphaInC" One of the 4 alpha inputs.
"AlphaInD" One of the 4 alpha inputs.
"AlphaOp" Short for AlphaOperator, it uses the same options as "ColorOp".
"AlphaBias" A small multiplier, it has no large effect. Leaving this at "Zero" usually works fine.
"AlphaScale" Uses the same options as ColorScale.
"AlphaClamp"
"AlphaRegId" The channel the result is put into. Uses the same settings as "ColorRegId".
"SwapModes" Determines the channel that each channel will draw from. 0 = Sample from Red 1 = Sample from Green 2 = Sample from Blue 3 = Sample from Alpha.
"RasSel"
"TexSel"
"SwapTables"
"FogInfo"
"RangeAdjustmentTable"
"AlphCompare" Creates a filter based on the Alpha of the pixel that determines whether or not that pixel is rendered.
"Comp0"
"Reference0"
"Operation"
"Comp1"
"Reference1"
"BMode" Determines how a mesh is rendered in relation to meshes that have already been rendered.
"Type"
"SourceFact"
"DestinationFact"
"Operation"
"ZMode"
"Enable"
"Function"
"UpdateEnable"
"ZCompLoc"
"Dither"
"NBTScale"
"Unknown1"