mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
[godot] Godot 3.x does not have support for specular maps
This commit is contained in:
parent
2f48bf16e2
commit
d3b62a2a73
@ -171,10 +171,16 @@ static void add_triangles(SpineMesh2D *mesh_instance, const Vector<Point2> &vert
|
||||
auto texture = renderer_object->texture;
|
||||
auto normal_map = renderer_object->normal_map;
|
||||
auto specular_map = renderer_object->specular_map;
|
||||
#if VERSION_MAJOR > 3
|
||||
VisualServer::get_singleton()->canvas_item_add_triangle_array(mesh_instance->get_canvas_item(), indices, vertices, colors, uvs, Vector<int>(),
|
||||
Vector<float>(), texture.is_null() ? RID() : texture->get_rid(), -1,
|
||||
normal_map.is_null() ? RID() : normal_map->get_rid(),
|
||||
specular_map.is_null() ? RID() : specular_map->get_rid());
|
||||
#else
|
||||
VisualServer::get_singleton()->canvas_item_add_triangle_array(mesh_instance->get_canvas_item(), indices, vertices, colors, uvs, Vector<int>(),
|
||||
Vector<float>(), texture.is_null() ? RID() : texture->get_rid(), -1,
|
||||
normal_map.is_null() ? RID() : normal_map->get_rid());
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
@ -374,11 +380,16 @@ void SpineMesh2D::update_mesh(const Vector<Point2> &vertices, const Vector<Point
|
||||
VS::get_singleton()->mesh_surface_update_region(mesh, 0, 0, mesh_buffer);
|
||||
VS::get_singleton()->mesh_set_custom_aabb(mesh, aabb_new);
|
||||
}
|
||||
|
||||
#if VERSION_MAJOR > 3
|
||||
VS::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1),
|
||||
renderer_object->texture.is_null() ? RID() : renderer_object->texture->get_rid(),
|
||||
renderer_object->normal_map.is_null() ? RID() : renderer_object->normal_map->get_rid(),
|
||||
renderer_object->specular_map.is_null() ? RID() : renderer_object->specular_map->get_rid());
|
||||
#else
|
||||
VS::get_singleton()->canvas_item_add_mesh(this->get_canvas_item(), mesh, Transform2D(), Color(1, 1, 1, 1),
|
||||
renderer_object->texture.is_null() ? RID() : renderer_object->texture->get_rid(),
|
||||
renderer_object->normal_map.is_null() ? RID() : renderer_object->normal_map->get_rid());
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user