Commit graph

110 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 70b0219a05 Reorganize imports and remove unused ones 2020-07-01 21:06:02 +02:00
Moritz Brückner d0e9369947 Revert water/fog UI and remove now unused properties 2020-07-01 20:57:01 +02:00
Alexander 60f72e7e0e Merge in PPM
Redone and ready to be merged with Armory
2020-03-04 17:45:19 +01:00
Alexander 000ec17e3d Chromatic aberration 2019-08-08 20:02:42 +02:00
Alexander f521828edc Lens dirt masking 2019-08-08 18:56:56 +02:00
luboslenco 2da0e03d17 Micro shadowing 2019-05-21 21:53:57 +02:00
luboslenco d05641b4a3 Auto-exposure speed 2019-05-01 10:52:42 +02:00
luboslenco e402442754 Water refract 2019-04-29 16:21:44 +02:00
luboslenco d8bd7f6972 Link clouds props 2019-04-26 09:58:20 +02:00
unknown 54bb309807 Auto exposure fixes 2019-04-22 14:11:17 +02:00
unknown 5240249982 Use voxelao instead of voxelgi, gi will be reworked into raytracing 2019-04-06 18:52:21 +02:00
unknown 445a4fdc61 Code cleanup 2019-04-06 16:05:01 +02:00
unknown 27197cc94f Force gpu particles 2019-04-06 14:30:11 +02:00
unknown 4ecec19ad3 Force gpu skinning 2019-04-06 14:13:38 +02:00
Urjasvi 318e875013 update addon to latest blender api changes 2019-03-29 19:25:42 +05:30
luboslenco c29e8fdbd0 Shadows cleanup 2019-03-23 10:56:30 +01:00
luboslenco 1e5b11d0a3 Expose vignette strength 2019-02-21 14:20:18 +01:00
luboslenco 9cd951819a Fix raytracer 2019-02-19 10:09:42 +01:00
luboslenco 5543e1d140 Full ssr for max render path 2019-02-12 12:38:28 +01:00
luboslenco c4ae64f2d3 Mark voxelgi as experimental 2019-02-11 22:15:29 +01:00
luboslenco a1da8b0824 Expose cone aperture 2019-02-09 15:34:16 +01:00
luboslenco 9c5cc51235 Name default render path as Desktop 2019-02-09 09:51:33 +01:00
luboslenco e17d06225c Expose voxel shadow 2019-01-27 19:12:00 +01:00
luboslenco 9ba53d172d Transluc + sss fixes 2019-01-24 12:47:51 +01:00
luboslenco 5f688acffa No vr preset, enable manually 2019-01-23 11:58:32 +01:00
luboslenco 169bf4878b Clamp cascade size 2019-01-21 17:59:25 +01:00
luboslenco d64441b7d3 Update voxelgi 2019-01-10 21:54:36 +01:00
luboslenco f570d5e5a3 Cache fixes 2019-01-04 15:02:53 +01:00
unknown 6edaac2c9d Shader fixes 2018-12-30 23:05:06 +01:00
unknown e760a781fd Faster exporter 2018-12-29 16:34:04 +01:00
luboslenco a531b52b9f UI style 2018-12-19 13:33:17 +01:00
luboslenco a9d4e9c2ef Begin b28 era 2018-12-18 23:48:38 +01:00
luboslenco d8f78638bd Begin shadow index 2018-12-10 23:29:04 +01:00
luboslenco 023668221e Update shadowmap props 2018-12-10 00:02:40 +01:00
luboslenco 835792f7fc Shader fixes 2018-12-07 13:48:40 +01:00
luboslenco 13bb02e337 Fast clear 2018-12-06 20:36:56 +01:00
luboslenco 93cc102bf5 Faster 2018-12-06 15:23:08 +01:00
luboslenco 687f4e71ce Voxel ao for hlsl 2018-12-04 19:06:01 +01:00
luboslenco c396267e8a More list item moving 2018-11-22 13:31:15 +01:00
luboslenco 850dade8a5 Merge clustered rendeder - wip, unstable 2018-11-22 11:08:03 +01:00
luboslenco ac38825cef Cleanup 2018-11-19 15:41:26 +01:00
luboslenco 4904b50f1a Cleanup 2018-11-19 14:28:04 +01:00
luboslenco 10442cf0ff Begin renderer work 2018-11-19 13:18:40 +01:00
luboslenco ee0282ce8e Preset fix 2018-11-16 11:09:51 +01:00
luboslenco 9f5f52142d New render path popup 2018-11-15 14:35:22 +01:00
luboslenco 2fc63d7fed Expose draw order 2018-09-08 12:34:12 +02:00
luboslenco 148294ded9 More b28 fixes 2018-09-05 10:20:02 +02:00
luboslenco d2a96abcde Rename Lamp to Light to keep in sync with Blender2.8 2018-08-28 15:10:28 +02:00
luboslenco b34c05a727 Write cleaner Main 2018-08-26 18:42:10 +02:00