Commit graph

324 commits

Author SHA1 Message Date
Nahuel Rocchetti
159df4d1ac Adjust shores 2023-07-27 20:43:58 -03:00
Nahuel Rocchetti
28951e769b Water Reflections 2023-07-27 20:25:32 -03:00
Nahuel Rocchetti
e05d85a3c7 Cache terrain gameobject and textures 2023-07-27 17:29:41 -03:00
Nahuel Rocchetti
316b6ca209 shore adjustments 2023-07-27 17:23:59 -03:00
Nahuel Rocchetti
61b578cd4f Merge branch 'master' of https://github.com/LazyDuchess/OpenTS2 2023-07-27 16:58:37 -03:00
Nahuel Rocchetti
af89b84bed Pure shores 2023-07-27 16:58:34 -03:00
Nahuel Rocchetti
4c2f223765
Merge pull request #40 from ammaraskar/coord_fix
Add gameobject to transform from sims2 space to unity
2023-07-27 15:28:03 -03:00
Nahuel Rocchetti
ba96d61f60 Water placeholder 2023-07-27 15:27:32 -03:00
Ammar Askar
7e40192a3c
Merge branch 'master' into coord_fix 2023-07-27 14:21:40 -04:00
Ammar Askar
c9010e20ff Add gameobject to transform from sims2 space to unity
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.
2023-07-27 14:17:30 -04:00
Nahuel Rocchetti
5b27d12282 TerrainType system 2023-07-27 15:11:54 -03:00
Nahuel Rocchetti
b3875625b8 use quaternion for rotation workaround 2023-07-27 12:14:45 -03:00
Ammar Askar
af8f67a56d Temporary fix for bridge orientation 2023-07-27 00:48:40 -04:00
Nahuel Rocchetti
b2995b769b
Merge pull request #39 from ammaraskar/scenegraph_txmt
Render bridges in neighborhood decorations
2023-07-26 23:29:05 -03:00
Ammar Askar
15b82057ad Render bridges used as neighborhood decorations 2023-07-26 22:00:52 -04:00
Nahuel Rocchetti
303a786589 i'm kinda dumb 2023-07-26 22:01:53 -03:00
Ammar Askar
8347e94fb3 Refactor some neighborhood decoration code 2023-07-26 20:56:46 -04:00
Nahuel Rocchetti
0acd2f6227 Delete lightmaps as needed 2023-07-26 21:51:22 -03:00
Nahuel Rocchetti
c1f53204f8 Height map shadows 2023-07-26 21:44:11 -03:00
Nahuel Rocchetti
c5eb3a1d7f Basic lightmap setup 2023-07-26 21:33:10 -03:00
Nahuel Rocchetti
d1785758f4
Merge pull request #38 from ammaraskar/scenegraph_txmt
Read cTransformNode blocks as part of Scenegraph collections.
2023-07-26 20:44:08 -03:00
Nahuel Rocchetti
d282ecf4c5 Fix typo, hood deco rotation 2023-07-26 20:19:19 -03:00
Ammar Askar
4e335f5db4 Read cTransformNode blocks as part of Scenegraph collections.
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.
2023-07-26 19:00:15 -04:00
Nahuel Rocchetti
7ad31c8440
Merge pull request #37 from ammaraskar/scenegraph_txmt
Change vec2 to vec3 in neighborhood decoration deserialization.
2023-07-26 19:35:15 -03:00
Ammar Askar
b1702db774 Change vec2 to vec3 in neighborhood decoration deserialization.
Whoops, this was causing an error with deserialization. Also
finished up the TODO and added a neighborhood that actually
use this type of decoration.
2023-07-26 18:29:51 -04:00
Nahuel Rocchetti
9116713f60
Merge pull request #36 from ammaraskar/scenegraph_txmt
Start showing neighborhood prop decorations
2023-07-26 18:50:20 -03:00
Ammar Askar
e204d8475c Start showing neighborhood prop decorations 2023-07-26 17:08:56 -04:00
Ammar Askar
9cda67d427 Fix index out of bounds in DXT3 conversion when width goes below 4 2023-07-26 17:03:59 -04:00
Nahuel Rocchetti
0590372988 update terrain shader epsilon 2023-07-26 14:33:01 -03:00
Nahuel Rocchetti
9ebdc615a0
Merge pull request #35 from ammaraskar/scenegraph_txmt
Render neighboorhood flora decorations
2023-07-26 08:56:14 -03:00
Nahuel Rocchetti
f850022951 Refactor resource management a little 2023-07-26 08:44:01 -03:00
Nahuel Rocchetti
a091cc8e61 Fix Scenegraph GC, Neighborhood Codec Test and GC Meshes 2023-07-26 08:07:48 -03:00
Ammar Askar
f9c1b104dc Start rendering flora decorations in the neighborhood 2023-07-25 23:44:51 -04:00
Ammar Askar
d7d20efaa2 Add code to render a scenegraph CRES object.
This adds utility functions to fully render out a CRES scenegraph
hierarchy from its model to its materials.
2023-07-25 22:42:03 -04:00
Nahuel Rocchetti
275b4982de
Merge pull request #34 from ammaraskar/scenegraph_txmt
Start reading GMND, SHPE and RES scenegraph files.
2023-07-25 17:03:20 -03:00
Ammar Askar
878e796b64 Start reading GMND, SHPE and RES scenegraph files.
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.
2023-07-25 13:59:02 -04:00
Nahuel Rocchetti
c7ab6b59ea
Merge pull request #33 from ammaraskar/scenegraph_txmt
Add loading of neighborhood object XML files.
2023-07-20 01:06:57 -03:00
Ammar Askar
2d439d9552 Add loading of neighborhood object XML 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.
2023-07-19 22:50:35 -04:00
Nahuel Rocchetti
4244eeafb7
Merge pull request #31 from ammaraskar/scenegraph_txmt
Start loading neighborhood decorations
2023-07-19 03:01:01 -03:00
Ammar Askar
fcb7484d80 Start loading neighborhood decorations 2023-07-19 00:55:55 -04:00
Nahuel Rocchetti
611c074b0c
Update README.md 2023-07-19 01:01:57 -03:00
Nahuel Rocchetti
afa6d31e7b
Merge pull request #29 from ammaraskar/scenegraph_txmt
Make unity materials from TXMT files.
2023-07-18 18:58:56 -03:00
Ammar Askar
4a9baa86bd Add generated material to GetUnmanagedResources 2023-07-18 15:56:01 -04:00
Nahuel Rocchetti
b04b6c9f20
Merge pull request #30 from ammaraskar/texture_bug
Fix bug with loading non-square textures.
2023-07-18 13:37:56 -03:00
Ammar Askar
c70d2cfb9a Fix bug with loading non-square textures.
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.
2023-07-18 12:00:51 -04:00
Ammar Askar
838a642854 Make unity materials from TXMT files.
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
2023-07-18 11:22:15 -04:00
Nahuel Rocchetti
4dd3c17be3
Merge pull request #28 from ammaraskar/scenegraph_txmt
Add parsing for scenegraph material definitions.
2023-07-15 17:55:01 -03:00
Nahuel Rocchetti
cb5f292350
Merge pull request #27 from ammaraskar/gemoetric_data_vertices
Start reading elements section of GMDC
2023-07-15 17:52:08 -03:00
Ammar Askar
80acfe832b Add parsing for scenegraph material definitions.
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.
2023-07-15 11:34:48 -04:00
Ammar Askar
d61c666797 Start loading other groups from GMDC models 2023-07-14 23:15:29 -04:00