Commit Graph

56 Commits

Author SHA1 Message Date
bc6aec520c Fix a deadlock in TerrainLibraryMergerPCM that could occur when spawning and despawning cunks extremely fast. 2022-02-19 20:54:02 +01:00
9c580fce42 Also add the liquids to the material cache key hash. 2022-02-18 23:10:57 +01:00
9eb61941f5 Remove now unneeded properties from TerrainSurface. 2022-02-18 22:57:22 +01:00
aaeca66f80 Renamed voxel_surface methods / properties to terra_surface. 2022-02-18 21:29:43 +01:00
29c68e5fb0 Get the dimensions from the texture instead of the image in texture_get_uv_rect of the material cache. 2022-02-16 20:49:23 +01:00
0bb45020b2 Also mention 5 suggested material to TerrainLibrary::prop_material_lod_get's error message. 2022-02-09 10:18:52 +01:00
27e42b9087 Better error messages when no materials are set into the Terrainibrary. 2022-02-09 01:08:32 +01:00
fe4ff0d86c Fix SpatialMaterial support for the merger libraries. 2022-02-09 00:34:46 +01:00
7a3ec17895 Fix enum value name after mass replace. 2022-02-08 22:33:02 +01:00
098afa23e2 Changed the Terra and Terraman class prefixes to Terrain. 2022-02-08 13:59:00 +01:00
f256229139 Work on fixing compile for 4.0. 2022-02-08 11:52:29 +01:00
654e8872de Updated copyright headers. 2022-01-12 22:19:46 +01:00
8ec411e80c TerramanLibraryMergerPCM will now use mesh data resource additional textures, instead of props for the prop material cache. 2021-08-08 14:02:07 +02:00
b36d91fd76 Don't forget to add props (prop textures) to the cache. 2021-08-08 13:40:03 +02:00
ba595f9168 Implement prop material cache realted methods for TerramanLibraryMergerPCM. 2021-08-08 13:36:13 +02:00
69284d9ebb Another build fix when the prop module is present but the mesh data resource module is not. 2021-08-08 12:16:43 +02:00
63a488d16d Renamed _cache_mutex to _material_cache_mutex, and added a new _prop_material_cache_mutex. 2021-08-08 11:51:51 +02:00
6cf36fcd05 Implement additional textures login for TerraMaterialCachePCM. 2021-08-08 11:43:02 +02:00
ab5c1ffb24 Improved the additional textures api a bit in MaterialCache. Also added helper methods for adding textures from props. 2021-08-08 11:42:24 +02:00
69bf9ed996 Fix build when the prop module is present but the mesh data resource module is not. 2021-08-08 11:41:13 +02:00
6acaef6a5d Added a few virtual methods to store additional textures with in MaterialCache. This will likely make implementing caching for props fairly trivial. 2021-08-07 19:24:14 +02:00
94c9fc39ac Implement refcounting for material caches. 2021-08-03 01:08:50 +02:00
66278f0ab8 Added initialized property to TerraMaterialCache. 2021-08-03 00:16:29 +02:00
c1b0ee6651 Add missing binding to TerraMaterialCachePCM. This fixes cached material textures. 2021-08-03 00:10:16 +02:00
73243e5b9d Removed the voxel_ prefix from the surface related methods in TerraMaterialCache. 2021-08-02 23:47:50 +02:00
2a627b0dd2 Implemented the surface related methods in TerraMaterialCache. 2021-08-02 23:44:05 +02:00
74c5200ec5 Removed the surface related overrides from TerraMaterialCachePCM. 2021-08-02 23:43:38 +02:00
24fbd24a6c Fix compile. 2021-08-02 23:33:29 +02:00
6e7a9ae71b Added a new virtual voxel_surface_id_get method to the material cache. 2021-08-02 23:27:24 +02:00
1a395d3dc4 Store the id in the id property for the cached surfaces. 2021-08-02 23:19:40 +02:00
3a51d4c044 If the chunk dosen't need a material then set has_cache_key to false. 2021-08-02 23:17:30 +02:00
a813a60cf7 Added a mutex to _material_cache_get_key in TerramanLibraryMergerPCM, as this method will be accessed by multiple threads. 2021-08-02 22:45:29 +02:00
d23e2747fb Assign the new cache immediately, also comment out debug print. 2021-08-02 22:37:19 +02:00
16fe978c41 Changed const ref to a normal parameter on the get_key methods. This fixes a crash. 2021-08-02 22:34:07 +02:00
4dad639cc6 Implemented the main caching logic in TerramanLibraryMergerPCM. 2021-08-02 22:23:04 +02:00
6c5487d6c2 Add the TexturePacker, and some bindings into TerraMaterialCachePCM. Also implemented refresh_rects and _setup_material_albedo. 2021-08-02 22:21:34 +02:00
dd2aa2b303 Fixed broken set_library call. 2021-08-02 22:19:26 +02:00
2e1257d19a Remove cast in TerraSurfaceMerger's refresh_rects(), as it's no longer needed. 2021-08-02 22:18:13 +02:00
9fa05da4af Make the private fields in TerramanLibrary protected. 2021-08-02 22:17:42 +02:00
6012aeb00d Added missing binds. 2021-08-02 22:16:13 +02:00
2a731480d0 Improved the cache api again. Now the chunks can store the assigned key, so it does not have to be re-hashed again only if actually needed. 2021-08-02 20:02:48 +02:00
9e9640891d Fix a few warnings on launch. 2021-08-02 20:00:33 +02:00
74ab6b315e Made TerramanLibraryMergerPCM inherit from TerramanLibrary instead of TerramanLibraryMerger. Added the code from TerramanLibraryMerger as a base for it. 2021-08-02 19:10:52 +02:00
460f38090b Added a new TerraMaterialCachePCM class to be used with the material cache pcm. Skeleton for now. 2021-08-02 19:03:56 +02:00
4647db8f1e Now the cache api uses the new TerraMaterialCache class. 2021-08-02 13:39:29 +02:00
f53e6572b1 Added a new TerraMaterialCache class. 2021-08-02 13:13:37 +02:00
e9c314eedc Small temporary design notes for the new pcm merger. 2021-08-01 22:59:09 +02:00
951e01a66e Fix a few return values. 2021-08-01 18:49:13 +02:00
f3c3bac3d1 Changed the key's type from Variant to int, as it will work better. 2021-08-01 18:38:21 +02:00
40c0b2373e Changed the cached material api a bit to be more efficient. 2021-08-01 18:22:13 +02:00