Commit graph

2500 commits

Author SHA1 Message Date
Rémi Verschelde 1f8497d281
Merge pull request #53411 from RandomShaper/ubershaders_3.x 2021-11-09 13:12:44 +01:00
Pedro J. Estébanez 4c710780d4 Implement async shader compilation plus caching for GL ES 3
Async. compilation via ubershader is currently available in the scene and particles shaders only.

Bonus:
- Use `#if defined()` syntax for not true conditionals, so they don't unnecessarily take a bit in the version flagset.
- Remove unused `ENABLE_CLIP_ALPHA` from scene shader.
- Remove unused `PARTICLES_COPY` from the particles shader.
- Remove unused uniform related code.
- Shader language/compiler: use ordered hash maps for deterministic code generation (needed for caching).
2021-11-09 12:19:12 +01:00
Rémi Verschelde cfff7a9032
Merge pull request #54751 from NHodgesVFX/3.x 2021-11-09 00:15:49 +01:00
Omar El Sheikh 8a43b222c7 Fix Vertex Attribute Specification Octahedral
For octahedral compressed normals/tangents, we use vec4 in the shader
regardless of whether a normal/tangent does/doesn't exist

For the case where we only have a normal vector, we need to specify that
there are only two components being used when calling glVertexAttrib

Before we would always specify that there were 4 components, and used
offsets to determine where in the vertex buffer to read data from but
this doesn't work on all platforms
2021-11-08 12:11:48 -05:00
NHodgesVFX 237f7eeabe Add more OpenGL Attributes
Co-Authored-By: Johann Meyer <25986904+johannmeyer@users.noreply.github.com>
Co-Authored-By: Clay John <claynjohn@gmail.com>
2021-11-08 01:22:40 -05:00
Rémi Verschelde ecedc7df0b
Merge pull request #54197 from clayjohn/GLES3-irradiance-map
Fudge irradiance map lookup to avoid precision issues
2021-10-29 14:11:53 +02:00
Rémi Verschelde 87c80f529f
clang-format: Enable BreakBeforeTernaryOperators
clang-format keeps breaking the way it handles break *after* ternary operators,
so I give up and go with the only style they seem to actually test.
2021-10-28 14:50:33 +02:00
Rémi Verschelde 1b65550ec7
clang-format: Various fixes to comments alignment from clang-format 13
All reviewed manually and occasionally rewritten to avoid bad auto formatting.
2021-10-28 14:50:32 +02:00
Rémi Verschelde 42d385b312
clang-format: Disable alignment of operands, too unreliable
Sets `AlignOperands` to `DontAlign`.

`clang-format` developers seem to mostly care about space-based indentation and
every other version of clang-format breaks the bad mismatch of tabs and spaces
that it seems to use for operand alignment. So it's better without, so that it
respects our two-tabs `ContinuationIndentWidth`.
2021-10-28 13:23:38 +02:00
Max Hilbrunner e29126914d
Save all 64 bits of get_ticks_msec() in more cases
(cherry picked from commit 5dc02eb8b0)
2021-10-26 18:23:31 +02:00
clayjohn 3f03b60718 Fudge irradiance map lookup to avoid precision issues 2021-10-24 12:03:54 -07: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