Commit graph

61 commits

Author SHA1 Message Date
N8n5h 1c3e24a8fd Add support for shadow map atlasing
With this it is now possible to enable atlasing of shadow maps, which solves the existing limitation of 4 lights in a scene. This is done by
grouping the rendering of shadow maps, that currently are drawn into their own images for each light, into one or several big textures. This was
done because the openGL and webGL version Armory targets do not support dynamic indexing of shadowMapSamplers, meaning that the index that
access an array of shadow maps has to be know by the compiler before hand so it can be unrolled into if/else branching. By instead simply
using a big shadow map texture and moving the dynamic part to other types of array that are allowed dynamic indexing like vec4 and mat4, this
limitation was solved.

The premise was simple enough for the shader part, but for the Haxe part, managing and solving where lights shadow maps should go in a shadow map
can be tricky. So to keep track and solve this, ShadowMapAtlas and ShadowMapTile were created. These classes have the minimally required logic
to solve the basic features needed for this problem: defining some kind of abstraction to prevent overlapping of shadowmaps, finding available
space, assigning such space efficiently, locking and freeing this space, etc. This functionality it is used by drawShadowMapAtlas(), which is a
modified version of drawShadowMap().

Shadow map atlases are represented with perfectly balanced 4-ary trees, where each tree of the previous definition represents a "tile" or slice
that results from dividing a square that represents the image into 4 slices or sub-images. The root of this "tile" it's a reference to the
tile-slice, and this tile is divided in 4 slices, and the process is repeated depth-times. If depth is 1, slices are kept at just the initial
4 tiles of max size, which is the default size of the shadow map. #arm_shadowmap_atlas_lod allows controlling if code to support more depth
levels is added or not when compiling.

the tiles that populate atlases tile trees are simply a data structure that contains a reference to the light they are linked to, inner
subtiles in case LOD is enabled, coordinates to where this tile starts in the atlas that go from 0 to Shadow Map Size, and a reference to a
linked tile for LOD. This simple definition allows tiles having a theoretically small memory footprint, but in turn this simplicity might make
some functionality that might be responsibility of tiles (for example knowing if they are overlapping) a responsibility of the ones that
utilizes tiles instead. This decision may complicate maintenance so it is to be revised in future iterations of this feature.
2021-02-04 17:53:59 -03:00
Moritz Brückner 6f1f97f9e9 Debug console: add "Set Active Camera" button for camera objects 2020-10-29 20:00:59 +01:00
Moritz Brückner 1d3c9cf23b Whitespace cleanup 2020-10-29 20:00:35 +01:00
E1e5en 305878db42 Add Debug Console settings
1. Adding the ability to customize display, scale (size), shortcuts to the DebugConsole class.
2. Adding a function to utils.py to get Debug Console settings from Render: Armory.
3. Added Debug Console settings to the Armory Project interface:
- Enable (default value - False);
- Position (Left, Center, Right, default value - Right);
- Scale Console (from 0.3 to 10);
- Visible.
4. Added transfer of Debug Console settings to exporter.py.
5. Added logical nodes to control DebugConsole while the application is running.
2020-10-10 13:10:34 +03:00
tong 6c94354da6 Proper debug console log output formatting 2020-05-24 18:28:53 +02:00
Moritz Brückner 3b1437aca5 Fix debug console look (again) 2020-04-12 20:04:16 +02:00
Moritz Brückner 08b690adf8 DebugConsole: Fix outliner look 2020-04-09 00:21:35 +02:00
Moritz Brückner f242e0316e Fix debug console for scenes with no world 2020-04-09 00:20:54 +02:00
Moritz Brückner d36c8a4176 DebugConsole: implement trait detail view 2020-01-02 18:48:02 +01:00
luboslenco 3c058568f7 Add TransformExtension 2020-01-02 13:47:06 +01:00
Moritz Brückner edc6bee204 DebugConsole: Fix handles for multiple lights or cameras 2019-12-27 16:44:11 +01:00
Moritz Brückner f33729ed69 Indent trait list in debug console 2019-12-27 16:43:39 +01:00
Moritz Brückner 0d6b72b7bb Improve transform view in debug console 2019-12-27 16:43:08 +01:00
Moritz Brückner 9b90398e8d DebugConsole: Refactor outliner 2019-12-27 16:40:59 +01:00
luboslenco db4f0cc107 Apply checkstyle 2019-12-19 23:54:08 +01:00
luboslenco 405da0e10e Fix debug console compile 2019-11-13 09:09:06 +01:00
luboslenco 06875b963a Use std.Math 2019-06-20 11:35:20 +02:00
luboslenco a914014718 Trace debugFloat on change 2019-04-25 22:40:21 +02:00
luboslenco 078a415ba9 Expose debugFloat 2019-04-24 21:55:20 +02:00
luboslenco 8ad93763b2 Do not copy theme for console 2019-04-04 15:53:11 +02:00
luboslenco 78dba00f17 Fix debug console begin/end calls 2019-02-13 08:03:05 +01:00
luboslenco 1d47ec184a Fix fov setting in debug console 2019-01-28 11:37:34 +01:00
luboslenco cda8276477 Exporter fixes 2018-12-20 22:37:39 +01:00
luboslenco 62b23aa2f0 Depth bind fixes 2018-11-28 10:26:48 +01:00
unknown 0cc1023d9d Rename bundled font to font_default 2018-11-04 11:02:29 +01:00
luboslenco abd464cd22 Expose debug console visibility 2018-10-11 11:30:39 +02:00
luboslenco 9d02708062 Probe stubs 2018-10-01 11:45:43 +02:00
luboslenco 8236f4da08 UI scale for debug console 2018-08-29 09:59:23 +02:00
luboslenco d2a96abcde Rename Lamp to Light to keep in sync with Blender2.8 2018-08-28 15:10:28 +02:00
luboslenco a83502c0f8 Fix console flag 2018-08-28 13:52:53 +02:00
luboslenco 68ec902090 Merge faster math and skinning 2018-08-28 13:50:52 +02:00
luboslenco 5d59a315c6 Faster debug console 2018-08-22 12:23:33 +02:00
luboslenco 1829261f1b Watch node tree name 2018-06-29 08:40:56 +02:00
luboslenco 050c5e7d8f Watch logic node value in debug console 2018-06-28 22:39:23 +02:00
luboslenco 3ef5c49824 Show object traits in debug console 2018-06-28 11:34:56 +02:00
luboslenco a98fded080 Fix define 2018-06-20 15:02:01 +02:00
luboslenco f06878dbfb Improved debug console 2018-06-20 14:57:37 +02:00
luboslenco 8fa9da0442 Fix bone child translation 2018-06-14 22:50:11 +02:00
unknown 2610dca848 Trait init fixes 2018-06-02 19:00:36 +02:00
luboslenco 97f3d3dd3b Fix warning print 2018-03-06 22:05:36 +01:00
Lubos Lenco 8e041ce4c3 Toggle console with ~ 2018-02-18 19:28:47 +01:00
Martin Wallin 773aafbb26 Use custom math class, round object positions with two decimals
Dependency: https://github.com/armory3d/iron/pull/28
2017-12-30 12:13:35 +01:00
Lubos Lenco 2a3b8ff81b Show trace in tab header 2017-12-07 17:44:44 +01:00
Lubos Lenco 00de597d19 New render path system 2017-11-22 21:17:36 +01:00
Lubos Lenco 900f2b77c7 Cascaded shadows 2017-11-15 13:34:51 +01:00
Lubos Lenco a087608666 Basic DebugDraw 2017-11-12 21:56:01 +01:00
Lubos Lenco 21c89b3eec Faster voxels 2017-10-23 16:24:57 +02:00
Lubos Lenco 24aa6c4787 Separate physics module 2017-09-30 00:32:06 +02:00
Lubos Lenco 5f14db1fbd Resolution presets 2017-09-07 11:44:45 +02:00
Lubos Lenco 2d2197d1ec Export debug console as scene trait 2017-09-04 10:20:04 +02:00