Page 49 of 123

Re: Señor Casaroja's Noesis

Posted: Fri Jan 13, 2012 7:21 pm
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?

Re: Señor Casaroja's Noesis

Posted: Fri Jan 13, 2012 10:13 pm
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)

Re: Señor Casaroja's Noesis

Posted: Fri Jan 13, 2012 10:52 pm
by finale00
Would [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] be a valid triangle list for that function?

Re: Señor Casaroja's Noesis

Posted: Fri Jan 13, 2012 11:01 pm
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].

Re: Señor Casaroja's Noesis

Posted: Sun Jan 15, 2012 4:05 am
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.

Re: Señor Casaroja's Noesis

Posted: Sun Jan 15, 2012 7:20 pm
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?

Re: Señor Casaroja's Noesis

Posted: Sun Jan 15, 2012 11:21 pm
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.

Re: Señor Casaroja's Noesis

Posted: Mon Jan 16, 2012 6:57 am
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!

Re: Señor Casaroja's Noesis

Posted: Mon Jan 16, 2012 10:04 pm
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?

Re: Señor Casaroja's Noesis

Posted: Tue Jan 17, 2012 4:38 am
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...

Re: Señor Casaroja's Noesis

Posted: Wed Jan 18, 2012 12:59 am
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.

Re: Señor Casaroja's Noesis

Posted: Wed Jan 18, 2012 1:44 pm
by SILENTpavel
del [the problem is solved]

Re: Señor Casaroja's Noesis

Posted: Sun Jan 22, 2012 11:49 pm
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

Re: Señor Casaroja's Noesis

Posted: Mon Jan 23, 2012 12:03 am
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.

Re: Señor Casaroja's Noesis

Posted: Wed Jan 25, 2012 11:01 am
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.