Commit graph

164 commits

Author SHA1 Message Date
Moritz Brückner d610cc6a2f Fix value range in Nishita LUT 2021-08-09 16:51:26 +02:00
N8n5h 801668a0c2 Fix compiling error with shadow map atlas shadow size option
Added 512 option to Inc so it doesn't fails compilation because of
missing option as explained here
https://github.com/armory3d/armory/issues/2252#issue-937328497
2021-07-06 10:39:07 -03:00
Lubos Lenco 98eeccd71d
Merge pull request #2082 from armory3d/blender2.9
Blender 2.9 LTS support
2021-05-10 11:14:39 +02:00
N8n5h 939649f492 Make tileSizes and TileSizesFactor non-static
This solves an oversight that basically made all atlases share the
their tileSizesFactor, a variable used to quickly lookup tile tile sizes
depending on the shadowMapScale. So if cascade size was higher than cube
map size, then point light atlases would use incorrect values and break.
2021-04-28 19:12:45 -03:00
N8n5h 41c6924231 Separate shadow map atlas logic and rendering time 2021-04-24 21:48:24 -03:00
N8n5h 9247b09c88 Add profiling of shadow map atlas logic 2021-04-24 20:31:03 -03:00
N8n5h eb01b4652a remove redundant 0 check when computing tile offset 2021-04-18 10:32:36 -03:00
N8n5h e1cfa2f1da Add shadow map atlases info to the debug console
Display information like tile size, current size, max size, free tiles,
etc. to help debug atlases.
2021-04-14 00:32:54 -03:00
N8n5h 63716eea17 Modifications around addLight from Inc
* Removed redundant checks at the start of the function.
* changed the return value to void because the "return false" were
redundant, and simply made it so the lightInAtlas is set at the end of
the function.
* Removed unused variable
2021-04-07 12:44:54 -03:00
N8n5h 614385ea7b Setup callbacks so tiles are notified when a light is removed
A secondary callback is setup so the tile it's also removed from the
activeTiles, because it's freed in a "non standard" way.
2021-04-07 12:44:54 -03:00
Moritz Brückner f64419dd06 Merge branch 'master' into blender2.9
# Conflicts:
#	blender/arm/material/shader.py
#	blender/arm/props_collision_filter_mask.py
#	blender/arm/props_ui.py
2021-04-03 14:12:54 +02:00
Moritz Brückner 420033c86d Add API to set Nishita density parameters 2021-03-26 20:59:26 +01:00
Moritz Brückner 8d812548c4 Use 2D LUT for Nishita skies 2021-03-25 23:29:34 +01:00
N8n5h c7211542b4 Make pointLightData work with lights with cast_shadow=false 2021-03-14 23:21:02 -03:00
Moritz Brückner 5f55b00710 Begin with Nishita LUT implementation for better performance 2021-03-11 23:16:44 +01:00
Alexander Kleemann aec10274f4 Add option to ignore irradiance for baked environments 2021-02-20 15:30:18 +01:00
Alexander Kleemann f1858550d0 Blending fix
Fix for https://github.com/armory3d/armory/issues/1615
2021-02-20 13:51:25 +01:00
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 068a539f60 Forward renderpath: add support for chromatic aberration 2020-11-28 23:09:07 +01:00
Lubos Lenco 78aec97c95
Merge pull request #1744 from MoritzBrueckner/world-export
Multi-world support
2020-07-07 11:07:25 +02:00
Moritz Brückner 27b3aa5f49 Fix renderpaths for scenes without a world 2020-07-06 22:53:31 +02:00
Moritz Brückner d06f07f2cf Update renderpath skydome drawing to Iron changes 2020-07-06 18:14:58 +02:00
Moritz Brückner ae07dab862 Renderpaths: load new world shaders 2020-07-05 23:30:55 +02:00
tong 11a3358879 Replace if conditions with switch 2020-06-27 15:59:53 +02:00
Lubos Lenco 9325edbe34
Merge pull request #1548 from ForestCSharp/master
lights wouldn't render at all if use_shadow / cast_shadow was unchecked
2020-05-11 09:31:00 +02:00
Lubos Lenco e30a8c7f46 Metal fixes 2020-05-11 09:03:13 +02:00
Lubos Lenco 66e9572554 Add clear pass for metal 2020-05-04 23:08:47 +02:00
Forest Collins Sharp 8958668215
Merge pull request #2 from armory3d/master
merging latest from armory3d/armory
2020-03-07 08:44:02 -06:00
Alexander Kleemann 3dce053aa3
Update Postprocess.hx
Accidentally deleted the return value when removing comments
2020-03-04 20:11:37 +01:00
Alexander 60f72e7e0e Merge in PPM
Redone and ready to be merged with Armory
2020-03-04 17:45:19 +01:00
Forest Sharp 57cd481731 lights wouldn't render at all if use_shadow / cast_shadow was disabled 2020-01-19 18:49:30 -06:00
luboslenco db4f0cc107 Apply checkstyle 2019-12-19 23:54:08 +01:00
luboslenco be4853cb6a Forward path water pass 2019-08-22 11:59:54 +02:00
Alexander 000ec17e3d Chromatic aberration 2019-08-08 20:02:42 +02:00
luboslenco ff5cf50e4e Fix dynamic resolution 2019-08-07 22:43:30 +02:00
luboslenco f5f7926d1f Expose mesh target 2019-07-18 20:26:41 +02:00
luboslenco 8b9c875a4b Fix cleanup 2019-05-20 14:25:17 +02:00
luboslenco 9802016556 Cleanup 2019-05-19 15:23:56 +02:00
luboslenco ebe0f20cce Fix target set in forward path 2019-05-01 21:26:15 +02:00
luboslenco b3ca6b4cc1 Fix probe check 2019-04-30 13:30:38 +02:00
luboslenco 537b4ddd1e Update water path 2019-04-29 16:25:01 +02:00
luboslenco faae72e5e4 Auto exposure fixes 2019-04-23 12:05:50 +02:00
unknown 54bb309807 Auto exposure fixes 2019-04-22 14:11:17 +02:00
unknown 44f1e115e9 Begin histogram 2019-04-21 19:16:23 +02:00
luboslenco 903c72d62e Fix overlays target 2019-04-17 12:46:12 +02:00
luboslenco d4680b5e1a Update shader load 2019-04-15 13:47:51 +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
luboslenco 93ab14bfa4 Pass tex data 2019-04-04 15:52:42 +02:00
luboslenco c29e8fdbd0 Shadows cleanup 2019-03-23 10:56:30 +01:00