Sega Saturn Development > Share your code

Model converter (.ZTP) -0.1 - WIP

(1/12) > >>

XL2:
Here is my model converter (and source code) with my custom binary file format I made for my Sonic Z-Treme Engine (ZTP for Z-Treme Polygons).

The code is bad, I just quickly coded this and didn't spend much time cleaning up or removing all the globals.
I will revisit the code and try to add precalculated lightning and per vertex animation support. (done 2018-06-10)
I also added a demo I originaly made for our friend Virtua skimmer.
I would like to ditch OBJ files for DAE, but it's quite hard to implement so I might stick with OBJ for now.

New in version 0.05 : I rotated all the quads 180 degrees and flipped the normals so that the textures are in the proper direction (it was just an annoying issue that didn't cause problems). Updated the demo to add a few features. If you just want to use the converter, update your model loader c file in the ZT folder else you will get alignement issues (the sprites are now in ZTI format).

New in version 0.10 : Animation support! The tool can read a chain of OBJ files and do vertex animation (similar to Quake 2 MD2 format) with interpolation. The normals are also compressed. The demo's animation is bad simply because my own animation is bad, so don't mind it!

SkimmingSanshiro:
Great work, I didn't even notice the texture issue. Precalculated lighting and per vertex animation would be really useful. I thought the visible workspace was 1200 faces but your demo runs +1500, awesome!
edit: Nevermind its displaying 700

XL2:
The default workspace can process 2000 quads max, but it will display less because of backface culling.
In my FPS demo I could display over 1000 textured quads at 20 fps.

XL2:
Ok, good news!

I got the vertex animation working with compressed vertices (6 bytes each instead of 12 bytes) and linear interpolation (so that you can display a 60 FPS animation with only 15 frames or less if you wish).
Vertex animation allows you to do animations as complex as you want.

I got 40 frames of animation down to 10 KB with 175 vertices (the Sonic model) at 15 fps interpolated to 60 (so 10 frames of animation instead of 40).
I still need to add normals with (maybe, could be overkill) interpolation as well.
It should be possible to compress the normals to 3 bytes instead of 12, but I'll need to see the results as it could be bad.
For the Sonic model, I could probably have 240 frames worth of animation down to less than 100 KB.
While it's a lot, Sonic moves fast so I need more frames, but for a slow moving caracter (like a human) you could probably get good results at 1/6 animation or less if you dismiss 60 FPS.

I still need to improve everything and the user interface is quite complicated right now (you need both your base OBJ model with material and the animation OBJ files numbered in a linear fashion - but Blender can generate those easily).

I'm also worried about the impact on CPU.
Sadly I don't know assembly so I won't be able to fully optimize the function or offload it to the SCU DSP, but I hope to keep the cost to a minimum.

I also added an option to reorganize the 3D model so that you can easily add bone-animation to it if you wish to (for manual animation only).

I hope to release the new version of the converter tool this week.


SkimmingSanshiro:
Fantastic news! Really making projects like mine possible. One thing though excuse my lack of concept but in my Katamari project I ported the PSP level and decimated it and made it quads. When loading the ZTE it missing a few select faces even some simple 4 vertex quad with correct normals, but will let me add more complex things like the plate of snails.

I fixed a lot of the levels glitches by merging the vertices of the separate objects and making sure there isn't a face underneath another. But having a hard time making any more 3d objects show up without being clipped out by the floor or whatever. .

For example of a simple quad clipped: the shopping bag that goes up to the table here
https://i.imgur.com/pa150nf.png

Is clipped on the saturn build but let me add the plate of all this stuff on it, if merged the plates vertices to the ground.
https://www.youtube.com/watch?v=TnBsa35S4MA


Can I make a level this way if I clean it up more or is the Zsorting(?) too much with all the stuff and need a proper map?

Navigation

[0] Message Index

[#] Next page

Sitemap 1 2 3 4 5 6 7 8 9 10 
Go to full version