Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finally decoded CLASS.PRM ! #25

Open
aybe opened this issue Nov 11, 2015 · 4 comments
Open

Finally decoded CLASS.PRM ! #25

aybe opened this issue Nov 11, 2015 · 4 comments

Comments

@aybe
Copy link

aybe commented Nov 11, 2015

It's been a while I was looking for it 馃拑 !!!

2015-11-11 19_35_48-unity personal 64bit - modelscene unity - wxx-rebirth - pc mac linux standa

2015-11-11 19_36_23-unity personal 64bit - modelscene unity - wxx-rebirth - pc mac linux standa

Will post details once it's a bit more refined but basically I found that there are command lists that should be ignored and that there are new Gouraud-shaded polygons (tri/quad).

@aybe
Copy link
Author

aybe commented Nov 11, 2015

Hi !

I think I'm on something, 0x15 seems to be a parallel light source (see PDF), hex-edited the game and it seems coherent:

// 0x15 struct
polygonHeader
directionalVector = vec4I16
bgrxColor = uint32

see where I've assigned 1 color component only on each light:

2015-11-11 23_38_52-greenshot

cheers 馃懐

@aybe
Copy link
Author

aybe commented Nov 11, 2015

100% confirmed these are the light sources as said in the SDK.

2015-11-12 00_13_03-hexedit pro - dsdsds
2015-11-12 00_13_36-hexedit pro - dsdsds
2015-11-12 00_14_07-hexedit pro - dsdsds

Looking on finding out more about 0x16 now ...

@aybe
Copy link
Author

aybe commented Nov 11, 2015

Okay I think we've solved the CLASS.PRM case !

case PrmPolygonType.AmbientLight: // 0x16
                    var ambientLight = new AmbientLight
                    {
                        Header = header,
                        Unknown1 = reader.ReadUInt32BEs(4),
                        Color = reader.ReadUInt32BE(),
                        Unknown2 = reader.ReadUInt32BE()
                    };

Basically the PSX SDK is of great help, main difference lies in how things are laid out.

Would have loved to implement correct coloring but looking at current code base I don't have much clue without breaking current logic ... would be great if you had some idea about it.

By the way, I have a question for you !

On PRM files there are many objects and some depends on others, some are totally independent. Do you have any suggestion/idea on what system/pattern I could sketch in order to be able to have separate objects, knowing the structure of PRMs ? In short I'm asking you what approach you'd use to be able to use these objects separately, knowing the possible dependencies between them ?

Thank you, and have a good night !!

@aybe
Copy link
Author

aybe commented Nov 12, 2015

Hi,

Implemented it here and it's mostly that, shader should be modified though:

2015-11-12 23_08_46-unity personal 64bit - modelscene unity - wxx-rebirth - pc mac linux standa

Btw, colors are RGB in lights, so one should ignore A component.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant