Post by Arcane Architect on May 19, 2017 19:20:20 GMT
In the previous update the "Tiled lighting" build was discussed, including a list of features and improvements that it will bring. Work continues on the build but I wanted to highlight one feature that hasn't been discussed previously.
The Problem
One area where Arcane Mapper has struggled is with dealing with older computers and integrated graphics parts. The editor, as currently released, demands a lot from your GPU - which is great for people with relatively modern discrete GPUs since a lot is gained by this, such as the realtime lights and shadows that really improve the visual quality of the maps. However weaker GPUs, which claim to support OpenGL 3.0 or higher, struggle with either the rendering (no shadows on an Intel Integrated chip) or performance or simply don't work at all (older GPUs with less than 1GB memory).
Hardware and Software Lighting
The "Tiled Lighting" build will introduce the concept of "Hardware Accelerated Lighting" and "Software Lighting." By default modern NVidia and AMD GPUs should default to Hardware Accelerated Lighting and everything else to Software. This has several effects:
So how does this work?
Arcane Mapper caches the lighting results into "lightmaps" so the editor stays responsive when moving around, interacting with the UI, etc. no matter how many lights are in the map. The "Tiled Lighting" build extends this concept to keeping separate tiles which are 5x5 units in size. It then tracks which tiles need to be updated and keeps a shadow cache, which stores 32 shadows, to avoid updating more shadows then necessary when rendering the "dirty" tiles. By properly culling lights, limiting the number of tiles that can be updated in a frame and using the shadow cache - performance is greatly improved over the build that is currently available.
When using the Software Lighting path, the GPU still rasterizes the geometry and objects and the necessary data is then passed to the CPU for asynchronous light rendering. The CPU renderer runs on seperate threads - the number of threads depends on how many CPU cores your system has available. Each 5x5 unit tile (350x350 pixels at the default lighting resolution) is then split into smaller pieces that can fit in the CPU cache - into small 50x50 pixel "stiles". Each "stile" is submitted as a task to the thread pool - at which point each stile is further subdivided into 2x2 "quads" - where all 4 pixels are rendered at the same time using SSE 2. These quads are in the form of 2x2 squares, "swizzled" to improve locality. Once all the quads finish, the stile can be converted to the final pixel format (HDR encoding in 32 bits) and stored in the final lighting buffers. At regular intervals the buffers used on the GPU are updated so you can see the lighting on the screen.
Final Words
If you have gotten this far, thanks for reading.
To put it simply, Arcane Mapper will soon work on more systems and be less reliant on outdated GPU drivers. Rather then compromising the quality of the lighting or current or future features - instead Arcane Mapper will be able to take advantage of your CPU to asynchronously render high quality lighting without slowing you down.
Of course if you have a modern discrete GPU then that will continue to provide the best experience. But even in that case Arcane Mapper will perform better and be more responsive under higher loads.
There are more lighting improvements coming and possibly other surprises, but that will have to wait for another post.
The Problem
One area where Arcane Mapper has struggled is with dealing with older computers and integrated graphics parts. The editor, as currently released, demands a lot from your GPU - which is great for people with relatively modern discrete GPUs since a lot is gained by this, such as the realtime lights and shadows that really improve the visual quality of the maps. However weaker GPUs, which claim to support OpenGL 3.0 or higher, struggle with either the rendering (no shadows on an Intel Integrated chip) or performance or simply don't work at all (older GPUs with less than 1GB memory).
Hardware and Software Lighting
The "Tiled Lighting" build will introduce the concept of "Hardware Accelerated Lighting" and "Software Lighting." By default modern NVidia and AMD GPUs should default to Hardware Accelerated Lighting and everything else to Software. This has several effects:
- Reduces the system requirements from OpenGL 3.0 to OpenGL 2.1 - though 3.0 will still be used when possible.
- Full lighting and shadows on Integrated Parts using the software path.
- Less GPU memory required for the Software Mode, allowing GPUs with less memory to run well.
- When using software, lighting may "lag" behind - the goal is to maintain high performance in the editor and let the lighting update as fast as the system performance allows.
So how does this work?
Arcane Mapper caches the lighting results into "lightmaps" so the editor stays responsive when moving around, interacting with the UI, etc. no matter how many lights are in the map. The "Tiled Lighting" build extends this concept to keeping separate tiles which are 5x5 units in size. It then tracks which tiles need to be updated and keeps a shadow cache, which stores 32 shadows, to avoid updating more shadows then necessary when rendering the "dirty" tiles. By properly culling lights, limiting the number of tiles that can be updated in a frame and using the shadow cache - performance is greatly improved over the build that is currently available.
When using the Software Lighting path, the GPU still rasterizes the geometry and objects and the necessary data is then passed to the CPU for asynchronous light rendering. The CPU renderer runs on seperate threads - the number of threads depends on how many CPU cores your system has available. Each 5x5 unit tile (350x350 pixels at the default lighting resolution) is then split into smaller pieces that can fit in the CPU cache - into small 50x50 pixel "stiles". Each "stile" is submitted as a task to the thread pool - at which point each stile is further subdivided into 2x2 "quads" - where all 4 pixels are rendered at the same time using SSE 2. These quads are in the form of 2x2 squares, "swizzled" to improve locality. Once all the quads finish, the stile can be converted to the final pixel format (HDR encoding in 32 bits) and stored in the final lighting buffers. At regular intervals the buffers used on the GPU are updated so you can see the lighting on the screen.
Final Words
If you have gotten this far, thanks for reading.
To put it simply, Arcane Mapper will soon work on more systems and be less reliant on outdated GPU drivers. Rather then compromising the quality of the lighting or current or future features - instead Arcane Mapper will be able to take advantage of your CPU to asynchronously render high quality lighting without slowing you down.
Of course if you have a modern discrete GPU then that will continue to provide the best experience. But even in that case Arcane Mapper will perform better and be more responsive under higher loads.
There are more lighting improvements coming and possibly other surprises, but that will have to wait for another post.