Commit graph

2490 commits

Author SHA1 Message Date
Hugo Locurcio
31ad99072f
Allow changing directional shadow size at run-time
Factoring out the directional shadow creation code allows calling it
at any time. This works in both GLES3 and GLES2.
2021-10-23 22:04:59 +02:00
Omar El Sheikh
b679594eac Fix CSGPolygon Buffer Overflow
Immediate meshes do not have geometry of type Surface so we check
to see the mesh isn't immediate before trying to cast to surface
to check for octahedral compression
2021-10-18 11:39:54 -04:00
clayjohn
a4e8ba8cfd Only add emission on base pass in GLES3 2021-10-17 15:58:57 -07:00
Hugo Locurcio
cc823bc5b3
Remove unused built-in GLES2 shaders
These shaders were never compiled in the Godot binary, so the binary
size remains identical.
2021-10-15 17:41:31 +02:00
Rémi Verschelde
6fb7f18e35
Merge pull request #53740 from clktmr/gles2-multiple-refprobes 2021-10-13 12:42:23 +02:00
Timur Celik
e230bc6caa Fix flipped interior option for second refprobe
This patch fixes rendering of multiple reflection probes for a single
mesh in the GLES2 renderer.  If there were two reflection probes, one of
them would always have the `interior` option flipped, resulting in
broken blending between probes and flickering of ambient reflection.

Also make note of GLES2 reflection probe limit
2021-10-13 10:04:48 +02:00
Hugo Locurcio
2826bec5d4
Fix lights flickering in GLES3 when new light attenuation is disabled
Co-authored-by: Clay John <claynjohn@gmail.com>
2021-10-12 21:59:23 +02:00
Rémi Verschelde
302ad4e600
Merge pull request #52918 from Calinou/add-new-light-attenuation-3.x 2021-10-08 23:08:49 +02:00
Hugo Locurcio
85e080fcc0
Backport new 3D point light attenuation as an option
This provides more realistic lighting with a very small performance cost.
The option is available in both GLES3 and GLES2, and can be enabled in
the Project Settings. This goes well with the ACES Fitted tonemapping mode
that was recently added.

When enabled, this also makes upgrading Godot 3.x projects to Godot 4.0 easier,
since lighting in 3.x will better match how it'll look in Godot 4.0.
2021-10-08 22:15:22 +02:00
Rémi Verschelde
06fc2378de
Merge pull request #51491 from Calinou/glow-add-high-quality-mode-3.x
Add high quality glow mode (3.x)
2021-10-08 07:47:07 +02:00
lawnjelly
192ec963ae Create 'rendering/misc' project settings section
To prevent the project settings `rendering` section getting out of hand, this PR moves some of the smaller new settings into a `misc` category.
2021-10-05 11:47:03 +01:00
Rémi Verschelde
d01c660954
Merge pull request #52964 from Pineapple/WIN32_LEAN_AND_MEAN 2021-10-05 12:03:52 +02:00
Rémi Verschelde
d82c75adca
Merge pull request #53393 from lawnjelly/dev_asserts 2021-10-05 11:25:24 +02:00
Rémi Verschelde
37847eb94d
Merge pull request #53369 from RandomShaper/fix_shader_state_3.x
[3.x] Reset scene conditionals assumed to be false
2021-10-04 17:31:25 +02:00
lawnjelly
c835f1f3c5 Add DEV_ASSERT and DEV_CHECK macros
Change the existing DEV_ASSERT function to be switched on and off by the DEV_ENABLED define. DEV_ASSERT breaks into the debugger as soon as hit.
Add error macros DEV_CHECK and DEV_CHECK_ONCE to add an alternative check that ERR_PRINT when a condition fails, again only enabled in DEV_ENABLED builds.
2021-10-04 14:57:54 +01:00
Robbie Cooper
761c915070
Fix file panel renaming unable to change the case of dirs on Windows
Tested on Windows 10.

(cherry picked from commit 85e99460b4)
2021-10-04 15:22:03 +02:00
Pedro J. Estébanez
6a4c2c1c13 Reset scene conditionals assumed to be false 2021-10-04 00:13:59 +02:00
Rémi Verschelde
6bdd84b8d5
Fix -Wextra warnings from GCC 11 2021-09-29 15:23:12 +02:00
Bartłomiej T. Listwon
f463e612a1 Add missing WIN32_LEAN_AND_MEAN 2021-09-23 10:36:31 +02:00
Rémi Verschelde
b37776fa2f
Merge pull request #52591 from timothyqiu/error-macros
[3.x] Remove do{ } while(0) wrapper around error macros
2021-09-21 10:38:34 +02:00
Rémi Verschelde
1ceba6e1b0
Merge pull request #52585 from Calinou/screen-texture-improve-no-sampling-error 2021-09-20 16:25:16 +02:00
Rémi Verschelde
8a211219c7
Merge pull request #52243 from Pineapple/fix-light-internal
Fix Light2D UBO initialization
2021-09-14 14:21:22 +02:00
Rémi Verschelde
37fab65e00
Merge pull request #52477 from Lauson1ex/3.x
Add a new high quality tonemapper: ACES Fitted (3.x)
2021-09-13 17:37:22 +02:00
Rémi Verschelde
600f2a8d5d
Merge pull request #51927 from 20kdc/issue-51897-sp1
Fix issue #51897 (horizon occlusion causing black blob), fix ver. SP1
2021-09-13 11:44:55 +02:00
Haoyu Qiu
70853fd669 Remove do{ } while(0) wrapper around error macros 2021-09-12 15:04:53 +08:00
Hugo Locurcio
1c63e335b3
Improve the error message about SCREEN_TEXTURE being unavailable
This also tweaks the Viewport `usage` property hint to match the
project setting used for the root viewport.
2021-09-11 23:17:07 +02:00
Endri Lauson
077083938e Add a new high quality tonemapper: ACES Fitted 2021-09-08 19:12:09 -03:00
Bartłomiej T. Listwon
350573a4df Fix buffer creation in light_internal_create() 2021-08-31 08:33:43 +02:00
Clay John
46ad2560a1
Merge pull request #51780 from BastiaanOlij/output_linear_gles2
Convert output of GLES2 to linear color space
2021-08-25 22:22:05 -03:00
Bastiaan Olij
73722f3c65 Convert output of GLES2 to linear color space if keep_3d_linear is enabled 2021-08-23 15:59:56 +10:00
clayjohn
987aef4e0d Properly clear cubemap filter state when texture array environment disabled 2021-08-20 19:12:38 -07:00
20kdc
324c487c63 Fix issue #51897 (horizon occlusion causing black blob), fix ver. SP1
No, not service pack 1. Removes comments from the original fix commit.
2021-08-20 19:04:27 +01:00
Hugo Locurcio
663af7ff03
Fix tonemap exposure not being taken into account by sharpening
The same fix as FXAA was applied to the CAS filter.
2021-08-18 16:44:41 +02:00
Rémi Verschelde
1de8f31448
CI: Upgrade Emscripten to 2.0.25
That's the version used by current containers for Godot 3.4.

Fixes a couple stray warnings that new Emscripten/LLVM catches.
2021-08-18 11:13:34 +02:00
Rémi Verschelde
92a7ae022d
Merge pull request #51769 from The-O-King/oct_split_stream_fix
Fix Octahedral/Split Stream Options
2021-08-18 08:01:56 +02:00
Omar El Sheikh
a63028e172 Fix Octahedral/Split Stream Options
Update mesh_surface_get_format_stride and
mesh_surface_make_offsets_from_format to return an array of offsets and
an array of strides in order to support vertex stream splitting

Update _get_array_from_surface to also support vertex stream splitting

Add a condition on split stream usage to ensure it does not get used on
dynamic meshes

Handle case when Tangent is compressed but Normal is not compressed

Make stream splitting option require a restart in the settings

Update SoftBody and Sprite3D to support and use strides and offsets
returned by updated visual_server functions

Update Sprite3D to use the dynamic mesh flag
2021-08-17 16:11:47 -04:00
clayjohn
8ac85e6a9e Normalize the results of octahedral decompression 2021-08-16 22:17:38 -07:00
Rémi Verschelde
51dd4d0c6c
Merge pull request #49509 from Chaosus/shader_time_3.x 2021-08-16 19:42:55 +02:00
Rémi Verschelde
33c9dd8845
Merge pull request #51363 from parulina/gles2-blendshapes-perf 2021-08-16 08:42:14 +02:00
paru
ab21a3b8fb Performance improvements for GLES2 CPU blendshapes 2021-08-16 08:22:45 +02:00
clayjohn
81dc6a7688 Define normal_attrib when not using octahedral compression in GLES3 2021-08-15 22:27:46 -07:00
Yuri Roubinsky
8a1c986455 [3.x] Fix shader crash when using local var with the same name as varying 2021-08-13 09:30:35 +03:00
Rémi Verschelde
d2a70532e8
FileAccessWindows: Add missing share.h include
Follow-up to #51430.

(cherry picked from commit cb52f2c9c0)
2021-08-12 16:42:17 +02:00
Max Hilbrunner
8dcc764e5a
Fix Windows platform file access
This restores Windows platform file handling back to open files non-exlusively by default, as was the case before October 2018. (See b902a2f2a7)
Back then, while fixing warnings for MSVC, the function used for opening files was changed from _wfopen() to _wfopen_s() as suggsted by the warning C4996. ("This function may be unsafe, consider using _wfopen_s instead.")

This new function
1. did parameter validation and thus avoided some possible security issues due to nil pointers or wrongly terminated strings
2. it also changed the default file sharing for opened files from _SH_DENYNO (which was the implicit default for the previous _wfopen()) to _SH_SECURE.

_SH_DENYNO means every opened file could be opened by other calls (like is the default on other operating systems).
_SH_SECURE means if the file is opened with READ access, others can still read the same file, but if it is opened with WRITE access, others can't open it at all, not even to read.

This led to rarely occuring bugs on Windows, i.e. due to random access by Antivirus processes, or Godot/Windows not closing a file handle fast enough while trying to open it again elsewhere (i.e. project.godot, instead showing the Project manager, or saving shaders/debugging the game).

What this PR does it change the file access to a third method, _wfsopen(). This is still secure, doing parameter validation and thus avoids the warning, but it allows us to actually SET the file sharing parameter. And we set it to _SH_DENYNO, as it was implicitely before the change. (And as it currently is on all non-Windows platforms, where file sharing restrictions don't exist by default.)

Warning C4996 should really have been pointing this out. It should've been _wfsopen() all along. Let's hope this banishes those annoying, rare errors for all eternity.

Fixes #28036.

(cherry picked from commit b48cbb5da9)
2021-08-12 16:42:17 +02:00
Rémi Verschelde
9e3e7b03e4
Merge pull request #51376 from The-O-King/vertex_buffer_alignment
Align Vertex Buffer to 4 Bytes
2021-08-12 07:13:45 +02:00
Hugo Locurcio
0e0af7fa83
Add high quality glow mode
This backports the high quality glow mode from the `master` branch.

Previously, during downsample, every second row was ignored.
Now, when high-quality is used, we sample two rows at once to ensure
that no pixel is missed. It is slower, but looks much better and has
a much high stability while moving.

High quality also takes an additional horizontal sample the width of the
horizontal blur matches the height of the vertical blur.
2021-08-11 17:00:41 +02:00
Rémi Verschelde
7c6bdea33c
Merge pull request #47416 from Calinou/add-contrast-adaptive-sharpening-3.x
Add support for contrast-adaptive sharpening in 3D (GLES3 only)
2021-08-10 10:08:24 +02:00
Rémi Verschelde
5116855637
Merge pull request #51439 from Calinou/tonemap-clamp-negative-colors-3.x
Clamp negative colors regardless of the tonemapper to avoid artifacts
2021-08-10 09:56:18 +02:00
Rémi Verschelde
dad5d09d1b
Merge pull request #51416 from clayjohn/GLES-horizon-occlusion
[3.x] Add horizon specular occlusion
2021-08-10 09:55:46 +02:00
Rémi Verschelde
6518a61bd4
Merge pull request #51410 from clayjohn/GLES-blinn-phong 2021-08-10 09:52:28 +02:00