Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Spotlight: Señor Casaroja's Noesis

General game file tools that are useful for more than one game
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

I'm trying to get this whole tristrip thing working if I'm not given an index buffer and following this explanation: http://www.codercorner.com/Strips.htm

But the output is all wrong.

So for example in this format: viewtopic.php?f=16&t=8037 (first post)
I don't know how the faces are defined, but I see a bunch (thousands...) of vertex groups, so maybe I just have to make triangle strips.

Based on the website I just have to read the vertices in, and then start stringing them together

012
123
234
...

So I went and manually created a list of indices, passed it to the createTriStrip function, and then put them all into bytes before committing them.

And it doesn't work as intended lol
Faces are drawn, but it's wrong. It also crashes without giving that "noesis has crashed! Send the log?" message if I loop several hundred times (> 200)

There's probably a faster way to do this?
You do not have the required permissions to view the files attached to this post.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

I'm not sure why you are still trying to pass triangle strips to createTriStrip. I thought I had explained that createTriStrip creates triangle strips from lists, it doesn't decode strips, hence the function name. :)

If you want to feed vertices to Noesis in the form of a triangle strip without an actual index buffer, you can use immBegin/immEnd with RPGEO_TRIANGLE_STRIP and feed the verts in order, or you can use CommitTriangles with RPGEO_TRIANGLE_STRIP and pass None for the indices and the number of vertices as the number of indices. (after you bind your vertex buffers)
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Would [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] be a valid triangle list for that function?
Last edited by finale00 on Fri Jan 13, 2012 11:10 pm, edited 2 times in total.
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

No, that's a strip. The number of entries in a triangle list has to be evenly divisible by 3. So for example if you fed [0, 1, 2, 2, 1, 3] to createTriStrip you would get back something like [0, 1, 2, 3].
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

I've seen several formats that store the bone index and weights for each vertex with the vertices themselves (which makes sense I guess)

So for example if it's something like

Code: Select all

struct vertex { #52 bytes
    float[3] positions
    float[3] normals
    byte[4] bone indices
    float[4] bone weights (corresponding to each bone)
    float[2] uv
}
Do I just bind the same way like the other data? ie:

Code: Select all

...
rapi.rpgBindBoneIndexBuffer(vertBuff, noesis.RPGEODATA_BYTE, 52, 24)
rapi.rpgBindBoneWeightBuffer(vertBuff, noesis.RPGEODATA_FLOAT, 52, 28)
...
The __NPexample file shows something about flat weights and building a list of NoeVertWeight objects.
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

Trivial issue: I want to read 10 half-floats.
What's the fastest way to do it?

loop + readHalfFloat()?

2. Uncompressed DDS. Which texFmt do I use?
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

Sounds like howfie is handling the triangle strips incorrectly. Deriving triangle winding from vertex normals is a Bad Idea, and there's no way Namco's engineers would write something that does that at load/run time. I'm betting that if you feed the index buffer through Noesis using RPGEO_TRIANGLE_STRIP, it will work just fine, as it natively recognizes (and allows you to set custom terminators for) 360/PS3 triangle strips.

As for uncompressed DDS, DDS files can be in shitloads of formats so the format depends on the DDS header. If you meant to say DXT instead of DDS, then you'd want to use the appropriate DXT type. Given that the DXT data is from a console game, you may also have to endian-swap it first. See the Bullet Witch script for examples, it handles virtually every type of DXT data and demonstrates endian-swapping it as well as untiling it. That game is from PS3 from what I gathered from the thread, though, so you shouldn't need to untile.

I'm again going to guess that howfie misspoke there, and he meant the texture data is headerless DXT, not headerless DDS, as headerless DDS makes no real sense. :) You'll probably want to use NOESISTEX_DXT1-NOESISTEX_DXT5 on the data. Again, endian-swapping may or may not be necessary. If it is necessary, you just need to do something like "data = rapi.swapEndianArray(data, 2)".

And, finally, half-floats. If you need to read a bunch to build a list of floats (that is, you need them in floating point format and not as raw bytes), I would say a loop is best. However, keep in mind that the rpg interface also supports half-floats natively. So if they're a vertex component or something, you can use RPGEODATA_HALFFLOAT to feed them in with a rpgBind* call. For example, "rapi.rpgBindUV1BufferOfs(vertBuffer, noesis.RPGEODATA_HALFFLOAT, vertexSize, uvOffset)".

Edit: Oh, and yes, when vertex weights are part of the central vertex structure, you just bind the buffers like any other vertex component. The flat weights structure is for converting variable-sized weights to a flat array format that can be conveniently bound with a fixed stride.
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Señor Casaroja's Noesis

Post by howfie »

By uncompressed DDS I meant uncompressed ABGR data without a DDS header. To save the textures I generate a DDS header with the xentax.WriteUncompressedDDSHeader(...) function. In the C++ versions of my rips you will also see code for generating DXT1 to DXT5 headers as well. Just pass it the width and height, whether or not it has mipmaps or not and you are rearing to go. You could actually save the tekken texture data after saving BITMAPFILE and BITMAPINFO HEADERs and it would work too. So uncompressed ABGR would be a better term, but sorry, it saved me from typing a letter LOL :-P!
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

When assigning materials in immediate mode, do I just call rapi.rpgSetMaterial before I start making the triangles?
How about per-face materials? call the function inside the loop for every iteration?
Last edited by finale00 on Tue Jan 17, 2012 5:30 am, edited 1 time in total.
itoikenza
advanced
Posts: 52
Joined: Sat Jan 07, 2012 2:24 am
Has thanked: 9 times
Been thanked: 2 times

Re: Señor Casaroja's Noesis

Post by itoikenza »

anybody ever rip Square Enix's Virtual World models. I'm particularly interested in frimelda... Also this is another personal request. About the data viewer. MrAdults Could you please rework the way model's can be manipulated? maybe by mouse or even arrow keys? Binding of any joint to it would be awesome. Toggle'd via middle mouse button or "t" to lock in new position... And a key "r" to rotate through each joint.. Plus the ability to save each frame towards a new anim? For those of us who dont want a kinect...
MrAdults
Moderator
Posts: 1007
Joined: Mon Mar 23, 2009 2:57 am
Has thanked: 44 times
Been thanked: 505 times

Re: Señor Casaroja's Noesis

Post by MrAdults »

finale00 wrote:When assigning materials in immediate mode, do I just call rapi.rpgSetMaterial before I start making the triangles?
How about per-face materials? call the function inside the loop for every iteration?
Yes you do. And yes you do. Just don't call rapi.rpgSetMaterial between rpgBegin and rpgEnd. (in keeping with functionality identical to OpenGL rendering in immediate mode) If every triangle has a unique material, then you have to call rpgBegin and rpgEnd for each triangle. This isn't actually a bad idea, and shouldn't have any considerable overhead, so don't be afraid of doing it that way.

Preemptive apologies for being less frequent and prompt in the coming days/weeks, another contract job has come up, and I've started another personal side project on top of that.
User avatar
SILENTpavel
advanced
Posts: 54
Joined: Fri Aug 05, 2011 5:53 am
Has thanked: 87 times
Been thanked: 16 times

Re: Señor Casaroja's Noesis

Post by SILENTpavel »

del [the problem is solved]
Chthonic
n00b
Posts: 10
Joined: Sun Jan 22, 2012 9:08 pm
Has thanked: 2 times

Re: Señor Casaroja's Noesis

Post by Chthonic »

First I want to say, that most of you guys are amazing with what you can do. I didn't know some thing you can do with the reverse engineering. I was curious though. I'm a huge Macross Fan and was wondering how would I use this program to extract some of the models from some of the PSP games that have come out. Any help would be great. Thanks
finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 307 times

Re: Señor Casaroja's Noesis

Post by finale00 »

If you can get the model files and they happen to be GMO format that's already supported then you should be able to do stuff with them.

Otherwise you're stuck with either figuring it out yourself or posting it in the 3D section and hoping someone will help you out.
Azurfan
advanced
Posts: 61
Joined: Wed Jun 23, 2010 10:12 pm
Has thanked: 23 times
Been thanked: 3 times

Re: Señor Casaroja's Noesis

Post by Azurfan »

I have a minor question: Is it possible to save a model's pose? Or is it possible to view and enter the location and rotation coordinates by hand? That would be really useful.
Post Reply