mirror of
https://github.com/Relintai/terraman.git
synced 2025-04-23 21:43:23 +02:00
Now the cache api uses the new TerraMaterialCache class.
This commit is contained in:
parent
f53e6572b1
commit
4647db8f1e
@ -24,6 +24,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "../world/terra_chunk.h"
|
#include "../world/terra_chunk.h"
|
||||||
|
|
||||||
|
#include "terra_material_cache.h"
|
||||||
|
|
||||||
#ifdef PROPS_PRESENT
|
#ifdef PROPS_PRESENT
|
||||||
#include "../../props/props/prop_data.h"
|
#include "../../props/props/prop_data.h"
|
||||||
#endif
|
#endif
|
||||||
@ -67,20 +69,20 @@ Ref<Material> TerramanLibrary::material_lod_get(const int index) {
|
|||||||
return _materials[index];
|
return _materials[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::material_cached_get_key(const Ref<TerraChunk> &chunk) {
|
int TerramanLibrary::material_cache_get_key(const Ref<TerraChunk> &chunk) {
|
||||||
return call("_material_cached_get_key", chunk);
|
return call("_material_cache_get_key", chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::_material_cached_get_key(Ref<TerraChunk> chunk) {
|
int TerramanLibrary::_material_cache_get_key(Ref<TerraChunk> chunk) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::material_cache_get(const int key) {
|
||||||
return call("_material_lod_cached_get", index, key);
|
return call("_material_cache_get", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::_material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::_material_cache_get(const int key) {
|
||||||
ERR_FAIL_V_MSG(material_lod_get(index), "This TerramanLibrary doesn't support cached materials!");
|
ERR_FAIL_V_MSG(Ref<TerraMaterialCache>(), "This TerramanLibrary doesn't support cached materials!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanLibrary::material_add(const Ref<Material> &value) {
|
void TerramanLibrary::material_add(const Ref<Material> &value) {
|
||||||
@ -142,20 +144,20 @@ Ref<Material> TerramanLibrary::liquid_material_lod_get(const int index) {
|
|||||||
return _liquid_materials[index];
|
return _liquid_materials[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::liquid_material_cached_get_key(const Ref<TerraChunk> &chunk) {
|
int TerramanLibrary::liquid_material_cache_get_key(const Ref<TerraChunk> &chunk) {
|
||||||
return call("_liquid_material_cached_get_key", chunk);
|
return call("_liquid_material_cache_get_key", chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::_liquid_material_cached_get_key(Ref<TerraChunk> chunk) {
|
int TerramanLibrary::_liquid_material_cache_get_key(Ref<TerraChunk> chunk) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::liquid_material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::liquid_material_cache_get(const int key) {
|
||||||
return call("_liquid_material_lod_cached_get", index, key);
|
return call("_liquid_material_cache_get", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::_liquid_material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::_liquid_material_cache_get(const int key) {
|
||||||
ERR_FAIL_V_MSG(liquid_material_lod_get(index), "This TerramanLibrary doesn't support cached liquid materials!");
|
ERR_FAIL_V_MSG(Ref<TerraMaterialCache>(), "This TerramanLibrary doesn't support cached liquid materials!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanLibrary::liquid_material_add(const Ref<Material> &value) {
|
void TerramanLibrary::liquid_material_add(const Ref<Material> &value) {
|
||||||
@ -217,20 +219,20 @@ Ref<Material> TerramanLibrary::prop_material_lod_get(const int index) {
|
|||||||
return _prop_materials[index];
|
return _prop_materials[index];
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::prop_material_cached_get_key(const Ref<TerraChunk> &chunk) {
|
int TerramanLibrary::prop_material_cache_get_key(const Ref<TerraChunk> &chunk) {
|
||||||
return call("_prop_material_cached_get_key", chunk);
|
return call("_prop_material_cache_get_key", chunk);
|
||||||
}
|
}
|
||||||
|
|
||||||
int TerramanLibrary::_prop_material_cached_get_key(Ref<TerraChunk> chunk) {
|
int TerramanLibrary::_prop_material_cache_get_key(Ref<TerraChunk> chunk) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::prop_material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::prop_material_cache_get(const int key) {
|
||||||
return call("_prop_material_lod_cached_get", index, key);
|
return call("_prop_material_cache_get", key);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ref<Material> TerramanLibrary::_prop_material_lod_cached_get(const int index, const int key) {
|
Ref<TerraMaterialCache> TerramanLibrary::_prop_material_cache_get(const int key) {
|
||||||
ERR_FAIL_V_MSG(prop_material_lod_get(index), "This TerramanLibrary doesn't support cached prop materials!");
|
ERR_FAIL_V_MSG(Ref<TerraMaterialCache>(), "This TerramanLibrary doesn't support cached prop materials!");
|
||||||
}
|
}
|
||||||
|
|
||||||
void TerramanLibrary::prop_material_add(const Ref<Material> &value) {
|
void TerramanLibrary::prop_material_add(const Ref<Material> &value) {
|
||||||
@ -347,16 +349,16 @@ void TerramanLibrary::_bind_methods() {
|
|||||||
|
|
||||||
BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")));
|
BIND_VMETHOD(MethodInfo("_setup_material_albedo", PropertyInfo(Variant::INT, "material_index"), PropertyInfo(Variant::OBJECT, "texture", PROPERTY_HINT_RESOURCE_TYPE, "Texture")));
|
||||||
|
|
||||||
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_material_cached_get_key"));
|
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_material_cache_get_key"));
|
||||||
BIND_VMETHOD(MethodInfo("_material_lod_cached_get", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::INT, "key")));
|
BIND_VMETHOD(MethodInfo("_material_cache_get", PropertyInfo(Variant::OBJECT, "key", PROPERTY_HINT_RESOURCE_TYPE, "TerraMaterialCache")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("material_get", "index"), &TerramanLibrary::material_get);
|
ClassDB::bind_method(D_METHOD("material_get", "index"), &TerramanLibrary::material_get);
|
||||||
ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &TerramanLibrary::material_lod_get);
|
ClassDB::bind_method(D_METHOD("material_lod_get", "index"), &TerramanLibrary::material_lod_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("material_cached_get_key", "chunk"), &TerramanLibrary::material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("material_cache_get_key", "chunk"), &TerramanLibrary::material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("_material_cached_get_key", "chunk"), &TerramanLibrary::_material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("_material_cache_get_key", "chunk"), &TerramanLibrary::_material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("material_lod_cached_get", "index", "key"), &TerramanLibrary::material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("material_cache_get", "key"), &TerramanLibrary::material_cache_get);
|
||||||
ClassDB::bind_method(D_METHOD("_material_lod_cached_get", "index", "key"), &TerramanLibrary::_material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("_material_cache_get", "key"), &TerramanLibrary::_material_cache_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("material_add", "value"), &TerramanLibrary::material_add);
|
ClassDB::bind_method(D_METHOD("material_add", "value"), &TerramanLibrary::material_add);
|
||||||
ClassDB::bind_method(D_METHOD("material_set", "index", "value"), &TerramanLibrary::material_set);
|
ClassDB::bind_method(D_METHOD("material_set", "index", "value"), &TerramanLibrary::material_set);
|
||||||
@ -368,16 +370,16 @@ void TerramanLibrary::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("materials_set"), &TerramanLibrary::materials_set);
|
ClassDB::bind_method(D_METHOD("materials_set"), &TerramanLibrary::materials_set);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "materials_set", "materials_get");
|
||||||
|
|
||||||
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_liquid_material_cached_get_key"));
|
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_liquid_material_cache_get_key"));
|
||||||
BIND_VMETHOD(MethodInfo("_liquid_material_lod_cached_get", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::INT, "key")));
|
BIND_VMETHOD(MethodInfo("_liquid_material_cache_get", PropertyInfo(Variant::OBJECT, "key", PROPERTY_HINT_RESOURCE_TYPE, "TerraMaterialCache")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_get", "index"), &TerramanLibrary::liquid_material_get);
|
ClassDB::bind_method(D_METHOD("liquid_material_get", "index"), &TerramanLibrary::liquid_material_get);
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_lod_get", "index"), &TerramanLibrary::liquid_material_lod_get);
|
ClassDB::bind_method(D_METHOD("liquid_material_lod_get", "index"), &TerramanLibrary::liquid_material_lod_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_cached_get_key", "chunk"), &TerramanLibrary::liquid_material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("liquid_material_cache_get_key", "chunk"), &TerramanLibrary::liquid_material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("_liquid_material_cached_get_key", "chunk"), &TerramanLibrary::_liquid_material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("_liquid_material_cache_get_key", "chunk"), &TerramanLibrary::_liquid_material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_lod_cached_get", "index", "key"), &TerramanLibrary::liquid_material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("liquid_material_cache_get", "key"), &TerramanLibrary::liquid_material_cache_get);
|
||||||
ClassDB::bind_method(D_METHOD("_liquid_material_lod_cached_get", "index", "key"), &TerramanLibrary::_liquid_material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("_liquid_material_cache_get", "key"), &TerramanLibrary::_liquid_material_cache_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_add", "value"), &TerramanLibrary::liquid_material_add);
|
ClassDB::bind_method(D_METHOD("liquid_material_add", "value"), &TerramanLibrary::liquid_material_add);
|
||||||
ClassDB::bind_method(D_METHOD("liquid_material_set", "index", "value"), &TerramanLibrary::liquid_material_set);
|
ClassDB::bind_method(D_METHOD("liquid_material_set", "index", "value"), &TerramanLibrary::liquid_material_set);
|
||||||
@ -389,16 +391,16 @@ void TerramanLibrary::_bind_methods() {
|
|||||||
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &TerramanLibrary::liquid_materials_set);
|
ClassDB::bind_method(D_METHOD("liquid_materials_set"), &TerramanLibrary::liquid_materials_set);
|
||||||
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
|
ADD_PROPERTY(PropertyInfo(Variant::ARRAY, "liquid_materials", PROPERTY_HINT_NONE, "17/17:Material", PROPERTY_USAGE_DEFAULT, "Material"), "liquid_materials_set", "liquid_materials_get");
|
||||||
|
|
||||||
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_prop_material_cached_get_key"));
|
BIND_VMETHOD(MethodInfo(PropertyInfo(Variant::INT, "ret"), "_prop_material_cache_get_key"));
|
||||||
BIND_VMETHOD(MethodInfo("_prop_material_lod_cached_get", PropertyInfo(Variant::INT, "index"), PropertyInfo(Variant::INT, "key")));
|
BIND_VMETHOD(MethodInfo("_prop_material_cache_get", PropertyInfo(Variant::OBJECT, "key", PROPERTY_HINT_RESOURCE_TYPE, "TerraMaterialCache")));
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_get", "index"), &TerramanLibrary::prop_material_get);
|
ClassDB::bind_method(D_METHOD("prop_material_get", "index"), &TerramanLibrary::prop_material_get);
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_lod_get", "index"), &TerramanLibrary::prop_material_lod_get);
|
ClassDB::bind_method(D_METHOD("prop_material_lod_get", "index"), &TerramanLibrary::prop_material_lod_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_cached_get_key", "chunk"), &TerramanLibrary::prop_material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("prop_material_cache_get_key", "chunk"), &TerramanLibrary::prop_material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("_prop_material_cached_get_key", "chunk"), &TerramanLibrary::_prop_material_cached_get_key);
|
ClassDB::bind_method(D_METHOD("_prop_material_cache_get_key", "chunk"), &TerramanLibrary::_prop_material_cache_get_key);
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_lod_cached_get", "index", "key"), &TerramanLibrary::prop_material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("prop_material_cache_get", "key"), &TerramanLibrary::prop_material_cache_get);
|
||||||
ClassDB::bind_method(D_METHOD("_prop_material_lod_cached_get", "index", "key"), &TerramanLibrary::_prop_material_lod_cached_get);
|
ClassDB::bind_method(D_METHOD("_prop_material_cache_get", "key"), &TerramanLibrary::_prop_material_cache_get);
|
||||||
|
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_add", "value"), &TerramanLibrary::prop_material_add);
|
ClassDB::bind_method(D_METHOD("prop_material_add", "value"), &TerramanLibrary::prop_material_add);
|
||||||
ClassDB::bind_method(D_METHOD("prop_material_set", "index", "value"), &TerramanLibrary::prop_material_set);
|
ClassDB::bind_method(D_METHOD("prop_material_set", "index", "value"), &TerramanLibrary::prop_material_set);
|
||||||
|
@ -43,6 +43,7 @@ SOFTWARE.
|
|||||||
#define Texture Texture2D
|
#define Texture Texture2D
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class TerraMaterialCache;
|
||||||
class TerraSurface;
|
class TerraSurface;
|
||||||
class TerraMesher;
|
class TerraMesher;
|
||||||
class PackedScene;
|
class PackedScene;
|
||||||
@ -71,10 +72,10 @@ public:
|
|||||||
Ref<Material> material_get(const int index);
|
Ref<Material> material_get(const int index);
|
||||||
Ref<Material> material_lod_get(const int index);
|
Ref<Material> material_lod_get(const int index);
|
||||||
|
|
||||||
int material_cached_get_key(const Ref<TerraChunk> &chunk);
|
int material_cache_get_key(const Ref<TerraChunk> &chunk);
|
||||||
virtual int _material_cached_get_key(Ref<TerraChunk> chunk);
|
virtual int _material_cache_get_key(Ref<TerraChunk> chunk);
|
||||||
Ref<Material> material_lod_cached_get(const int index, const int key);
|
Ref<TerraMaterialCache> material_cache_get(const int key);
|
||||||
virtual Ref<Material> _material_lod_cached_get(const int index, const int key);
|
virtual Ref<TerraMaterialCache> _material_cache_get(const int key);
|
||||||
|
|
||||||
void material_add(const Ref<Material> &value);
|
void material_add(const Ref<Material> &value);
|
||||||
void material_set(const int index, const Ref<Material> &value);
|
void material_set(const int index, const Ref<Material> &value);
|
||||||
@ -88,10 +89,10 @@ public:
|
|||||||
Ref<Material> liquid_material_get(const int index);
|
Ref<Material> liquid_material_get(const int index);
|
||||||
Ref<Material> liquid_material_lod_get(const int index);
|
Ref<Material> liquid_material_lod_get(const int index);
|
||||||
|
|
||||||
int liquid_material_cached_get_key(const Ref<TerraChunk> &chunk);
|
int liquid_material_cache_get_key(const Ref<TerraChunk> &chunk);
|
||||||
virtual int _liquid_material_cached_get_key(Ref<TerraChunk> chunk);
|
virtual int _liquid_material_cache_get_key(Ref<TerraChunk> chunk);
|
||||||
Ref<Material> liquid_material_lod_cached_get(const int index, const int key);
|
Ref<TerraMaterialCache> liquid_material_cache_get(const int key);
|
||||||
virtual Ref<Material> _liquid_material_lod_cached_get(const int index, const int key);
|
virtual Ref<TerraMaterialCache> _liquid_material_cache_get(const int key);
|
||||||
|
|
||||||
void liquid_material_add(const Ref<Material> &value);
|
void liquid_material_add(const Ref<Material> &value);
|
||||||
void liquid_material_set(const int index, const Ref<Material> &value);
|
void liquid_material_set(const int index, const Ref<Material> &value);
|
||||||
@ -105,10 +106,10 @@ public:
|
|||||||
Ref<Material> prop_material_get(const int index);
|
Ref<Material> prop_material_get(const int index);
|
||||||
Ref<Material> prop_material_lod_get(const int index);
|
Ref<Material> prop_material_lod_get(const int index);
|
||||||
|
|
||||||
int prop_material_cached_get_key(const Ref<TerraChunk> &chunk);
|
int prop_material_cache_get_key(const Ref<TerraChunk> &chunk);
|
||||||
virtual int _prop_material_cached_get_key(Ref<TerraChunk> chunk);
|
virtual int _prop_material_cache_get_key(Ref<TerraChunk> chunk);
|
||||||
Ref<Material> prop_material_lod_cached_get(const int index, const int key);
|
Ref<TerraMaterialCache> prop_material_cache_get(const int key);
|
||||||
virtual Ref<Material> _prop_material_lod_cached_get(const int index, const int key);
|
virtual Ref<TerraMaterialCache> _prop_material_cache_get(const int key);
|
||||||
|
|
||||||
void prop_material_add(const Ref<Material> &value);
|
void prop_material_add(const Ref<Material> &value);
|
||||||
void prop_material_set(const int index, const Ref<Material> &value);
|
void prop_material_set(const int index, const Ref<Material> &value);
|
||||||
|
@ -24,6 +24,7 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "../../library/terra_surface.h"
|
#include "../../library/terra_surface.h"
|
||||||
#include "../../library/terraman_library.h"
|
#include "../../library/terraman_library.h"
|
||||||
|
#include "../../library/terra_material_cache.h"
|
||||||
|
|
||||||
#include "../../meshers/blocky/terra_mesher_blocky.h"
|
#include "../../meshers/blocky/terra_mesher_blocky.h"
|
||||||
#include "../../meshers/default/terra_mesher_default.h"
|
#include "../../meshers/default/terra_mesher_default.h"
|
||||||
@ -98,7 +99,7 @@ void TerraTerrarinJob::phase_library_setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (lib->supports_caching()) {
|
if (lib->supports_caching()) {
|
||||||
_terrain_material_key = lib->material_cached_get_key(_chunk);
|
_terrain_material_key = lib->material_cache_get_key(_chunk);
|
||||||
|
|
||||||
if (_mesher.is_valid()) {
|
if (_mesher.is_valid()) {
|
||||||
_mesher->set_terrain_material_key(_terrain_material_key);
|
_mesher->set_terrain_material_key(_terrain_material_key);
|
||||||
@ -483,7 +484,7 @@ void TerraTerrarinJob::step_type_normal() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
@ -524,7 +525,7 @@ void TerraTerrarinJob::step_type_normal_lod() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
@ -548,7 +549,7 @@ void TerraTerrarinJob::step_type_drop_uv2() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
@ -572,7 +573,7 @@ void TerraTerrarinJob::step_type_merge_verts() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
@ -608,7 +609,7 @@ void TerraTerrarinJob::step_type_bake_texture() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
@ -643,7 +644,7 @@ void TerraTerrarinJob::step_type_simplify_mesh() {
|
|||||||
Ref<Material> lmat;
|
Ref<Material> lmat;
|
||||||
|
|
||||||
if (chunk->get_library()->supports_caching()) {
|
if (chunk->get_library()->supports_caching()) {
|
||||||
lmat = chunk->get_library()->material_lod_cached_get(_current_mesh, _terrain_material_key);
|
lmat = chunk->get_library()->material_cache_get(_terrain_material_key)->material_lod_get(_current_mesh);
|
||||||
} else {
|
} else {
|
||||||
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
lmat = chunk->get_library()->material_lod_get(_current_mesh);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user