Commit graph

2575 commits

Author SHA1 Message Date
clayjohn
f92141be13 Disable Alpha throughout Glow and FXAA code in order to avoid issues with transparent viewports 2022-05-26 11:15:35 -07:00
clayjohn
9927515254 Disable alpha in post process when using opaque framebuffer 2022-05-24 14:11:09 -07:00
clayjohn
027ec28126 Disable writing to alpha with opaque framebuffer 2022-05-24 10:30:49 -07:00
clayjohn
3374bae953 Fixed Bug where DoF incorrectly wrote to alpha channel amd bug with tonemap shaders 2022-05-18 13:19:42 -07:00
Hugo Locurcio
3762b40de7
Merge pull request #54585 from Kinwailo/fix_viewport_transparent_bg
Fix viewport with transparent bg changed to solid black if enable fxaa or debanding.
2022-05-16 08:28:36 +02:00
Kinwailo
b1a50ad805 fix post procressing with transparent bg and keep alpha channel of the tonemap shader output 2022-05-12 16:32:31 +08:00
Rémi Verschelde
3649382b37
Merge pull request #60829 from clayjohn/GLES2-html5-blendshapes
[GLES2] Unpack blend shape arrays when necessary
2022-05-06 22:08:31 +02:00
clayjohn
b0b1e44bc1 Unbind vertex buffer before calculating blend shapes 2022-05-06 12:21:35 -07:00
clayjohn
33d825c50b Unpack blend shape arrays when necessary
Blend shapes need to be unpacked if the vertex array is being unpacked
2022-05-06 10:36:18 -07:00
mdavisprog
53fb0440d3 Add OS::is_process_running function.
Adds the is_process_running function to the native OS class and exposes it to script.

This is implemented on Windows and Unix platforms. A stub is provided for other platforms that do not support this function.

Documentation is updated to reflect new API function.

(cherry picked from commit f3c1232c59)
2022-05-05 15:02:46 +02:00
Pedro J. Estébanez
41fc0abf77 Fix handling of async hidden render mode
- Mute errors when conditioned shader is not ready yet
- Avoid depth pre-pass on meshes that would end up black
2022-04-12 20:11:20 +02:00
Rémi Verschelde
3eee2f45a3
Merge pull request #57674 from RandomShaper/fix_ubershader_android
Improve ubershader compatibility
2022-03-13 00:53:48 +01:00
Ansraer
2fb998bfbc Fix alpha scissor support 2022-03-11 16:18:19 +01:00
Rémi Verschelde
b6a6c90ea2
Merge pull request #58855 from akien-mga/3.x-gles2-fix-VersionKey-comparison 2022-03-07 14:31:43 +01:00
Rémi Verschelde
2dec5db5df
Merge pull request #58357 from BastiaanOlij/fix_external_viewport_texture 2022-03-07 13:18:33 +01:00
Rémi Verschelde
76df26b110 GLES2: Fix VersionKey comparison in ShaderGLES2::bind()
This was comparing arrays, GCC 12 raises a warning for it:

```
drivers/gles2/shader_gles2.cpp: In member function 'bool ShaderGLES2::bind()':
drivers/gles2/shader_gles2.cpp:80:71: error: comparison between two arrays [-Werror=array-compare]
   80 |         if (active != this || !version || new_conditional_version.key != conditional_version.key) {
      |                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/gles2/shader_gles2.cpp:80:71: note: use unary '+' which decays operands to pointers or '&'component_ref' not supported by dump_decl<declaration error>[0] != &'component_ref' not supported by dump_decl<declaration error>[0]' to compare the addresses
```
2022-03-07 09:30:22 +01:00
Omar El Sheikh
733a84f7a4 GLES2 Compression on Blend Shapes Fix
When compressed vertex positions are used in a blend shapes mesh, we
need to make sure we set the w-component of the position vector to 1.0

When octahedral compression is used on normals/tangents, they need to be
converted to cartesian floats to be used for blend shapes

This conversion also changes the number of components of that vertex
attribute, which caused issues because previously there was an
assumption that you had the same number of components in the blend shape
buffer as you did in the original mesh's buffer (which is not true for
oct norm/tang)
2022-03-06 10:57:05 -05:00
Omar El Sheikh
9988739332 Fix shader state caching when blend shapes used
Previously, conditionals set on the shader would change outside of the
_render_list function when blend shapes were used

This is an issue because the function keeps track of the previous shader
state to try to minimize state changes

Now we keep all this shader state change within the _render_list
function to ensure the saved previous state is correct
2022-03-05 16:33:17 -05:00
Bastiaan Olij
7e2c4aac7e Fix external textures not working correctly with viewport texture 2022-02-22 14:24:34 +11:00
lawnjelly
522bce1159 Fixed Timestep Interpolation (3D)
Adds fixed timestep interpolation to the visual server.
Switchable on and off with project setting.

This version does not add new API for set_transform etc, when nodes have the interpolated flag set they will always use interpolation.
2022-02-16 09:41:23 +00:00
lawnjelly
3dc0e97d05 Fix incorrect buffer upload size in GLES2 draw_gui_primitive
The buffer upload size appears to have been incorrect for quite some time, which causes uploading from undefined memory.
2022-02-15 17:24:51 +00:00
lawnjelly
614dc363ab Fix GL buffer upload size bugs
Wrapper functions for uploading buffers to OpenGL take all sizes and offsets in bytes. Some buffer sizes are specified as units (e.g. float) so require conversion to bytes when calling the buffer upload functions.

Two such bugs have been fixed in blendshapes, and parameter names and comments have been changed to emphasize that sizes should be in bytes.

In addition DEV_ASSERTS in the upload wrappers have been changed to ERR_FAIL.
2022-02-14 10:56:06 +00:00
Rémi Verschelde
d0b446c6d5
Merge pull request #45372 from Firepal/prepass-nightmares 2022-02-11 15:19:26 +01:00
Firepal
ff55157d3f Don't use prepass threshold with alpha scissor 2022-02-11 12:01:15 +01:00
Rémi Verschelde
7a16bb2ee4
Fix typos with codespell
Using codespell 2.2-dev from current git.

Added `misc/scripts/codespell.sh` to make it easier to run it once in a
while and update the skip and ignore lists.

(cherry picked from commit 1bdb82c64e)
2022-02-11 09:50:59 +01:00
lawnjelly
b15ad8e786 Fix for S3TC on Android and IOS devices
On some platforms, exporters are prevented from exporting S3TC textures. This causes problems if the .import file contains a reference to such a texture - the exported project will attempt to load the S3TC, fail, and probably crash.

This PR prevents this problem by faking lack of hardware support for S3TC on the affected platforms. This prevents the engine attempting to load the S3TC and avoids the problem.
2022-02-09 08:45:24 +00:00
Omar El Sheikh
bf5b2f48e6 Re-fix Disabling Half Floats on iOS
A previous change missed setting a flag that specified whether half
floats were being used on vertex positions when in the GLES2 driver

This caused errors with the vertex buffer when platforms (specifically
iOS) which do not properly support half float vertex attributes on
GLES2, try to remapt the vertex buffer to stop using half floats
(in this case that remapping never happened and caused artifacts)

Re-enable setting that flag to fix rendering issues on these platforms
2022-02-05 21:06:09 -05:00
Pedro J. Estébanez
0d1ec9a7cf Improve ubershader compatibility
- Prevent debug enforced use of ubershader on shaders not supporting it
- Use unsigned integer for ubershader flags
- Add project setting for disabling async shader compilation on mobile
- Stop sampling some textures through different kinds of samplers at the same time
2022-02-05 22:12:31 +01:00
lawnjelly
a0c6d16c90 Add editor vital redraws only option
When editor continuous redraws is switched off, the editor only redraws when a redraw_request was issued by an element in the scene. This works well in most situations, but when scenes have dynamic content they will continuously issue redraw_requests.

This can be fine on high power desktops but can be an annoyance on lower power machines.

This PR splits redraw requests into high and low priority requests, defaulting to high priority. Requests due to e.g. shaders using TIME are assigned low priority.

An extra editor setting is used to record the user preference and an extra option is added to the editor spinner menu, to allow the user to select between 3 modes:

* Continuous
* Update all changes
* Update vital changes
2022-02-02 11:26:45 +00:00
Fabio Alessandrelli
aa3ef20fcb
[Net] Simplify IP resolution code, fix caching.
First, we should not insert into cache if the hostname resolution has
failed (as it might be a temporary internet issue), second, the async
resolver should also properly insert into cache.

Took the chance to remove some duplicate code with critical section in
it at the cost of little performance when calling the blocking
resolve_hostname function.

(cherry picked from commit 49297d937c)
2022-01-31 22:54:25 +01:00
Rémi Verschelde
aa6465cd5b
Fix style error from previous merge 2022-01-22 16:23:28 +01:00
Rémi Verschelde
6c0c0c4b29
Merge pull request #54165 from Calinou/directional-shadow-runtime-change-3.x
Allow changing directional shadow size at run-time
2022-01-22 15:25:09 +01:00
Rémi Verschelde
11a3fabc92
Merge pull request #56843 from Calinou/ssr-fix-background-line
Fix visible background line in intersections in screen-space reflections (3.x)
2022-01-18 07:56:46 +01:00
Rémi Verschelde
1ee44b2366
ImageLoader: Remove references to unsupported svgz extension
I don't see any reference to gzip/svgz supported in the nanosvg library,
and the handful of test gzip compressed svgz files I tried failed loading.

Also cleaning a couple missing includes in platform export code.
2022-01-17 10:52:32 +01:00
Hugo Locurcio
a80187f5bc
Fix visible background line in intersections in screen-space reflections
Adjusting the step grading by one resolves the issue without affecting
performance or introducing adverse artifacts.
2022-01-16 18:00:13 +01:00
Rémi Verschelde
22166639ed
Merge pull request #56366 from Calinou/async-shaders-use-in-editor
Use asynchronous shader compilation and cache in the editor if requested
2022-01-16 10:34:07 +01:00
Rémi Verschelde
31c7f13ea4
Merge pull request #56802 from jnlopar/oren_nayer_vert_lighting_bug
Fixes broken scene shader compile due to undefined 'diffuse_color' variable with Oren Nayar + Vertex Lighting
2022-01-15 09:19:43 +01:00
Jason Neufeld
36c3b87883 Fixes shader compile due to undefined 'diffuse_color' variable with Oren Nayer + Vertex Lighting 2022-01-14 13:09:30 -08:00
Rémi Verschelde
a627cdafc5
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-13 15:54:13 +01:00
Rémi Verschelde
8a192cd0ab
Merge pull request #55987 from bruvzg/wt🤎3 2022-01-10 16:43:56 +01:00
Rémi Verschelde
b197de6f5f
Fix typos with codespell
Using codespell 2.1.0.

Method:
```
$ cat > ../godot-word-whitelist.txt << EOF
ang
curvelinear
dof
doubleclick
fave
findn
GIRD
leapyear
lod
merchantibility
nd
numer
ois
ony
que
readded
seeked
statics
synching
te
uint
unselect
webp
EOF

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2022-01-07 00:14:54 +01:00
bruvzg
6f81a8ee2c
Fix multiple missing UTF-8 decoding.
(cherry picked from commit c69e0d16bc)
2022-01-06 21:44:40 +01:00
Rémi Verschelde
25369acff9
Merge pull request #51708 from Calinou/viewport-add-32bpc-color-depth 2022-01-04 14:30:24 +01:00
Rémi Verschelde
cc6e0e7fb3
Merge pull request #56161 from The-O-King/blend_shapes_octahedral 2022-01-04 14:09:49 +01:00
Brian Semrau
2c60c29340 Fix GPU particles transform feedback for WebGL 2 2022-01-03 00:20:42 -05:00
Hugo Locurcio
ae918c3041
Use asynchronous shader compilation and cache in the editor if requested
This provides more consistent behavior between the editor and running
project.
2021-12-31 02:20:29 +01:00
Omar El Sheikh
50ed674ec2 Fix Blend Shapes when Octahedral Compression is Used
Blend shapes did not take into account octahedral compressed vertex
attribute layouts and this resulted in incorrect lighting on the
resulting blended mesh

Now make the blend_shapes shader octahedral compression aware!
2021-12-22 10:00:12 -05:00
Bastiaan Olij
5fbc24f3e0 Fix issue with external textures being freed by Godot 2021-12-22 11:46:37 +11:00
Haoyu Qiu
e40bb68c05
Add / to the unix shortcut drive list
Also made `get_current_drive()` to pick the longest match on Unix.

(cherry picked from commit 67f04b381b)
2021-12-21 12:11:14 +01:00
Lucas Ângelo
9f68b4fea3
Trunc shader function fixed
the 'trunc' function was comparing integers with floats using the '>' operator, which is not supported in Android. This issue is now gone.
2021-12-18 17:50:58 -03:00