Commit graph

488 commits

Author SHA1 Message Date
QuantumCoderQC c44e2cf555 Pass default vector value when adding uniform 2021-06-24 18:13:13 +02:00
Moritz Brückner ccc427c04a Cleanup 2021-05-27 22:57:53 +02:00
Moritz Brückner 6d37095014 Fix usage of layer weight node in shadowmap shaders 2021-05-27 22:56:07 +02:00
Moritz Brückner 7057ec4ba6 Fix mixing multiple cycles shaders in one material 2021-05-27 22:41:27 +02:00
Moritz Brückner bdc2d91c1e Fix instancing on mobile and solid renderpaths
`gl_Position` was set before the instancing code in the vertex shader, this was the same issue as already fixed for desktop renderpaths in https://github.com/armory3d/armory/pull/2141
2021-05-26 12:42:11 +02: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
Moritz Brückner 97b578d0ed Fix export of attribute node if no UV map exists 2021-04-19 22:21:23 +02:00
Moritz Brückner 8a364259db Fix creation of overlay materials 2021-04-19 21:42:09 +02: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
Lubos Lenco c9182cc152
Merge pull request #2149 from MoritzBrueckner/2.9-NishitaSky
[Blender 2.9] Nishita sky model & (ir)radiance support for all world shaders
2021-04-03 10:07:25 +02:00
Moritz Brückner 656b018e5f Render (ir)radiance probes if no other probes are set 2021-04-02 01:59:28 +02:00
Moritz Brückner c5be90d0b0 Cleanup 2021-03-31 20:33:52 +02:00
N8n5h ead7dc9d32 Moved biasLWVP matrix uniform reference to a new one for sun
This was done because the original "_biasLightWorldViewProjectionMatrix"
relies on renderpath.light, which is problematic when rendering the
deferred light pass and there is a sun and other lights of different
type on the scene. Which would result on the wrong light being picked up
for the calculation of the uniform value.
2021-03-29 10:55:58 -03:00
Lubos Lenco 44f08a16ae
Merge pull request #2141 from MoritzBrueckner/instancing-fix
Fix writing to gl_Position before instancing code
2021-03-27 09:03:08 +01: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
Moritz Brückner 05c14238f2 shader.py: add API to set texture params 2021-03-25 23:03:08 +01:00
Moritz Brückner 24093d15df Fix writing to gl_Position before instancing code 2021-03-25 22:02:59 +01:00
Alexander Kleemann 930b2968fa
Include cycles glsl functions for vector rotation 2021-03-24 10:20:05 +01:00
Alexander Kleemann 6e0bfa272c
Remove float parsing 2021-03-24 10:13:46 +01:00
Alexander Kleemann dfe1a49f85 Implement the remaining 16 math node operations
Math node is now fully supported
2021-03-23 22:02:25 +01:00
Alexander Kleemann 0cc2ea4491 Add map range and vector rotate to node parser dictionary 2021-03-23 21:58:46 +01:00
Alexander Kleemann 5c1f8fe128 Implement vector rotate node
Should now be fully supported
2021-03-23 21:56:14 +01:00
Alexander Kleemann 07741abc55 Implement map range node
Map range node should now be fully supported
2021-03-23 21:53:24 +01:00
Alexander Kleemann 362fffa408 Reimplement blackbody node from python to GLSL
Should now work with changing values
2021-03-23 21:51:28 +01:00
Alexander Kleemann eb6d23fab3 Fix material translucency in Blender 2.9+
The extra input node in the principled is now taken into consideration
2021-03-22 20:26:01 +01:00
N8n5h 7463de6140 Add cast_shadow to lightArray data
This was done to undo the hardcoded nature of "receiveShadows", which
doesn't play nice when you have multiple lights of the same type and
one or several have cast_shadow set to false.

By simply "passing" the cast_shadow parameter within the lightArray it
was possible to detect lights that don't cast shadows before actually
wasting gpu cycles to render shadows with garbage data.

Support for deferred desktop and mobile, and forward was added.
2021-03-14 23:20:57 -03:00
N8n5h 72dde10fb0 Fix forward+single atlas failing to compile with just 1 light
This should fix an issue where the uniform for shadowMapAtlas used with the single atlas option was not added when having just 1 light.
2021-03-02 20:20:31 -03:00
Moritz Brückner 742b9ce1e1 Nishita sky: add support for ozone density 2021-02-22 18:52:56 +01:00
Moritz Brückner 92554876f1 Fix nishita sky altitude
The scale was changed in recent Blender builds
2021-02-21 01:12:15 +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 3ef380978e Make sure compiled.inc is always first when parsing shaders for clusters 2021-02-14 20:21:51 -03:00
Lubos Lenco 49a599dc66
Merge pull request #2102 from N8n5h/light-fix-2
Add support for shadow map atlasing
2021-02-14 16:32:59 +01:00
Moritz Brückner 28011bcc00 Nishita sky: add sun disk drawing 2021-02-13 18:23:37 +01:00
Lubos Lenco 726e2fec6d
Merge pull request #2105 from MoritzBrueckner/custom-mat-operator
Add button to create a new custom material
2021-02-13 17:30:54 +01:00
Moritz Brückner 3260e627ce Fix custom material export when scene is exported in arm format
See af247f1876 for reference
2021-02-12 00:31:19 +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 afe133381c Fix normals export of skinned materials 2021-02-03 18:23:22 +01:00
Moritz Brückner 121d449c35 Blender 2.9: Cycles attribute node - support object/custom properties 2021-01-30 14:19:46 +01:00
Moritz Brückner 75bb88831c Blender 2.9: Cycles attribute node - support alpha output and new attribute_type prop 2021-01-30 14:19:46 +01:00
Moritz Brückner 288ead64dc Nishita sky: implement air and dust density 2021-01-21 21:14:05 +01:00
Moritz Brückner 396e60574a Optimize Nishita sky shader 2021-01-21 20:36:03 +01:00
Moritz Brückner 22d3530863 Blender 2.9: Add Nishita sky model implementation 2021-01-21 16:12:32 +01:00
Moritz Brückner cab20d0a64 Principled BSDF: update input socket indices to Blender 2.9 2021-01-04 19:34:42 +01:00
Moritz Brückner 11591c79a4 Cleanup 2020-12-30 01:06:54 +01:00
Moritz Brückner 96dfc06295 Show warnings for invalid instancing configurations 2020-12-30 00:43:46 +01:00
QuantumCoderQC c0bde50306 Fix normals and wposition in custom particle node 2020-12-12 14:10:03 +01:00
Moritz Brückner a1b121a2a7 Add per-material custom UI for drivers 2020-11-17 18:54:53 +01:00
Moritz Brückner ac51183a15 Fix declaration order for some shader attributes 2020-11-12 20:11:42 +01:00