summaryrefslogtreecommitdiffstats
path: root/scene/2d/tile_map.cpp
diff options
context:
space:
mode:
authorreduz <reduzio@gmail.com>2020-10-24 12:15:43 -0300
committerreduz <reduzio@gmail.com>2020-10-24 15:57:25 -0300
commit84d734da0e4dc4f0076c61a7178d8ad7b9f3b616 (patch)
treef5b2f2ec923bf3eb1593531bc3d91c3dc1a1c0a1 /scene/2d/tile_map.cpp
parentb67ccf1a6f326c5d4d5fa1cc7cd15eff3573f8f7 (diff)
downloadredot-engine-84d734da0e4dc4f0076c61a7178d8ad7b9f3b616.tar.gz
Refactored 2D shader and lighting system
-Removed normal/specular properties from nodes -Create CanvasTexture, which can contain normal/specular channels -Refactored, optimized and simplified 2D shaders -Use atlas for light textures. -Use a shadow atlas for shadow textures. -Use both items aboves to make light rendering stateless (faster). -Reorganized uniform sets for more efficiency.
Diffstat (limited to 'scene/2d/tile_map.cpp')
-rw-r--r--scene/2d/tile_map.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 94ec0998fa..bff191a2bf 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -528,15 +528,14 @@ void TileMap::update_dirty_quadrants() {
rect.position += tile_ofs;
}
- Ref<Texture2D> normal_map = tile_set->tile_get_normal_map(c.id);
Color modulate = tile_set->tile_get_modulate(c.id);
Color self_modulate = get_self_modulate();
modulate = Color(modulate.r * self_modulate.r, modulate.g * self_modulate.g,
modulate.b * self_modulate.b, modulate.a * self_modulate.a);
if (r == Rect2()) {
- tex->draw_rect(canvas_item, rect, false, modulate, c.transpose, normal_map);
+ tex->draw_rect(canvas_item, rect, false, modulate, c.transpose);
} else {
- tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose, normal_map, Ref<Texture2D>(), Color(1, 1, 1, 1), RS::CANVAS_ITEM_TEXTURE_FILTER_DEFAULT, RS::CANVAS_ITEM_TEXTURE_REPEAT_DEFAULT, clip_uv);
+ tex->draw_rect_region(canvas_item, rect, r, modulate, c.transpose, clip_uv);
}
Vector<TileSet::ShapeData> shapes = tile_set->tile_get_shapes(c.id);