Befzz / blender3d_import_psk_psa

import mesh, skeleton, animation from psk, psa files to blender3d
489 stars 168 forks source link

vertex color incorrect #82

Open ghost opened 2 years ago

ghost commented 2 years ago

Blender: 3.0.1

Hello,

I created a .psk and .gltf from the game 'GranBlue' using umodel(fmodel). While .gltf imports clean vertex color for me (right), it is washed out and buggy for .psk (left). Here is a mega.nz link with the .psk and .gltf model.

vertexColor

Thanks for the addon and your help.

yretenai commented 2 years ago

This is because the mesh does not have smooth shading and is instead relying on normals. Go into edit mode and press F and select "Shade Smooth". However, verify that this is how the game behaves.

ghost commented 2 years ago

(In all images .psk is on the left, .gltf on the right - the quality of my .gif is a bit bad, sorry).

Thank you for your answer, I was afraid that I would not be taken seriously. ^^ Since I think I'm being misunderstood, here's my view:

I create a .psk with any Granblue model with the following versions:

All three versions, on all models bring incorrect vertex color in Blender. If I manually enable 'Smooth Shading' as suggested, or remove 'Custom Split Data' - it always remains incorrect (also believe that vertex normals are rather unrelated to vertex color). If I use a 'Data Transfer' modifier I can transfer the vertex color from a .glTF mesh to the .psk mesh without changing anything in the shading or the normals - reason more to exclude it (pay attention to the settings).

switch

Whereas .glTF imports correct vertex color for all models.

I use the ArcSystem shader from Aerthas for the models in Blender, where Vertex Color is used as a mask for permanent shadows.

You can see it quite well in this example. The permanent shadow with .glTF vertex color is correct, .psk vertex color is broken.

switch2

To me it looks like this: The vertex color information that the .psk importer writes to the mesh is somehow incorrect. (Unfortunately I don't have 3DMax to test if the incorrect vertex color is somehow related to the .psk data itself.) If it is really only the shading - please make a short .gif and show it to me. I can't reproduce the solution.

I am happy to supply .blends etc if it helps solve the problem.

ghost commented 2 years ago

What is the reason for this? I don't understand enough about Blender's API.

The console shows me a perpetual list of vertices triggered by the piece of code between 1087 - 1093 when importing.

console

yretenai commented 2 years ago

Yeah I see now, it seems FModel (CUE4Parse) and UModel both narrow the number of vertices down by deduplicating according to position and normal. So split tangents and colors will not export correctly if the vertex was merged.

The GLTF exporter just exports the entire vertex stream.

ghost commented 2 years ago

Thank you for your time. If you are the one person who will fix it that would be great of course. :P : ) Stay with glTF for now.