|
@@ -4,6 +4,7 @@ var Point = preload("res://point.tscn")
|
|
|
var TopoLoader = preload("res://TopoLoader.gd")
|
|
|
var tl
|
|
|
var TextureLoader = preload("res://TextureLoader.gd")
|
|
|
+var texl
|
|
|
|
|
|
var groundShader = preload("res://shader/ground_shader.tres") as ShaderMaterial
|
|
|
|
|
@@ -42,6 +43,11 @@ func _ready():
|
|
|
#genMesh called from chunk
|
|
|
#self.genMesh()
|
|
|
|
|
|
+func initTexture():
|
|
|
+ texl = TextureLoader.new()
|
|
|
+ var exists = texl.open(latMin, lonMin)
|
|
|
+ return exists
|
|
|
+
|
|
|
func genMesh():
|
|
|
#print("generating Mesh:")
|
|
|
#print("latMin: " + str(latMin))
|
|
@@ -61,8 +67,7 @@ func genMesh():
|
|
|
mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, arr)
|
|
|
var mat = groundShader.duplicate()
|
|
|
#mat.albedo_color = Color(0.7,0.7,0.7,1)
|
|
|
- var texl = TextureLoader.new()
|
|
|
- mat.set_shader_param("texture_albedo_big", texl.loadTexture(latMin, lonMin))
|
|
|
+ mat.set_shader_param("texture_albedo_big", texl.loadTexture())
|
|
|
mesh.surface_set_material(0,mat)
|
|
|
.create_trimesh_collision()
|
|
|
|