Users browsing this thread: 7 Guest(s)
[RELEASE] PS1 Scene Ripper
#1
3D Modelling 
Hi. I want to announce some progress on the PS1 scene ripping front.

The PS1 is notoriously janky to rip from even by normal ripping standards. The best publicly available scene ripper is Rickomax's feature/3d-screenshot branch for the Avocado emulator (download here) released about four years ago. I was originally working on that branch, but found Avocado's compatibility was too low for many games. So today I'm sharing a new 3d-screenshot feature implemented in DuckStation.

Links:
Download it here.
Read the instructions.
Read more about how it works.

Besides availing itself of DuckStation's near perfect game compatibility, the main contribution is a new method for resolving the "spikes" you tend to get when the ripper gets confused about which vertex it should connect to (see "how it works" for details).

[Image: jitter-before-after.jpg]

Showcase:
[Image: showcase.jpg]

Do NOT expect all games to work though. It's still hit and miss Surprise
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
#2
YO! That's actually really cool! You da madman!
I like ripping stuff from games.
Reply
Thanked by: scurest
#3
The ripper now has a souped-up 2D mode too, which will give you an "exploded" view of all the 2D faces drawn in a frame in the OBJ file. You can use this for 2D games, getting pre-rendered backgrounds, etc.

[Image: nc9ia2.jpg]
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by:
#4
This is really cool.
It works on more or less everything I tried.
It has issues with some specific games like Grandia, which Avocado had the same issues with, something about the way they draw their tris.

Would it be possible to extend the zoom out functionality and maybe add a 'no cull', right now it's backface culling that gets disabled, but ideally it's possible to override the games standard culling for outside of the camera, Avocado had a feature like this but it was really useful when zooming out and grabbing a large area from a 3D game.

Something else that I think would be super useful would be exporting the camera position, or at least something akin to that.

This would be really useful for pre-rendered games as the scenery and characters are aligned in-engine but once exported they're kind of broken up, and re-aligning the scene isn't really possible.

Note: When I did try this with FF9 and Chrono Cross, the 2D mode only captured the characters, not the environment.

This is awesome though, the games that don't work mostly don't work because they do things a bit weirdly, FF9, Grandia, Breath of Fire 3 etc
Reply
Thanked by:
#5
(05-15-2024, 08:26 AM)squall789 Wrote: This is really cool.
Thanks!

(05-15-2024, 08:26 AM)squall789 Wrote: It has issues with some specific games like Grandia
Can confirm. Digimon World 2 also doesn't work I noticed. I'll try to look at it.
Games that don't get anything at all probably need Avocado's "Debug" feature.

(05-15-2024, 08:26 AM)squall789 Wrote: Would it be possible to extend the zoom out functionality and maybe add a 'no cull', right now it's backface culling that gets disabled, but ideally it's possible to override the games standard culling for outside of the camera
AFAIK the only way to get offscreen polys is to move them onscreen when taking the shot. So basically it would need to pick the optimal freecam position that squeezes everything into the shot automatically. I'm not sure how to pick this automatically so currently you'll need to do it manually with the freecam.

(05-15-2024, 08:26 AM)squall789 Wrote: Avocado had a feature like this but it was really useful when zooming out and grabbing a large area from a 3D game.
Which one?

(05-15-2024, 08:26 AM)squall789 Wrote: Something else that I think would be super useful would be exporting the camera position, or at least something akin to that.
Do you mean of the freecam?
Now that I think about it, I wonder if the positions in the OBJ should be without the freecam's adjustment.

(05-15-2024, 08:26 AM)squall789 Wrote: Note: When I did try this with FF9 and Chrono Cross, the 2D mode only captured the characters, not the environment.
This should work in 2D mode as of my last post. Just re-download it to get the new version.
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by:
#6
This is amazing. Haven't tried it yet but I read the docs and you have very ingenious ways of approaching the issues common to the eternal problem of 3D ripping on PSX.
Even macOS support, I'm so glad!! Stellar work.

Maybe one day we can figure out a way to do some verbose logging and through some heuristic magic figure out a one-size-fits-all solution for all games? Not necessarily one-click ripping but a general "okay, the vertices, the faces, the textures all came from [$HERE] so maybe dig into it to get the data?" type of thing
Once there was a way to get back homeward
Reply
Thanked by:
#7
Great Hits - Get Down With The Beat has the characters' geometry come out scrambled when capturing. I guess you were correct about not all games working with it, but I'm not sure how this could be fixed.
[Image: rXEuQzj.png]
Reply
Thanked by:
#8
I just added an experimental option to use PGXP to get the 3D scene information. This fixes Digimon World 2 and Grandia when enabled.

To use it you need to have PGXP turned on under Settings ‣ Enhancements ‣ PGXP ‣ Geometry Correction. I updated the instructions with more info if you need it.

[Image: iaes5z.jpg]
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by:
#9
(05-16-2024, 11:46 AM)Cavan Ashton Wrote: Great Hits - Get Down With The Beat has the characters' geometry come out scrambled when capturing. I guess you were correct about not all games working with it, but I'm not sure how this could be fixed.
[Image: rXEuQzj.png]

Awesome job dude! It works great now! It fixed a lot of the distortion of the character models.
[Image: pcjml9Q.png]
Reply
Thanked by: scurest
#10
(05-15-2024, 08:32 PM)scurest Wrote: Do you mean of the freecam?
Now that I think about it, I wonder if the positions in the OBJ should be without the freecam's adjustment.

Oddly enough no, not of the freecam, but the games actual camera position, so the same as if freecam were enabled but was set to 0 in all slots.
I was thinking more like, if I took a screenshot of say FF9, or even grandia for example, getting a dae with camera position, FOV, rotation etc could be really useful for being able to recreate the scene as-is.
I understand this is a bit of an oddly specific request though.

Quote:scurest
(05-15-2024, 08:26 AM)squall789 Wrote: Note: When I did try this with FF9 and Chrono Cross, the 2D mode only captured the characters, not the environment.
This should work in 2D mode as of my last post. Just re-download it to get the new version.
Edit 2: It does work better with the most recent update, capturing the backgrounds too.
Also works well for Popolocrois now.
Ah unfortunately for games with 3D models on 2D backgrounds it didn't seem to do anything, it captured all the 3D elements with their depth offsets, but it didn't capture any of the background.
I wonder if this'll work better for breath of Fire 3 now, as previously it only captured a specific element of the background, but I only tested one area.
Edit: It does work for BOF3 now, it gives an oddly skewed image but it works, I think this game does something strange as freecam doesn't work correctly here either, I remember there being issues with it in Avocado though.

One thing I've wondered for a while, and honestly this may just not be possible, but for some games there are several different palettes dumped, is it possible to only dump the final image results?
I'm guessing not because for those same games a lot of emulators, and rippers kick out all of the different versions, so I've assumed there may not be a way to access the final data too easily.

This was what I meant when I mentioned culling, you're right tht Avocado may not have had an option for this either.
You can see it on the far left, I understand its PS1 culling for memory purposes, but perhaps its possible to overwrite it?
This may not be possible in an emulator itself, and only via cheats or patches/hacks for a specific game as I'd assume the frustrum culling will be different per game.

[Image: QIrLMvS.png]
Reply
Thanked by:
#11
(05-17-2024, 09:49 PM)squall789 Wrote: I was thinking more like, if I took a screenshot of say FF9, or even grandia for example, getting a dae with camera position, FOV, rotation etc could be really useful for being able to recreate the scene as-is.
I don't think I can do that. The verts go directly from local space to camera space, there is no world space to give the camera position in.

(05-17-2024, 09:49 PM)squall789 Wrote: One thing I've wondered for a while, and honestly this may just not be possible, but for some games there are several different palettes dumped, is it possible to only dump the final image results?
The avocado ripper would take a 256x256 texture region, divide it into bounding boxes that used the same palette, and make a composite texture with the correct palette in each box. But the problem is what happens if the boxes overlap. If the same part of the texture is ever used twice with two different palettes, one of them will overwrite the other and so one will be wrong.
You can get a similar feature by turning off "Dump Full 256x256 Textures". Then each box with a fixed palette is written to a separate texture file. But since they aren't composited onto a single space, there's no problem with the boxes overlapping.
[Image: cs7cc8.jpg]

(05-17-2024, 09:49 PM)squall789 Wrote: This was what I meant when I mentioned culling, you're right that Avocado may not have had an option for this either.
You can see it on the far left, I understand its PS1 culling for memory purposes, but perhaps its possible to overwrite it?
I don't think so. It's probably culled in software. If something never gets drawn in the first place, there's no way to get it in the screenshot.

(05-17-2024, 09:49 PM)squall789 Wrote: This may not be possible in an emulator itself, and only via cheats or patches/hacks for a specific game as I'd assume the frustrum culling will be different per game.
Yes.
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by:
#12
I give a run and it has being working perfectly in several game (Tenchu 2, Tomba 2, Brave Fencer Musachi, Legend of Legaia), but it did not work well on Evil Zone giving this type of models.

[Image: fChq1Za.png]
Reply
Thanked by:
#13
I looked into games like Ape Escape where half the polys are missing. The "Disable Culling" option pretends all tris are wound counter-clockwise (I think positive sign is counter-clockwise). Most games cull tris where NCLIP is zero or negative, so this does disable culling. But Ape Escape varies the sign it expects according to some logic I don't understand.

If you turn off "Disable Culling", it fixes it, but you only get the camera-facing side of the model (and no zero-screen-space polys).

I can get the "missing half" by reversing the sign of NCLIP. If I take one regular shot (front half) and one with reveresed NCLIP (back half) on the same frame (by using savestates), I can put them together to get the whole model. But I'm not sure what the best way to expose this to the user is.

[Image: zj6r2q.jpg]
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by: Pik
#14
(05-20-2024, 03:52 AM)scurest Wrote: I looked into games like Ape Escape where half the polys are missing. The "Disable Culling" option pretends all tris are wound counter-clockwise (I think positive sign is counter-clockwise). Most games cull tris where NCLIP is zero or negative, so this does disable culling. But Ape Escape varies the sign it expects according to some logic I don't understand.

If you turn off "Disable Culling", it fixes it, but you only get the camera-facing side of the model (and no zero-screen-space polys).

I can get the "missing half" by reversing the sign of NCLIP. If I take one regular shot (front half) and one with reveresed NCLIP (back half) on the same frame (by using savestates), I can put them together to get the whole model. But I'm not sure what the best way to expose this to the user is.

[Image: zj6r2q.jpg]

Hadn't thought about this, but it will be pretty hard to do in some games.
Hope you could find a way to fix it?
Reply
Thanked by:
#15
So Ape Escape appears to test two tris with a shared edge for culling like this

Code:
A----C    load A into SXY0
|  / |    load B into SXY1
| /  |    load C into SXY2
B----D    NCLIP, ie. test winding order of (SXY0, SXY1, SXY2)
          load D into SXY0
          NCLIP

Normally you would treat this as two tris wound the same way, eg ABC, DCB. Instead it's treating it as two tris wound the opposite direction ABC, DBC. I assume the reason is that it can reuse the BC edge for both cases (ie. it only has to load SXY1/SXY2 once). This means that the sign required by the cull test is opposite for the first and second tri. So when the ripper forces the sign to always be positive, every second tri is missing.

So I thought maybe I could add an optional hack that would flip the sign of an NCLIP if two of SXY0, SXY1, SXY2 are the same as the previous NCLIP. This would hopefully fix games where "Disable Culling" skips "half" of every quad.

Unfortunately it doesn't quite work. 

Ape Escape Before/After, note missing tri on hand.
[Image: vthcj5.jpg]

Evil Zone Before/After, note missing tris on face.
[Image: qb4pfq.jpg]

Does nothing for Omega Boost, which appears to have a completely different culling problem.

It appears to misfire on tris sometimes, so I didn't push it. If I can figure out how to fix it, maybe I'll add it as an option.
3D Screenshot Tools (NDS / N64 / PS1 / PS2)
Other Tools (apicula / Vagrant Story / Star Ocean Blue Sphere)
Reply
Thanked by:


Forum Jump: