Commit graph

471 commits

Author SHA1 Message Date
Hugo Locurcio
e87ec8ec17
Add Soft Very Low shadow quality mode for 3D
This can be used to improve 3D shadow rendering quality at little
performance cost. Unlike the existing Hard setting which is limited
to variable shadow blur only, it works with both fixed blur and
variable blur.
2021-10-21 18:34:26 +02:00
Yuri Roubinsky
9142df46b3 Fix built-in texture samplers passing for spatial shader mode 2021-10-21 12:32:32 +03:00
Yuri Roubinsky
5a354aaf6d Prevent a rendering crash and error spam for uniform texture array 2021-10-20 21:30:27 +03:00
Rémi Verschelde
244faf5588
Merge pull request #53972 from zedutch/fix-shader-time-update
Fix shaders using `TIME` not continuously updating
2021-10-19 16:37:55 +02:00
Rémi Verschelde
85a8939fa2
Merge pull request #53790 from briansemrau/remove-distant-shadowy-void 2021-10-19 15:17:09 +02:00
Rémi Verschelde
4387f9645b
Merge pull request #52940 from groud/toast_notification 2021-10-19 09:57:13 +02:00
Robin Arys
0e31465a59 Fix shaders that use TIME do not force editor to continuously update 2021-10-18 22:53:20 +02:00
Yuri Roubinsky
26a26d6657 Fix errors on quitting from an empty project 2021-10-18 14:24:03 +03:00
mennomax
b4eeeb315a
Swap args of Plane(point, normal) constructor
Now (normal, point)
2021-10-15 20:49:42 -05:00
Rémi Verschelde
5a276443bd
Merge pull request #53815 from Chaosus/fix_wireframe_render_mode 2021-10-15 16:19:36 +02:00
Yuri Roubinsky
31ad85881d Fix wireframe render mode 2021-10-15 06:53:52 +03:00
Brian Semrau
e9f1b0a0b2 Remove incorrect fog height density remapping 2021-10-14 16:09:45 -04:00
Brian Semrau
4fefd7cddd Fix several issues with directional shadows
- Internally disable blend splits in orthogonal directional shadow mode
- Fix soft shadows ignoring fade and blend_splits
- Fix soft shadow edge stability
2021-10-14 11:44:32 -04:00
Gilles Roudière
0587e5e018 Implement toast notifications in the editor 2021-10-14 13:30:54 +02:00
Brian Semrau
a62e240260 Fix the height fog effect 2021-10-14 04:08:39 -04:00
Yuri Roubinsky
e9b7ffd1fa Added few more built-ins to shader language 2021-10-13 20:27:36 +03:00
Rémi Verschelde
88463c3eee
Merge pull request #53712 from CakHuri/nullptr
Replace NULL with nullptr
2021-10-12 22:30:43 +02:00
M. Huri
033dc4dbef Replaced NULL with nullptr 2021-10-12 20:20:19 +07:00
Aaron Franke
7e51e4cb84
Fix some LGTM errors of "Multiplication result converted to larger type" 2021-10-12 00:17:27 -05:00
Yuri Roubinsky
db2ee03fff Fix shader crash on using METALLIC and ROUGHNESS built-ins in light func 2021-10-11 13:35:53 +03:00
Hugo Locurcio
265bae824f
Remove unimplemented Environment.ambient_light_occlusion_color property
This property was intended to provide a way to have SSAO or VoxelGI
ambient occlusion with a color other than black. However, it was
dropped during the Vulkan renderer development due to the performance
overhead it caused when the feature wasn't used.
2021-10-07 17:47:52 +02:00
Yuri Roubinsky
410cab4c61
Merge pull request #53491 from Chaosus/shader_fix_texture_array_uniforms 2021-10-07 10:00:12 +03:00
Rémi Verschelde
149e10da1c
Merge pull request #53504 from clayjohn/VULKAN-sky-bug
Remove bogus sky error check
2021-10-07 08:09:01 +02:00
Rémi Verschelde
3f94a5ebe7
Merge pull request #51115 from clayjohn/VULKAN-SSAO-radius
Move assignment of SSAO radius push constant
2021-10-07 08:04:17 +02:00
clayjohn
23dc490f40 Remove bogus sky error check 2021-10-06 22:04:56 -07:00
Yuri Roubinsky
b5028da5c0 Fix regression which prevents using texture array uniforms 2021-10-06 22:31:07 +03:00
Yuri Roubinsky
6873ecaaf9 Added support for uniform arrays in shaders 2021-10-04 13:57:44 +03:00
Lightning_A
c63b18507d Use range iterators for Map 2021-09-30 15:09:12 -06:00
Hugo Locurcio
ba65730cbf
Rename RID's getornull() to get_or_null() 2021-09-29 23:58:02 +02:00
Manuel Dun
485eac3d3f radial fog fix 2021-09-29 15:49:59 -04:00
Hendrik Brucker
6a9f3746af Fix editor freeze when asigning Skeleton2D to Polygon2D 2021-09-29 01:50:01 +02:00
Rémi Verschelde
4296539d94
Merge pull request #53072 from CaptainProton42/fix-gpuparticles3d-generate-aabb 2021-09-28 16:20:22 +02:00
Bastiaan Olij
cbdde9dff9 Fix access to render target texture for XR interfaces 2021-09-28 19:46:50 +10:00
CaptainProton42
1731030b3c Fix GPUParticles3D local_coords 2021-09-26 00:30:37 +02:00
CaptainProton42
dd70daafba Fix GPUParticles3D generate AABB 2021-09-26 00:30:37 +02:00
Anilforextra
cdd912c48e Construct values only when necessary. 2021-09-25 14:46:45 +05:45
Anilforextra
cc51b045da Construct values only when necessary. 2021-09-23 22:26:07 +05:45
Anilforextra
90908cd67d Add Get Center Method for Rect2/Rect2i and AABB. 2021-09-21 21:14:17 +05:45
Rémi Verschelde
ec23d1348a
Merge pull request #52409 from GiantBlargg/position-depth-pre-pass 2021-09-17 14:21:29 +02:00
Rémi Verschelde
8ecc571158
Merge pull request #49063 from Calinou/remove-16x-msaa
Remove 16× MSAA support due to driver bugs and low performance
2021-09-13 17:34:04 +02:00
Rémi Verschelde
078bdef7e9
Merge pull request #51939 from clayjohn/VULKAN-horizon-so-fix
Compute horizon SO threshold before transformation
2021-09-13 11:44:42 +02:00
JFonS
5f69218edc
Merge pull request #51604 from TechnoPorg/fix-vulkan-parent-material
Vulkan: Fix CanvasItem::use_parent_material
2021-09-12 01:00:30 +02:00
Lyuma
aca4b737f1 8 uvs for glTF2, URI decode and Vertex Custom api.
Add glTF2 uri decode for paths.

Add vertex custom apis.

Add scene importer api.

Change Color to float; add support for float-based custom channels in SurfaceTool and EditorSceneImporterMesh

Co-authored-by: darth negative hunter
 <thenegativehunter2@users.noreply.github.com>
2021-09-10 09:16:48 -07:00
Juan Linietsky
7c9cdea836
Merge pull request #52476 from Lauson1ex/master
Replace current ACES tonemapper with a high quality one
2021-09-09 19:13:44 -03:00
Juan Linietsky
3c554f09ea
Merge pull request #52252 from Calinou/sdfgi-use-light-indirect-energy
Use the Light3D Indirect Energy property in SDFGI
2021-09-09 17:17:48 -03:00
Endri Lauson
065d13eddc Replace ACES tonemapper with a high quality one 2021-09-07 19:46:02 -03:00
Bastiaan Olij
461d31427c
Merge pull request #52205 from BastiaanOlij/blit_source_rect
Add source rectangle to blit
2021-09-07 09:21:13 +10:00
Daniel Doran
3138b94058 Fix depth pass for shaders that set POSITION 2021-09-05 01:05:42 -06:00
Clay John
036b7a0985
Merge pull request #51873 from Chaosus/fix_uniform_error_spam
Fix incorrect checking of uniform set to prevent error spam (2)
2021-08-31 11:28:48 -07:00
Hugo Locurcio
2c507cd426
Use the Light3D Indirect Energy property in SDFGI
The Indirect Energy property was previously ignored in SDFGI
(unlike VoxelGI).
2021-08-30 14:53:03 +02:00
Bastiaan Olij
fbac863bfb Add source rectangle to blit 2021-08-29 14:57:16 +10:00
K. S. Ernest (iFire) Lee
90a35dac48
Merge pull request #51908 from bruvzg/msdf_fonts2
Make FontData importable resource. Add multi-channel SDF font rendering.
2021-08-27 08:51:37 -07:00
Juan Linietsky
712bcf564f
Merge pull request #52092 from Calinou/voxelgi-remove-anisotropic-leftovers
Remove leftovers of anisotropy in the VoxelGI shader code
2021-08-27 12:22:57 -03:00
bruvzg
4c3f7d1290 Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support.
Adds per-font oversampling support.
Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading.
Adds BMFont binary format and outline support.
2021-08-27 15:43:18 +03:00
Bastiaan Olij
64626cc435 Optionally scale 3D render content 2021-08-26 20:48:40 +10:00
Bastiaan Olij
6e87d62873
Merge pull request #50883 from BastiaanOlij/mobile_hdr
Scale color output in the mobile renderer to provide HDR support
2021-08-26 11:23:22 +10:00
JFonS
c334989e00
Merge pull request #51821 from Calinou/builtin-shaders-add-comments
Add comments at the top of each built-in shader to ease debugging
2021-08-25 11:37:57 +02:00
Hugo Locurcio
6a6c0890c2
Remove leftovers of anisotropy in the VoxelGI shader code
Anisotropy support was removed when VoxelGI was reworked as it was
too demanding on the GPU.
2021-08-25 10:23:28 +02:00
Hugo Locurcio
7192852da3
Remove 16× MSAA support due to driver bugs and low performance
In the `master` branch, 16× MSAA caused the entire system to freeze
on NVIDIA GPUs. This is likely caused by graphics drivers not actually
implementing 16× MSAA, but combining 8× MSAA with 2× SSAA instead.

On top of that, modern shader complexity makes 16× MSAA very difficult
to use while keeping a good framerate. 8× MSAA is hard enough to use
as it is.
2021-08-25 07:56:27 +02:00
Max Hilbrunner
583b6a594a
Merge pull request #51971 from aaronfranke/https
Replace HTTP URLs with HTTPS for sites with HTTPS versions
2021-08-23 15:58:54 +02:00
Michael Alexsander
88db541705
Merge pull request #51947 from AnilBK/redundant-assignments
[cppcheck] Remove some redundant assignments.
2021-08-23 13:23:45 +00:00
Bastiaan Olij
d22163c657 Scale color output in the mobile renderer to provide HDR support 2021-08-23 15:30:36 +10:00
Bastiaan Olij
2d446771d6
Merge pull request #51980 from BastiaanOlij/fix_multiview_tonemap
Fix multiview defines in tonemap shader
2021-08-23 12:02:18 +10:00
Aaron Franke
ae1702bee5
Replace HTTP links with HTTPS for sites with HTTPS versions 2021-08-22 20:13:11 -05:00
Duarte David
7e94c583e0 Fixed non-uniform scaling of normals 2021-08-22 19:28:18 +01:00
Bastiaan Olij
74a647bddd Fix multiview defines in tonemap shader 2021-08-22 21:30:58 +10:00
Anilforextra
c86db8b710 Remove redundant assignments.
Use used_in_transfer instead of used_in_compute twice.
2021-08-21 19:20:07 +05:45
clayjohn
bccc4cd735 Compute horizon so threshold before transformation 2021-08-20 19:27:52 -07:00
jfons
55e7832d7b Improvements to SpotLight3D and OmniLight3D's shadows
OmniLight3D:
* Fixed lack of precision in cube map mode by scaling the projection's
  znear.
* Fixed aliasing issues by making the paraboloids use two square regions instead of two half
  squares.
* Fixed shadowmap atlas bleeding by adding padding.
* Fixed sihadow blur's inconsistent radius and unclamped sampling.

SpotLight3D:
* Fixed lack of precision by scaling the projection's znear.
* Fixed normal biasing.

Both:
* Tweaked biasing to make sure it works out of the box in most situations.
2021-08-19 13:46:51 +02:00
Yuri Roubinsky
b6af457d25 Fix incorrect checking of uniform set to prevent error spam (2) 2021-08-19 09:11:01 +03:00
reduz
700f9d916d More fixes to mobile renderer
* Specify all precision qualifiers
* Makes renderer work on Adreno Vulkan
2021-08-18 12:20:19 -03:00
Hugo Locurcio
a139e58f8c
Add comments at the top of each built-in shader to ease debugging
When a shader error is printed about a built-in shader, the origin
of the shader will now be recognizable immediately by looking at
the top of the printed shader code.
2021-08-18 03:09:22 +02:00
reduz
6027cd0a1d Fixes to mobile renderer
* Make sure shaders are named, to aid in debug in case of failure
* SceneRenderRD was being wrongly initialized (virtual functions being called when derivative class not initialized).
* Fixed some bugs resulting on the above being corrected.
2021-08-17 13:52:06 -03:00
TechnoPorg
b097e7f510 Vulkan: Fix CanvasItem::use_parent_material
The "Use Parent Material" option now does something when enabled on a CanvasItem. As before, it's not just limited to a node's direct parent but can move up the tree until it finds a material.
Also corrected a typo in rendering_device_vulkan.h that didn't merit its own commit.
2021-08-17 09:08:56 -06:00
Yuri Roubinsky
06add309d7 Fix incorrect uniform buffer size for particles 2021-08-17 13:33:28 +03:00
Juan Linietsky
d5a30431b9
Merge pull request #51635 from reduz/further-mobile-optimizations
More optimizations on the mobile renderer.
2021-08-16 14:50:52 -03:00
Yuri Roubinsky
9de779344c Makes a clear error message if shader compilation failed 2021-08-16 11:25:20 +03:00
Bastiaan Olij
c7847b3f6d Moved disabling bokeh shader variants to before the version_create call 2021-08-16 12:18:27 +10:00
Bastiaan Olij
4002650cb9 Fix read from screen and depth texture 2021-08-15 13:14:19 +10:00
Rémi Verschelde
4e1d91f4d3
Merge pull request #50998 from BastiaanOlij/single_bokeh_dof_raster
Rewrote raster DOF shader to using BOKEH
2021-08-14 14:44:23 +02:00
reduz
cfac8972e1 More optimizations on the mobile renderer.
* Specialization constants used to disable anything not needed to draw
* Added softshadow and projector support on mobile.

This new approach ensures mobile shaders are smaller and more efficient, but relies on more pipeline versions compiled on demand.
As a result, random stalls can ocur like in Godot 3.x. These will be solved by using background compilation and fallbacks eventually (but needs to be tested first).
2021-08-13 14:30:59 -03:00
Rémi Verschelde
e499758a77
Merge pull request #51025 from reduz/fix-directional-shadow-bias
Fix directional shadow bias
2021-08-13 16:45:49 +02:00
Yuri Roubinsky
eadf9d92f9
Merge pull request #51609 from Chaosus/shader_fix_varying_error
Fix shader crash when using local var with the same name as varying
2021-08-13 10:37:53 +03:00
Yuri Roubinsky
fa96c98bdf Fix shader crash when using local var with the same name as varying 2021-08-13 09:20:16 +03:00
Bastiaan Olij
07fd559478 Implemented raster versions of bokeh shaders to replace broken gaussian implementation 2021-08-13 10:20:14 +10:00
Rémi Verschelde
56ac302dc4
Merge pull request #51580 from aaronfranke/particles-real-double
Use real_t and double where appropriate in Particles
2021-08-12 20:51:21 +02:00
Aaron Franke
03e2544d50
Use real_t and double where appropriate in Particles 2021-08-12 11:35:31 -05:00
Hugo Locurcio
fd29432aab
Use nearest mipmaps for both minification and magnification
This is generally the expected behavior when using a nearest + mipmaps
mode, as it's often used for pixel art games.
2021-08-12 18:24:10 +02:00
Yuri Roubinsky
63c7d5c330 Removes an internal error report if shader fails compile 2021-08-12 10:18:18 +03:00
Rémi Verschelde
e2ca1d413e
Merge pull request #51533 from Calinou/fix-nearest-mipmap-filter
Fix the Use Nearest Mipmap Filter project setting not working
2021-08-12 08:16:46 +02:00
floppyhammer
37230dbb1f Fix CPUParticles2D disappearance after amount change 2021-08-12 10:53:37 +08:00
Hugo Locurcio
635f6cdf2e
Fix the Use Nearest Mipmap Filter project setting not working
The project setting wasn't being used anywhere.

This also tweaks the property hints to denote that these properties
are only effective after a restart.
2021-08-12 01:58:42 +02:00
Rémi Verschelde
62047e4e48
Merge pull request #51486 from reduz/fixes-to-mobile-renderer
Fixes and optimizations to mobile renderer
2021-08-11 15:19:11 +02:00
clayjohn
a7c3e0dcd6 Use f0 instead of albedo in blinn and phong 2021-08-10 21:54:24 -07:00
reduz
ca117910da Fixes and optimizations to mobile renderer
* Only apply final actions to attachments used in the last pass.
* Fixes to draw list final action (was using continue instead of read/drop).
* Profiling regions inside draw lists now properly throw errors.
* Ability to enable gpu profile printing from project settings. (used to debug).
2021-08-10 23:17:28 -03:00
Rémi Verschelde
afb40920fe
Merge pull request #51411 from clayjohn/VULKAN-blinn-phong
[4.0] Make Blinn and Phong specular modes take albedo into account
2021-08-10 21:11:48 +02:00
Rémi Verschelde
16d73fefdb
Merge pull request #50682 from aaronfranke/basis-looking-at
Move code for looking_at to Basis
2021-08-10 11:28:12 +02:00
Rémi Verschelde
51b4df72a7
Merge pull request #51436 from Calinou/tonemap-clamp-negative-colors
Clamp negative colors regardless of the tonemapper to avoid artifacts
2021-08-10 09:56:11 +02:00
Rémi Verschelde
56f17d925f
Merge pull request #51417 from clayjohn/Vulkan-horizon-so
Add horizon specular occlusion
2021-08-10 09:56:02 +02:00
clayjohn
fa962ff27d Make Blinn and Phong specular modes PBR 2021-08-09 20:09:00 -07:00
Aaron Franke
84f720966c
Use doubles for time in many other places 2021-08-09 14:05:42 -05:00
Hugo Locurcio
57451f132f
Clamp negative colors regardless of the tonemapper to avoid artifacts
Color artifacts could be visible when using negative lights with the
Filmic and ACES tonemapping operators, as these did not clamp negative
colors.
2021-08-09 17:01:07 +02:00
Rémi Verschelde
0a38d5c8f7
Merge pull request #43158 from nathanfranke/fix-gradient-and-draw-tile
Fix Gradient and Color Picker checkerboard, Fix tile parameter for CanvasItem.draw_texture_rect
2021-08-09 16:47:58 +02:00
Rémi Verschelde
85399a9170
Merge pull request #51155 from Chaosus/shader_fix_specular_mode
Fix a default shader specular render mode to `SCHLICK_GGX`
2021-08-09 08:13:47 +02:00
clayjohn
7bdea93497 Add horizon specular occlusion 2021-08-08 19:43:48 -07:00
Nathan Franke
051234e84e
Fix Gradient, Color Picker BG, Fix CanvasItem::draw_texture_rect p_tile 2021-08-07 16:40:50 -05:00
Rémi Verschelde
da339f8ffc
Merge pull request #51309 from Chaosus/fix_uniform_error_spam
Fix incorrect checking of uniform set to prevent error spam
2021-08-06 17:15:03 +02:00
Bastiaan Olij
b920bf05a4 Use subpasses to do 3D rendering and resolve in mobile renderer 2021-08-06 23:43:26 +10:00
Yuri Roubinsky
47a6bb2f28 Fix a default shader specular render mode to (SCHLICK_GGX/BLINN) 2021-08-06 16:01:58 +03:00
Yuri Roubinsky
ac4406cfbe Fix incorrect checking of uniform set to prevent error spam 2021-08-06 12:20:12 +03:00
Rémi Verschelde
dbd1a90bd4
Merge pull request #50942 from BastiaanOlij/cubemap_raster
Porting cubemap compute shaders to raster for the mobile renderer
2021-08-01 21:52:24 +02:00
Aaron Franke
9f3ae0adcd
Move code for looking_at to Basis 2021-08-01 12:49:02 -05:00
Bastiaan Olij
c76426527b Porting cubemap compute shaders to raster for the mobile renderer 2021-08-01 21:22:38 +10:00
clayjohn
b020ca32b2 Move assignment of SSAO radius push constant 2021-07-31 12:31:14 -07:00
Rafał Mikrut
e8877806ec Fix 'Attempted to remove invalid ID' errors 2021-07-31 15:30:31 +02:00
reduz
55d357b1eb Fix directional shadow bias
* Simplified code a lot, bias based on normalized cascade size.
* Lets scale cascades, max distance, etc. without creating acne.
* Fixed normal biasing in directional shadows.

I removed normal biasing in both omni and spot shadows, since the technique can't be easily implemented there.
Will need to be replaced by something else.
2021-07-29 13:51:32 -03:00
Hugo Locurcio
e6a544c169
Merge pull request #50891 from Vitika9/50852
Removed redundant assignment of `blur_pipeline`
2021-07-26 21:43:38 +02:00
Rémi Verschelde
8f6c16e4a4
Merge pull request #50847 from reduz/implement-binary-shader-compilation
Implement Binary Shader Compilation
2021-07-26 17:09:48 +02:00
vitika9
1c63866996 Fixed coding style 2021-07-26 20:12:16 +05:30
Nicholas Huelin
7f908cf40f
Fix expression in cluster_builder_rd.h
This expression should now work as intended.
2021-07-26 08:19:53 -04:00
reduz
cf3f404d31 Implement Binary Shader Compilation
* Added an extra stage before compiling shader, which is generating a binary blob.
* On Vulkan, this allows caching the SPIRV reflection information, which is expensive to parse.
* On other (future) RenderingDevices, it allows caching converted binary data, such as DXIL or MSL.

This PR makes the shader cache include the reflection information, hence editor startup times are significantly improved.
I tested this well and it appears to work, and I added a lot of consistency checks, but because it includes writing and reading binary information, rare bugs may pop up, so be aware.
There was not much of a choice for storing the reflection information, given shaders can be a lot, take a lot of space and take time to parse.
2021-07-26 08:40:39 -03:00
Rémi Verschelde
7341dd5afa
Merge pull request #50856 from SirQuartz/patch-32
Fix always true expression `radius > 0.98 || radius < 1.02` in `cluster_builder_rd.h`
2021-07-26 08:47:33 +02:00
Nicholas Huelin
a1a392045d
Fix always true expression in cluster_builder_rd.h
This pull request fixes an issue where an expression would always evaluate to `true` no matter what.
2021-07-25 11:53:04 -04:00
luz paz
5cf3bed0c8 Fix various typos
Follow-up typos found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 07:18:25 -04:00
Rémi Verschelde
ff0b5f8fa1
Merge pull request #50809 from akien-mga/iterators-const-references 2021-07-25 12:52:58 +02:00
Rémi Verschelde
2f221e5fd5
Merge pull request #50250 from luzpaz/typos
Fix various typos
2021-07-25 12:38:58 +02:00
Rémi Verschelde
ac3322b0af
Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
Rémi Verschelde
2a8a59eac0
Merge pull request #50644 from BastiaanOlij/mobile_compute_to_fragment 2021-07-25 11:58:11 +02:00
luz paz
3564c16cb8
Fix various typos with codespell
Found via `codespell -q 3 -S ./thirdparty,*.po,./DONORS.md -L ackward,ang,ans,ba,beng,cas,childs,childrens,dof,doubleclick,fave,findn,hist,inout,leapyear,lod,nd,numer,ois,ony,paket,seeked,sinc,switchs,te,uint`
2021-07-25 11:21:51 +02:00
Bastiaan Olij
1f69582835 Use fragment shader instead of compute shader for effects for mobile renderer 2021-07-25 13:58:21 +10:00
Aaron Franke
4e6efd1b07
Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
Rémi Verschelde
fa56989818
Merge pull request #50537 from Calinou/improve-shader-error-output-2
Add error marking to the shader error console output
2021-07-20 11:00:17 +02:00
Rémi Verschelde
394191c02f
Merge pull request #50605 from Calinou/tweak-shader-code-style
Use C++11 raw literals for shader code to improve readability
2021-07-20 10:05:13 +02:00
reduz
9293bc3935 Implement more rendering options as specialization constants
* Shadow quality settings now specialization constant.
* Decal and light projector filters can be set.
* Changing those settings forces re-creation of the pipelines.

These changes should help improve performance related to shadow mapping, and allows improving performance by sacrificing decal and light projector quality.
2021-07-19 21:51:29 -03:00
Hugo Locurcio
abc38b8d66
Use C++11 raw literals for shader code to improve readability
In files that have lots of branching, `\t` was replaced with a
tab character instead.
2021-07-19 08:19:50 +02:00
Hugo Locurcio
9fc2849a57
Add error marking to the shader error console output
This makes it possible to see where the shader error is without
having to look at the trace printed below the source code.
2021-07-17 03:05:11 +02:00
reduz
76e25438c9 Fixes to forward mobile
* use valid format for framebuffer: VK_FORMAT_A2B10G10R10_UNORM_PACK32
* Unfortunately cant be used for compute.
* Mobile will need to do refprobe, sky, mipmapblurring using raster.
2021-07-15 21:05:58 -03:00
Juan Linietsky
3f12765a7e
Merge pull request #49678 from BastiaanOlij/mobile_renderer_select_color_format
Use 32bit instead of 64bit 3D render buffer on mobile renderer
2021-07-15 10:16:39 -03:00
Yuri Roubinsky
d6dc77aa36 Removes lines about window size from the console output 2021-07-14 20:58:53 +03:00
Bastiaan Olij
8a29208fc4 Use 32bit instead of 64bit 3D render buffer on mobile 2021-07-13 10:26:28 +10:00
reduz
ad9f606ed8 Use specialization constants in clustered renderer
* Keep track of when projector, softshadow or directional sofshadow were enabled.
* Enable them via specializaton constant where it makes sense.
* Re-implements soft shadows.
* Re-implements light projectors.
2021-07-12 20:33:52 -03:00
Rémi Verschelde
b218c6785e
Merge pull request #50194 from BastiaanOlij/fix_multiple_reflection_probes
Fix indexing of multiple reflection probes
2021-07-12 19:22:47 +02:00
reduz
83addd6ee5 Fix material invalidation on reimport.
* IF a texture was reimported (calling replace as an example), it would invalidate all materials using it, causing plenty of errors.
* Added the possibility to get a notification when a uniform set is erased.
* With this notification, materials can be queued for update properly.
2021-07-07 19:55:20 -03:00
reduz
24efb13f7e Fix threaded update for textures
* Previews and other stuff now works again.
* Not the best solution, will have to be improved in the future usinc async queues where supported.
2021-07-07 18:06:06 -03:00
Rémi Verschelde
48a5226829
Merge pull request #50193 from reduz/fix-command-queue-crash
Fix Command Queue Crash
2021-07-07 16:36:13 +02:00
reduz
d41e3f9aeb Fix Command Queue Crash
* No longer allow sending an object (texture) to the server as material parameter
* Keep a parameter cache locally in ShaderMaterial
2021-07-07 10:57:56 -03:00
reduz
c43f624d44 Unify material parameter update
* Unifies how material parameters are updated.
* Single function, easier to maintain.
* Updates materials properly when textures change.
2021-07-06 18:57:38 -03:00
Bastiaan Olij
b3612351a8 Fix indexing of multiple reflection probes 2021-07-06 13:00:33 +10:00
reduz
7f6027927a Fix Subsurface Scattering
* Works again
* Transmittance also works again
* Removed the curve patamter, exp() function is good enough.
2021-07-05 17:17:45 -03:00
Daniel Doran
82bb8f1531 Fix transparency sorting 2021-07-05 03:19:42 -06:00
Rémi Verschelde
5c3055e0fe
Merge pull request #50137 from reduz/fix-boot-splash
Fix Boot Splash
2021-07-04 09:40:36 +02:00
Rémi Verschelde
67c08e27a5
Merge pull request #50138 from Calinou/debug-overdraw-lower-opacity
Decrease opacity of the overdraw debug draw mode
2021-07-04 09:39:36 +02:00
Rémi Verschelde
8838e3d3d4
Merge pull request #50144 from reduz/fix-ssr
Fix SSR
2021-07-04 09:20:22 +02:00
reduz
0e366dc7ac Fix SSR
* Was broken at some point long time ago, this restores it.
2021-07-03 23:32:34 -03:00
reduz
ab3314e955 Fix SDFGI
* Broken by 7513b73902, fixes #49631
2021-07-03 21:24:37 -03:00
Hugo Locurcio
27aa8dc68e
Decrease opacity of the overdraw debug draw mode
This allows distinguishing higher amounts of overlapping objects.
2021-07-04 00:19:14 +02:00
reduz
6e1c5e346a Fix Boot Splash
* Implements the code to show the boot splash on load using RenderingDevice
* Does not work on X11 when maximized, some platform specific hack will be needed there.
2021-07-03 18:09:19 -03:00
reduz
fe17a6c907 Fix render debug modes.
* Ovedraw debug works again
* Lighting debug works again
2021-07-03 14:50:36 -03:00
reduz
6c55d2aad2 Fix Render Info
* Fixed and redone the process to obtain render information from a viewport
* Some stats, such as material changes are too difficult to guess on Vulkan, were removed.
* Separated visible and shadow stats, which causes confusion.
* Texture, buffer and general video memory can be queried now.
* Fixed the performance metrics too.
2021-07-03 10:15:04 -03:00
Bastiaan Olij
e86aeb85ce Properly override virtual functions in render_scene_render_rd and subclasses 2021-07-03 20:32:40 +10:00
Hugo Locurcio
5370f4876e
Remove leftovers from the DirectionalLight3D Optimized shadow depth range
The Optimized shadow depth range was removed in late 2020 in favor
of the Stable shadow depth range, but it still had a (broken) property
that allowed to enable it.
2021-07-02 20:32:43 +02:00
reduz
8cf812fba1 Fix surface from array creation
* The debug check was not updated to the new format.
* Bug introduced by #50037
2021-07-01 16:51:55 -03:00
Rémi Verschelde
ad8a2b3d52
Merge pull request #50040 from reduz/fix-renderingserver-bindings
Clean up RenderingServer and its bindings
2021-07-01 15:17:33 +02:00
reduz
37776b2867 Clean up RenderingServer and its bindings
* Rewrote bindings for RenderingServer.
* They are now all up to date.
* Several unused methods and deprecated features were cleaned up.
2021-07-01 09:07:36 -03:00
reduz
9ad0c6cde7 Import mesh colors in 8BPP.
* Colors were imported as 16BPP (half float)
* Far most common use cases only require 8BPP
* If you need higher data precision, use a custom array, which are supported now.

**WARNING**: 3D Scenes imported in 4.0 no longer compatible with this new format. You need to re-import them (erase them from .godot/import)
2021-06-30 23:33:25 -03:00
reduz
85cf99f28e Deprecate ImmediateGeometry
* Removed entirely from RenderingServer.
* Replaced by ImmediateMesh resource.
* ImmediateMesh replaces ImmediateGeometry, but could use more optimization in the future.
* Sprite3D and AnimatedSprite3D work again, ported from Godot 3.x (though a lot of work was needed to adapt them to Godot 4).
* RootMotionView works again.
* Polygon3D editor works again.
2021-06-30 14:14:41 -03:00
reduz
64c925cca6 Improve RID_Owner memory usage
* Ability to allocate empty objects in RID_Owner, so RID_PtrOwner is not needed in most cases.
* Improves cache usage, as objects are now allocated together
* Should improve performance in 2D rendering
2021-06-29 12:28:08 -03:00
reduz
d55ebc3a5d Fix non uniform scaling in 3D objects
* Flag was there, but not implemented.
* Fixed issue with base flags not being initialized.
2021-06-29 11:45:59 -03:00
Bastiaan Olij
a9604b425f Move render_sky logic from effects into our sky object, and some minor cleanup 2021-06-26 18:46:47 +10:00
Rémi Verschelde
e4430771db
Merge pull request #49885 from reduz/implement-render-pass-support
Implement Framebuffer Subpass support
2021-06-25 15:00:01 +02:00
reduz
bde6f5eed1 Implement Framebuffer Subpass support
* Required for better optimizing mobile platforms
* Will be used by the Vulkan mobile renderer.
2021-06-24 15:59:15 -03:00
Rémi Verschelde
a01ea509f5
Merge pull request #49826 from groud/fix_mesh_transform
Keep the drawing transform when drawing meshing in CanvasItem
2021-06-24 19:38:56 +02:00
Gilles Roudière
ccbf31685d Fixes Mesh2D drawn without modulation 2021-06-23 17:38:31 +02:00
Gilles Roudière
e8476c994d Keep the drawing transform when drawing meshing in CanvasItem 2021-06-22 11:41:28 +02:00
Lightning_A
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
reduz
94d31ac327 Implement animation slice drawing in CanvasItem
* Added a function to ignore subsequent commands if they don't fall within the slice.
* This will be used by the new TileMap to properly provide animated tiles.
2021-06-17 12:42:27 -03:00
reduz
6e98c4cd50 Refactor VisibilityNotifier3D
* This is the 3D counterpart to #49632
* Implemented a bit different as 3D works using instancing

After merged, both 2D and 3D classes will most likely be renamed in a separate PR to DisplayNotifier2D/3D.
2021-06-16 18:50:39 -03:00
Rémi Verschelde
c2ba45fcc8
Merge pull request #49630 from kodiwills/fix-custom-irradiance-typo
Fix typo in `CUSTOM_IRRADIANCE` calculations
2021-06-15 22:37:54 +02:00
Kodi
69e1f25299 Fix typo in CUSTOM_IRRADIANCE calculations 2021-06-15 15:17:00 -04:00
Rémi Verschelde
ec323f0ef4
Merge pull request #49584 from timothyqiu/shader-data-null-check
Add missing null check for ShaderData
2021-06-14 19:18:20 +02:00
Rémi Verschelde
3f613236e0
Merge pull request #49576 from clayjohn/VULKAN-SSAO-uniform-sets
Store SSAO uniform sets per viewport
2021-06-14 19:05:19 +02:00
Rémi Verschelde
0610c559ec
Merge pull request #49585 from timothyqiu/oh-unsigned
Fix invalid read when using MultiMesh
2021-06-14 18:35:36 +02:00
Haoyu Qiu
1b122345c2 Fix invalid read when using MultiMesh 2021-06-14 13:19:40 +08:00
Haoyu Qiu
fa907ce829 Add missing null check for ShaderData 2021-06-14 13:00:35 +08:00
Bastiaan Olij
3eae812331 Fixed error spam when XR mode is not enabled and a missed setting rename 2021-06-14 11:05:16 +10:00
clayjohn
fc93e10092 Store SSAO uniform sets per viewport 2021-06-13 10:42:10 -07:00
Bastiaan Olij
15c1a76361 Add stereoscopic rendering through multiview 2021-06-13 22:52:20 +10:00
reduz
ce783689f8 Make shader compiler again after roughness limiter fix
Fix shader compilation error after merging #49549
2021-06-12 21:40:51 -03:00
Juan Linietsky
bb94344937
Merge pull request #49549 from clayjohn/VULKAN-roughness-limiter
Fix roughness limiter derivative
2021-06-12 21:29:34 -03:00
clayjohn
9a5e00be6f Fix roughness limiter derivative 2021-06-12 17:02:05 -07:00
reduz
7513b73902 Fix VoxelGI (works again).
It was broken due to #46046, this makes it work again.
2021-06-12 20:37:56 -03:00
Rémi Verschelde
2787ee634a
Merge pull request #49520 from pfertyk/issue-46278-empty-texture-crashes-godot
Validate texture in RendererStorageRD::free
2021-06-12 22:27:14 +02:00
Paweł Fertyk
31cd42373b Validate texture in RendererStorageRD::free 2021-06-11 20:12:23 +02:00
Rémi Verschelde
9e328bb5b7
Core: Move DirAccess and FileAccess to core/io
File handling APIs are typically considered part of I/O, and we did have most
`FileAccess` implementations in `core/io` already.
2021-06-11 14:52:39 +02:00
Yuri Roubinsky
5d5400a3b1 Fix shader compilation with render_mode: specular_phong 2021-06-09 08:38:03 +03:00
Yuri Roubinsky
4daca0b580 Removes deleted OrenNayar mode from shaders and materials 2021-06-08 15:50:40 +03:00
reduz
32625145c8 Rename GI Classes
* GIProbe is now VoxelGI
* BakedLightmap is now LightmapGI

As godot adds more ways to provide GI (as an example, SDFGI in 4.0), the different techniques (which have different pros/cons) need to be properly named to avoid confusion.
2021-06-05 09:28:56 -03:00
Marcel Admiraal
8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Aaron Franke
de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
reduz
0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00