Introduce the concept of a texture atlas und use it to speed up terrain rendering
Bug #1395628 reported by
SirVer
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
widelands |
Fix Released
|
Medium
|
Unassigned |
Bug Description
This is a rendering improvement made possible through the removal of the sofware renderer.
Currently all terrain textures are loaded into their own GL surface. This is rather wasteful given that we have 198 texture images only - they fit in a 1024x1024 texture and that would mean we could render all terrains in one go (without mode switching). This would simplify and speed up terrain rendering a ton.
If we build a texture atlas class that can 2d binpack arbitrary images we can also reuse this for sprites (i.e. animations) and binpacking for packed animations (i.e. spritemaps).
Related branches
lp:~widelands-dev/widelands/use_image_cache
- TiborB: Approve
- SirVer: Needs Resubmitting
- Nicolai Hähnle: Needs Fixing
- Tino: Needs Fixing
- kaputtnik (community): Approve
-
Diff: 2683 lines (+657/-944)40 files modifiedsrc/editor/ui_menus/editor_tool_set_terrain_options_menu.cc (+1/-1)
src/graphic/CMakeLists.txt (+7/-9)
src/graphic/blit_mode.h (+36/-0)
src/graphic/build_texture_atlas.cc (+42/-177)
src/graphic/build_texture_atlas.h (+38/-0)
src/graphic/font_handler1.cc (+2/-2)
src/graphic/font_handler1.h (+3/-3)
src/graphic/gl/blit_program.cc (+131/-298)
src/graphic/gl/blit_program.h (+78/-83)
src/graphic/gl/dither_program.cc (+10/-25)
src/graphic/gl/draw_line_program.cc (+5/-9)
src/graphic/gl/fill_rect_program.cc (+4/-6)
src/graphic/gl/road_program.cc (+7/-15)
src/graphic/gl/terrain_program.cc (+5/-15)
src/graphic/gl/utils.cc (+72/-0)
src/graphic/gl/utils.h (+49/-11)
src/graphic/graphic.cc (+36/-28)
src/graphic/graphic.h (+7/-4)
src/graphic/image_cache.cc (+12/-30)
src/graphic/image_cache.h (+17/-32)
src/graphic/render_queue.cc (+9/-39)
src/graphic/render_queue.h (+4/-11)
src/graphic/screen.cc (+16/-11)
src/graphic/surface.h (+2/-2)
src/graphic/text/test/render_richtext.cc (+2/-1)
src/graphic/texture.cc (+12/-13)
src/logic/CMakeLists.txt (+0/-1)
src/logic/map_info.cc (+2/-1)
src/logic/map_objects/tribes/road_textures.cc (+6/-6)
src/logic/map_objects/tribes/road_textures.h (+7/-7)
src/logic/map_objects/tribes/tribe_descr.cc (+4/-4)
src/logic/map_objects/tribes/tribe_descr.h (+3/-4)
src/logic/map_objects/tribes/tribes.cc (+2/-28)
src/logic/map_objects/tribes/tribes.h (+0/-2)
src/logic/map_objects/world/terrain_description.cc (+3/-3)
src/logic/map_objects/world/terrain_description.h (+3/-3)
src/logic/map_objects/world/world.cc (+1/-24)
src/logic/map_objects/world/world.h (+0/-2)
src/wlapplication.cc (+19/-33)
src/wlapplication.h (+0/-1)
Changed in widelands: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
assignee: | nobody → SirVer (sirver) |
milestone: | none → build19-rc1 |
tags: |
added: graphics removed: graphic |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
The rectangle program is screwed up - an offset error someplace I guess. Tested in Linux Mint.