Kuribo64
Views: 20,050,632 Home | Forums | Uploader | Wiki | Object databases | IRC
Rules/FAQ | Memberlist | Calendar | Stats | Online users | Last posts | Search
04-24-24 08:48 AM
Guest:

Main - Posts by blank

Pages: 1 2 3 4 5 6 7
blank
Posted on 01-12-13 01:08 PM, in Unexpected issues Link | #5470
But you didn't fix Yaz0File. The way it works now is really bad designwise, as it is counter intuitive and is just asking to be used in a wrong way.

blank
Posted on 01-28-13 07:34 AM, in [Coastline Cavern Galaxy] Getting the model working Link | #10518
There is no reason why blender models should be harder to convert than models made by other programs. If you are having problems, somebody should proabably tell me about it, so I might have a chance to fix them.

blank
Posted on 02-03-13 02:53 PM, in Model formats - A better understanding Link | #13028
Posted by SuperMario64DS
Plans to add BDL support to the popular Brawl editing software, BrawlBox, has been rumoured for quite some time, however, the creators won't even consider other formats without a full analysis.


Have you actually talked to BlackJax about this, or have you just heard some rumours? Because I don't really feel it's worth the time to write a full description if I'm the only one working on BDL editing tools anyway.

blank
Posted on 02-03-13 07:42 PM, in Model formats - A better understanding (rev. 2 of 02-03-13 07:49 PM) Link | #13245
Posted by SuperMario64DS
Posted by blank
Have you actually talked to BlackJax about this, or have you just heard some rumours? Because I don't really feel it's worth the time to write a full description if I'm the only one working on BDL editing tools anyway.


They have hinted support for other games before, Twilight Princess & such. Even so, this information should be readily available to anyone who needs it, there are other people within the Mario Kart community as well who have an interest in this format too.


I do agree that the BMD/BDL file format should be documented in such a way, but if there's nobody who actually needs it, I don't really feel like writing it at the moment.

Posted by NWPlayer123
This is kinda off-topic, but Twilight Princess can already be somewhat hacked, since Wind Maker supports Twilight Princess (to an extent), however, it uses BMD or BDL as well, so IDK why.
However, I do agree with blank being hesitant to fully figure all this stuff out.


It's not about figuring anything out. Everything but a few minor things has been figured out. It's just about writing documentation.

EDIT:
Posted by SuperMario64DS
Please, that's not helping. The longer you withhold any information, the longer you'll have to to wait for good, rigged, models. Again, there are many people interested in this format, many thinking of Zelda hacks, many in Mario Kart hacking, people here, and myself as well.

If you choose to not release this information, go ahead. Just keep in mind that you're ceasing any opportunities for this possibility of a more functional importer & editor being created.


If anybody is interested in working on BMD/BDL editing, they can contact me. And I'm not withholding any information, I just choose not to write it up in an easy accessible way. The most important parts of the documentation can already be found in the source of bmdview2 anyway.

blank
Posted on 02-07-13 11:53 AM, in Custom planets! Link | #14104
No. The only planets in SMG2 with the WaterFlag set is NewOnimasuPlanet and StarCreekPlanet, and there is far more planets with water collision models.

By the way, water collision models are stored in MoveLimit.kcl files. But these MoveLimit.kcl files aren't necessarily water collision, they can also be other things such as gravity changing boundaries. I don't know exactly how the game decides what is water and what is something else, but I'm guessing it has something to do with areas.

blank
Posted on 02-10-13 07:41 AM, in PyBCK - Animation Reader Link | #14620
The only thing I noticed after a brief look that might cause problems is that you only export/import one scale, translation and rotation per joint. I don't have any BCK files at my disposal at the moment, so I can't really test it.

blank
Posted on 02-12-13 06:45 AM, in Model formats - A better understanding Link | #14984
The dark textures might be caused by ColorChanInfo, which thakis didn't get quite right. It should be

struct ColorChanInfo
{
u8 enable;
u8 matColorSource;
u8 litMask;
u8 diffuseAttenuationFunc;
u8 attenuationFracFunc;
u8 ambColorSource;
u8 pad[2];
};

As for bump mapping that's done through indirect texturing. The information on indirect texturing is stored in MatIndirectTexturingEntry

struct IndTexOrder
{
u8 texcoord;
u8 texmap;
u16 padding0;
};

struct IndTexMatrix
{
f32 offset_matrix[2][3];
s8 scale_exponent;
u8 padding0[3];
};

struct IndTexCoordScale
{
u8 scale_s;
u8 scale_t;
u16 padding0;
};

struct TevIndirect
{
u8 indtex;
u8 format;
u8 bias;
u8 mtx;
u8 wrap_s;
u8 wrap_t;
u8 addprev;
u8 utclod;
u8 a;
u8 padding0[3];
};

struct MatIndirectTexturingEntry
{
u8 unknown0; // always 0 or 1
u8 unknown1; // unknown1 = unknown0, one of these are numindtexs
u16 padding0;

IndTexOrder indtexorder[4]; // arguments to GX_SetIndTexOrder
IndTexMatrix indtexmatrix[3]; // arguments to GX_SetIndTexMatrix
IndTexCoordScale indtexcoordscale[4]; // arguments to GX_SetIndTexCoordScale
TevIndirect tevindirect[16]; // arguments to GX_SetTevIndirect
};

blank
Posted on 02-13-13 07:31 PM, in Model formats - A better understanding (rev. 2 of 02-13-13 07:38 PM) Link | #15210
I took a quick look at the shader generation code, and rasterizer color selection isn't implemented. That could be the cause of the dark textures.

blank
Posted on 02-14-13 08:47 AM, in Model formats - A better understanding Link | #15325
After a considerably closer look I can say that it is definitely lighting that's the issue. That particular material has the alpha channel lit but not the RGB channel. But bmdview2 only checks whether the RGB channel is lit. That and lighting isn't really implemented.

blank
Posted on 02-14-13 07:53 PM, in Model formats - A better understanding (rev. 2 of 02-14-13 07:59 PM) Link | #15358
Color channels are basically what produces the rasterizer color. There are two color channels, a primary and a secondary. Each channel takes as input a material color and an ambient color, and calculates an output color based on the channels lighting configuration. That color can then be used in the TEV stages.

But color and alpha can be configured separately, and the material in WoodCircleCutPlanet.bdl with the dark texture problem has lighting enabled for the alpha channel but not for the color channel.

Try looking here: http://libogc.devkitpro.org/gx_8h.html. The relevant functions are GX_SetChanCtrl, GX_SetChanMatColor and GX_SetChanAmbColor. The relevant information in bmdview2 in the Material struct is chanControls, color1 (arguments to GX_SetChanMatColor) and color2 (arguments to GX_SetChanAmbColor).

Posted by dash
EDIT: Possibly your statements are connected to your definition of the ColorChanInfo struct you provided earlier. That has 2 fields, enable and litMask. In the WoodCircleCutPlanet.bdl the array of those structures has 5 entries:
colorChanInfo: 000100020100ffff 010104020100ffff 010000010000ffff 000000000200ffff 000000020100ffff (5 many)

The material 6 structure has this for chanControls:
chanControls (?): 0000000100020003

The bmdview2 source looks at chanControls[0] (the first entry, 0000). The whitehole source just skips over the chanControls array.


Yes, that is the problem: bmdview only looks at chanControls[0] (the channel controls for the primary color channel) but not at chanControls[1] (the channel controls for the primary alpha channel).

blank
Posted on 02-15-13 06:44 AM, in Model formats - A better understanding Link | #15498
Posted by dash
According to the debug dump from bmdview2 it is saying numChans=00 for all the materials. I sort of grasp the 3 different options for GX_SetNumChans(), but it was looking like the numchans was always getting set to 0. But it appears there is a table lookup, so that numChans=00 is indexing into a table:
numChans (?) (unk[2]): 01 54 68 69 (4 many)

Which would mean we actually are doing GX_SetNumChans(1). Similiarly it looks like each material has a tevcount number, but those only make sense if they're also indexing into a table:
tevStageCounts (unk[4]): 02 01 54 68 (4 many)


Yes, just about everything in the materials are indices into some table.

Posted by dash
But are you sure the chanControls[] table works as you suggest? It would make more sense (to me at least) if that table indexes into the colorChanInfo table, but NOT where chanControls[0] is associated with the rgb, and chanControls[1] is associated with the alpha.

See, you've got 0, 1 or 2 channels feeding into the TEV pipeline. You've got a big table of control settings for a channel. A material would need a small table indexing into the channel control settings table for anywhere from 0 to 2 channels being used. So whoever worked out this storage format leaves space for 4, to accomodate a bit of future expansion (one more channel).


chanControls[0] references the controls for the primary color channel (GX_COLOR0), chanControls[1] references the controls for the primary alpha channel (GX_ALPHA0), chanControls[2] references the controls for the secondary color channel (GX_COLOR1) and chanControls[3] references the controls for the secondary alpha channel (GX_ALPHA1). I'm certain of that.

blank
Posted on 02-15-13 03:52 PM, in Model formats - A better understanding Link | #15540
It's a common misunderstanding that alpha is same as transparency, but it's not. Alpha is an extra auxiliary value that can be used for a lot of different things. In the gamecube/wii, what the alpha value is used for depends on stuff like the TEV stages, alpha compare settings and blend mode.

As for what to do to fix the problem, I don't really know either. Lighting isn't really implemented in bmdview2, and properly implementing it is more work than it's worth, in my opinion.

blank
Posted on 04-01-13 01:08 PM, in PyBCK - Animation Reader Link | #18983
You forget to align trans_offset.

blank
Posted on 04-05-13 03:52 PM, in Model formats - A better understanding Link | #19202
The MDL3 section contains the materials of the model, but in a format different from the MAT3 section. In the MAT3 section the materials are stored as arguments to the GX functions, while in the MDL3 section they are stored as raw GP packets.

blank
Posted on 04-06-13 06:36 AM, in Model formats - A better understanding (rev. 2 of 04-06-13 02:35 PM) Link | #19243
Posted by Marionumber1
What is the reason for having both?


I don't really think there is a good reason. They probably added the MDL3 section because the GP packets are faster to load, and kept the MAT3 section because the BDL format is supposed to be an extension of the BMD format.

Posted by JwopDk
Once I get enough info I might see if I can create a BMD to BDL converter by inserting an empty (yet valid) MDL3 Section into the output BDL file and then maybe go from there.


That was also my first idea, but that won't work. You might want to read this thread (you'll have to sign up to the forum to see it) to see what have already been done.

EDIT: You might also find this thread interesting.

blank
Posted on 04-06-13 11:22 AM, in Model formats - A better understanding Link | #19246
There is some texture matrix info and one unknown in the MAT3 section that is not in the MDL3 section, so MDL3 is not a complete replacement for MAT3. But other than those two things, the information in the two sections is the exact same, just stored in different formats.

blank
Posted on 04-13-13 04:12 PM, in Model formats - A better understanding Link | #20052
struct TexMtxInfo
{
u8 projection;
u8 type;
u16 paddding0; // 0xFFFF

f32 center_s,center_t;
f32 unknown0;
f32 scale_s,scale_t;

u16 rotate; // -32768 = -180 deg, 32768 = 180 deg
u16 padding1; // 0xFFFF

f32 translate_s,translate_t;

f32 prematrix[4][4];
};

The projection field can be either GX_TG_MTX3x4 and GX_TG_MTX2x4.

The type field specifies which texture matrix type to use. I've found 6 different types in SMG2:

type=0x00
Always combined with projection=GX_TG_MTX2x4 and has regular texture coordinates as source. This is the simplest and most common type. The texture coordinates is first rotated and scaled about (center_s,center_t) and then translated.

type=0x06
Always combined with projection=GX_TG_MTX2x4 and has transformed normals as source. The normals are first projected with the matrix [[0.5, 0, 0, 0.5], [0, 0.5, 0, 0.5]] and then the same transformations as for type=0x00 are applied.

NOTE: It is possible that the matrix prematrix is applied to the normals before they are projected.

type=0x07
Always combined with projection=GX_TG_MTX3x4 and has transformed normals as source. Same as for type=0x06 except the projection matrix is [[0.5, 0, -0.5, 0], [0, 0.5, -0.5, 0], [0, 0, -1, 0]].

type=0x08
Always combined with projection=GX_TG_MTX3x4 and has untransformed position coordinates as source. First the matrix prematrix is applied to the coordinates, then the coordinates is projected by the matrix [[0.5, 0, 0.5, 0], [0, -0.5, 0.5, 0], [0, 0, 1, 0]] and then the same transformations as for type=0x00 are applied.

type=0x09
Always combined with projection=GX_TG_MTX3x4 and has transformed position coordinates as source. I don't know how this works, but I think it's just like type=0x08 but with transformed position coordinates.

type=0x80
Always combined with projection=GX_TG_MTX2x4 and has regular texture coordinates as source. I don't know how this works either, but it seems to be like type=0x00 except it uses unknown0 in some way.

blank
Posted on 04-14-13 04:25 AM, in Model formats - A better understanding Link | #20293
This is the python code I use to generate texture matrix commands for the MDL3 section

def SetTexMatrix(self,slot,args):
c = cos(args.rotate)
s = sin(args.rotate)
R = numpy.matrix([[c,-s,0],[s,c,0],[0,0,1]])
S = numpy.matrix([[args.scale_s,0,0],[0,args.scale_t,0],[0,0,1]])
C = numpy.matrix([[1,0,args.center_s],[0,1,args.center_t],[0,0,1]])
T = numpy.matrix([[1,0,args.translate_s],[0,1,args.translate_t],[0,0,1]])

if args.type == 0 or args.type == 0x80:
P = numpy.matrix([[1,0,0,0],[0,1,0,0],[0,0,0,1]])
elif args.type == 6:
P = numpy.matrix([[0.5,0,0,0.5],[0,0.5,0,0.5],[0,0,0,1]])
elif args.type == 7:
P = numpy.matrix([[0.5,0,-0.5,0],[0,0.5,-0.5,0],[0,0,-1,0]])
elif args.type == 8 or args.type == 9:
P = numpy.matrix([[0.5,0,0.5,0],[0,-0.5,0.5,0],[0,0,1,0]])

M = T*C*S*R*C.I*P*numpy.matrix(args.premtx)

if args.projection == gx.TG_MTX2x4:
self.texmatrix[slot][:] = (M[i,j] for j in range(4) for i in range(2))
elif args.projection == gx.TG_MTX3x4:
self.texmatrix[slot][:] = (M[i,j] for j in range(4) for i in range(3))

C.I is the inverse of the C matrix. As you can see, I have chosen to apply the prematrix for all types, but I am not sure this is correct. It will need some more testing.

blank
Posted on 04-14-13 07:06 AM, in Model formats - A better understanding Link | #20299
I'm pretty sure those values aren't there. They definitely aren't in the MDL3 section and I haven't found anything that looks like them in the MAT3 section.

blank
Posted on 04-14-13 07:40 AM, in Model formats - A better understanding Link | #20301
I don't have the Link model from Wind Waker, so I don't even know what the exact problem is. How does his eyes look as it is now?
Pages: 1 2 3 4 5 6 7

Main - Posts by blank

Page rendered in 0.060 seconds. (2048KB of memory used)
MySQL - queries: 21, rows: 138/138, time: 0.020 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.