Previously we were using an ad-hoc system where we were rotating
meshes to -90 on the x-axis and applying a -1 scale to them. This
worked to show them properly but meant that because our coordinate
system was flipped all rotations from the game had to be inverted
from a right-hand system to a left-hand system.
This change introduces a simRotations object that all the meshes
sit under that takes raw rotations from the game. The parent game
object then converts these all at once into the unity space.
All rotations from the game should now be applied to this simRotations
object, we should likely move this ScenegraphResourceAsset generated
game object into a helper MonoBehavior to make this easier to use.
I assumed these cTransformNodes only existed as part of cResourceNode
but it looks like they can come up by themselves. Adding this now
allows all neighborhood decoration resources to be loaded.
This finishes out the basic structure needed to read all the
different file formats involved in models in scenegraph. While
we don't support animations/bones yet, all the pieces to go from
a RES file to having it be rendered in unity with materials is
now structured out.
Almost all the fields in the internal Scenegraph datastructures
have been reverse engineered, so this codebase is likely now the
best resource when it comes to parsing Scenegraph files.
These are the files that assosciate the neighborhood GUIDs to the
models. This also adds a class to handle cGZPropertySetString
files since we will likely need to parse those more in the future.
We had a case where loading textures of sizes like 32x16 could lead
to one of the dimensions width becoming 0 in the mip-loading loop.
Fix this by making sure the resolution is at least 1.
This adds the StandardMaterial TXMT from the game. We use a simple
Lambert surface shader to handle its rendering. Unfortunately since
there's no easy way in unity to make a surface shader with different
alpha modes based on the shader feature this means we need a shader
per each type of alpha mode: Opaque, CutOut and Blend.
This does lead to some duplicated code in the shaders in terms of the
properties but the body of the shader is stored in a common .cginc
file that gets pulled in with a #include
This does not yet convert the material definitions to unity
materials. That will be done in a follow up as there are a
bunch of different properties that will need to be handled.