Commit graph

1125 commits

Author SHA1 Message Date
Hugo Locurcio
21ea1c3835
Rename soft shadow quality project settings for easier searching
`rendering/quality/shadows` is now `rendering/quality/positional_shadow`
to explicitly denote that the settings only affect positional light shadows,
not directional light shadows.

Shadow atlas settings now contain the word "atlas" for easier searching.

Soft shadow quality settings were renamed to contain the word "filter".
This makes the settings appear when searching for "filter" in the
project settings dialog, like in Godot 3.x.
2022-07-13 19:56:02 +02:00
Bastiaan Olij
6930ad2777 Fix typo, call mesh_instance_free not mesh_free 2022-07-12 22:30:08 +10:00
Hugo Locurcio
0f18bd244e
Fix dead link in TAA resolve shader comment
Spartan Engine has recently removed its own internal TAA in favor
of FSR 2.0. The link has been changed to point to a fixed commit,
so the link will keep working as long as the repository exists.
2022-07-09 22:51:54 +02:00
Pedro J. Estébanez
ba39230ef3 Bind correct default resource type in GI 2022-07-08 19:07:28 +02:00
Xentripetal
f514b82fd3 Account for relative z-indexes when y-sorting 2022-07-08 09:18:00 -05:00
Rémi Verschelde
99df193bea
Merge pull request #62277 from RandomShaper/depth_buffer_no_sampling
Rationalize certain cases of texture usage flags
2022-07-08 11:34:09 +02:00
Yuri Rubinsky
3dc1a1dbfb Prevent possible crash when mesh is freed 2022-07-06 19:52:54 +03:00
lawnjelly
1f69666209 Remove Octree
Octree is no longer used in 4.x.
2022-07-06 14:10:05 +01:00
Rémi Verschelde
55fca1cb94
Merge pull request #62344 from BastiaanOlij/extract_dependencies 2022-07-06 13:24:46 +02:00
Hugo Locurcio
c9037a8d2c
Remove unused anisotropy setter/getter methods in VoxelGI
These methods weren't exposed to the scripting API.

Anisotropy was used in earlier iterations of VoxelGI, but it was
removed as it was too expensive.
2022-07-06 02:40:49 +02:00
Rémi Verschelde
6bbfd160b0 SCons: Properly track codegen script dependency for generated GLSL headers 2022-07-02 16:01:48 +02:00
Hugo Locurcio
f9e6b292e2
Remove debugging print following GI reorganization 2022-07-01 20:08:10 +02:00
Rémi Verschelde
2d28bb8364
Merge pull request #62482 from JFonS/fix_crash_canvas_mode 2022-06-28 15:31:51 +02:00
Rémi Verschelde
d53f1fb388
Merge pull request #60935 from Calinou/geometryinstance3d-gi-mode-default-static
Use the Static global illumination mode in GeometryInstance3D by default
2022-06-28 14:40:53 +02:00
JFonS
8102db90bc Fix crash in Environment "Canvas" background mode. 2022-06-28 13:25:18 +02:00
Rémi Verschelde
16d9918b51
Merge pull request #62467 from RandomShaper/descriptor_rw_matters
Consider uniform writability part of the interface of the set
2022-06-28 08:25:38 +02:00
Je06jm
c2550e1cc0 Fixed FSR. Before, it was commiting the
raw render to the screen. Now, it commits
the fsr upscaled image
2022-06-27 18:01:12 -06:00
Pedro J. Estébanez
fc6ac4a155 Consider uniform writability part of the interface of the set 2022-06-27 21:56:18 +02:00
Bastiaan Olij
ecfcfd97fa Split dependency logic
Split FOG
Split visibility notifier
Final cleanup of storage classes
2022-06-28 00:10:29 +10:00
Pedro J. Estébanez
678a9ca221 Rationalize certain cases of texture usage flags
- Check for exhaustive usage flags for depth buffer
- Remove uneeded storage flag from normal-roughness buffer
2022-06-27 11:28:38 +02:00
Bastiaan Olij
4e8e10a186 Fix typo in roughness shaders 2022-06-26 12:43:21 +10:00
Bastiaan Olij
6224b00365 Moved cube_to_dp and cubemap logic into CopyEffects 2022-06-24 18:04:28 +10:00
Hugo Locurcio
610363add0
Use the Static global illumination mode in GeometryInstance3D by default
This makes VoxelGI and SDFGI work out of the box with primitive meshes,
loaded OBJ meshes and CSG nodes.
2022-06-23 22:34:23 +02:00
Rémi Verschelde
051fb86fb0
Merge pull request #61221 from BastiaanOlij/split_gi_effects 2022-06-23 12:28:10 +02:00
Rémi Verschelde
d8ef904ffc
Merge pull request #35758 from zmanuel/eliminate-draw-pending
Remove redundant thread sync counter draw_pending
2022-06-22 18:20:41 +02:00
Rémi Verschelde
e21db7723a
Merge pull request #62286 from JFonS/taa_global_time 2022-06-22 16:59:08 +02:00
Rémi Verschelde
95cafc7bcf
Merge pull request #62305 from JFonS/taa_molten_mobile_workaround 2022-06-22 16:58:31 +02:00
jfons
0f38e79617 Move TIME to a global shader variable
This makes it work consistently for motion vectors in all functions, including user-defined ones.
2022-06-22 12:24:37 +02:00
JFonS
9b4e07f866 Workaround MoltenVK shader conversion error 2022-06-22 11:58:50 +02:00
Bastiaan Olij
997810e417 Split GI effects and fix stereoscopic rendering of GI effects 2022-06-22 12:50:17 +10:00
Rémi Verschelde
40c360b870
Merge pull request #62122 from reduz/implement-movie-writer
Implement a Movie Maker mode
2022-06-21 14:24:14 +02:00
reduz
5786516d4d Implement Running Godot as Movie Writer
* Allows running the game in "movie writer" mode.
* It ensures entirely stable framerate, so your run can be saved stable and with proper sound (which is impossible if your CPU/GPU can't sustain doing this in real-time).
* If disabling vsync, it can save movies faster than the game is run, but if you want to control the interaction it can get difficult.
* Implements a simple, default MJPEG writer.

This new features has two main use cases, which have high demand:
* Saving game videos in high quality and ensuring the frame rate is *completely* stable, always.
* Using Godot as a tool to make movies and animations (which is ideal if you want interaction, or creating them procedurally. No other software is as good for this).

**Note**: This feature **IS NOT** for capturing real-time footage. Use something like OBS, SimpleScreenRecorder or FRAPS to achieve that, as they do a much better job at intercepting the compositor than Godot can probably do using Vulkan or OpenGL natively. If your game runs near real-time when capturing, you can still use this feature but it will play no sound (sound will be saved directly).

Usage:

$ godot --write-movie movie.avi [scene_file.tscn]

Missing:

* Options for configuring video writing via GLOBAL_DEF
* UI Menu for launching with this mode from the editor.
* Add to list of command line options.
* Add a feature tag to override configurations when movie writing (fantastic for saving videos with highest quality settings).
2022-06-21 11:28:47 +02:00
reduz
141c375581 Clean up Hash Functions
Clean up and do fixes to hash functions and newly introduced murmur3 hashes in #61934
* Clean up usage of murmur3
* Fixed usages of binary murmur3 on floats (this is invalid)
* Changed DJB2 to use xor (which seems to be better)
2022-06-20 12:54:19 +02:00
Rémi Verschelde
3a2b409c5a
Merge pull request #62106 from BastiaanOlij/eye_offset
Introduce eye_offset for correcting stereoscopic reflections
2022-06-18 10:40:57 +02:00
Bastiaan Olij
b4821fe2e0 Introduce eye_offset for correcting stereoscopic reflections
Use view instead of vertex for reflections.
2022-06-17 19:39:34 +10:00
Hugo Locurcio
787a1e006b
Fix glow in Mix mode not working correctly when FXAA is enabled
Glow must be performed after FXAA to ensure correct appearance.
2022-06-15 22:23:56 +02:00
clayjohn
a94110d0c6 Remove GLES2 shader constraints from GLES3 2022-06-14 12:01:52 -07:00
Hugo Locurcio
0225c6d31a
Tweak Light3D property hints for greater flexibility
- Specular can now be set above 1.0.
- Blur can be set to 0 to disable shadow blurring entirely, which is useful
  on lights that have a non-zero size.
  - When shadow blurring is disabled, lights that have a non-zero size will
    not use PCSS-like soft shadows, speeding up shadow rendering
    considerably.
- Some property hints now allow more precise values.
2022-06-13 14:31:46 +02:00
Yuri Rubinsky
c9ae83b5ab Prevent defining float constant without number after exponent in shaders 2022-06-10 11:35:56 +03:00
Yuri Rubinsky
5dd7a1030d Fix incorrect sky rotation based on camera axis 2022-06-09 22:40:40 +03:00
Yuri Rubinsky
d8842f1a4b Fix TIME compilation for custom functions in spatial shader 2022-06-09 20:12:25 +03:00
jfons
36382ab7eb Workaround MoltenVK error found in TAA implementation 2022-06-09 16:40:00 +02:00
clayjohn
a0338553b5 Assign VIEWPORT_SIZE after validating screen_size to avoid crash when using ReflectionProbe 2022-06-08 15:01:12 -07:00
Rémi Verschelde
48dcafeed9
Merge pull request #61794 from clayjohn/VULKAN-viewport-size
Use RenderBuffer size instead of half extents for VIEWPORT_SIZE
2022-06-08 07:16:25 +02:00
clayjohn
b6649828cd Use RenderBuffer size instead of half extents for VIEWPORT_SIZE in Vulkan spatial shaders 2022-06-07 15:01:20 -07:00
jfons
ba832d83b2 Initial TAA implementation
Initial TAA support based on the implementation in Spartan Engine.

Motion vectors are correctly generated for camera and mesh movement, but there is no support for other things like particles or skeleton deformations.
2022-06-07 13:14:44 +02:00
Rémi Verschelde
361a401fbb
Merge pull request #61554 from Chaosus/shader_fix_hints 2022-06-03 17:26:18 +02:00
Bastiaan Olij
69b66ec425 Ensure has_os_features is safely called as it can't be called from within the construct of RenderingServerDefault on which it relies 2022-06-01 20:47:32 +10:00
Rémi Verschelde
d8b0a8cd29
Merge pull request #61572 from clayjohn/ssao-license 2022-05-31 18:56:16 +02:00
clayjohn
06f356d41e Add and improve license attribution for SSAO and SSIL shader code 2022-05-31 09:42:50 -07:00
Yuri Rubinsky
cf240a7ae0 Refactor shader hints 2022-05-31 11:51:47 +03:00
clayjohn
2ba53547c9 Fix error with !rb spam when using background color mode with reflection probes 2022-05-28 18:11:28 -07:00
clayjohn
7b71545652 Remove mesh and particles RD dependencies from canvas rendering server 2022-05-26 10:43:37 -07:00
Rémi Verschelde
20a1b85589
Merge pull request #61425 from clayjohn/GLES3-2D 2022-05-26 01:16:52 +02:00
clayjohn
fb860265e0 Implement 2D Meshes and MultiMeshes in GLES3 backend 2022-05-25 15:46:24 -07:00
Hugo Locurcio
e85459dcd1
Add Cone and Cylinder shapes to FogVolume
This complements the existing Ellipsoid and Box local fog shapes.

This can be used to represent a light cone coming from a SpotLight.
2022-05-25 12:35:53 +02:00
GanidhuAbey
3c95a70081 Fix particle system from going inactive early
Prevents particles from freezing and dissapearing by resetting
it's inactive time when particles are emitted.
2022-05-24 17:31:21 -06:00
Rémi Verschelde
12ddaa36a6
Merge pull request #60641 from clayjohn/Sky-ign
Use IGN instead of white noise for sky dithering
2022-05-24 23:34:41 +02:00
clayjohn
3e20c1347d Add clipping, backbuffer, and CanvasGroups to 2D GLES3 renderer
As well as significant consequent cleanup in the RenderTarget, Texture, and Canvas renderer code
2022-05-24 11:00:34 -07:00
clayjohn
4f82b1bd20 Use IGN instead of white noise for sky dithering 2022-05-24 10:57:07 -07:00
Rémi Verschelde
1314e6cbcc
Merge pull request #60803 from Chaosus/shader_hint_rename
Rename `hint_albedo`, `hint_white/black` in shaders
2022-05-24 08:15:33 +02:00
Rémi Verschelde
126470caa1
Merge pull request #61226 from Chaosus/shader_fix_keyword_completion 2022-05-23 19:05:29 +02:00
Hugo Locurcio
209d7eb7ea
Fix typo in occlusion culling warning method name 2022-05-23 09:34:28 +02:00
trollodel
fe3371a9a9 Add timestamps to some rendering effects 2022-05-21 17:47:28 +02:00
Rémi Verschelde
a53434639f
Merge pull request #61214 from somnathsarkar/particle-attractor-fix
Fix GPUParticles3D disappearance at attractor origins
2022-05-21 08:48:36 +02:00
Somnath Sarkar
99911bfa79 Fix GPUParticles3D disappearance at attractor origins 2022-05-20 19:56:32 -04:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +02:00
Yuri Rubinsky
29ff04acf2 Fix incorrect keyword completion after period in shader editor 2022-05-20 18:40:57 +03:00
Windy Darian
a3e016e07e Fix normal and tangent blending in blend shapes 2022-05-20 07:59:45 -04:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
Haoyu Qiu
fc3b845c07 Add dedicated macros for property name extraction
* Replace case-by-case extraction with PNAME & GNAME
* Fix group handling when group hint begins with property name
* Exclude properties that are PROPERTY_USAGE_NO_EDITOR
* Extract missing ADD_ARRAY*, ADD_SUBGROUP* macros
2022-05-19 14:08:47 +08:00
Yuri Rubinsky
5322b171de Fix tonemapper shader to correctly apply alpha channel 2022-05-18 06:43:07 +03:00
clayjohn
600d8105d8 Fix custom irradiance bug in Vulkan mobile renderer 2022-05-16 11:57:41 -07:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Somnath Sarkar
52aeaf5d16 Fix computation of screen_uv 2022-05-16 00:00:01 -04:00
Rémi Verschelde
349aa9c884
Merge pull request #60894 from derammo/derammo_opengl3_windows 2022-05-13 15:07:13 +02:00
Bastiaan Olij
fe8c8eeba8 Copy_to_fb is available in both raster and clustered renderers, remove unwanted checks 2022-05-13 13:19:42 +10:00
Rémi Verschelde
9cf9054c3e
Merge pull request #60976 from Calinou/fsr-rename-property-hint 2022-05-12 23:12:03 +02:00
Rémi Verschelde
ff30a09993
Merge pull request #60643 from clayjohn/GLES3-3D 2022-05-12 21:08:02 +02:00
clayjohn
652adcd5bf Basic 3D rendering 2022-05-12 10:37:27 -07:00
Hugo Locurcio
0cdd7d88ad
Rename remaining references of FSR to FSR 1.0
With FSR 2.0 around the corner, we should avoid any ambiguity by
explicitly stating the version number.
2022-05-12 18:22:43 +02:00
reduz
8b7c7f5a75 Add a new HashMap implementation
Adds a new, cleaned up, HashMap implementation.

* Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing).
* Keeps elements in a double linked list for simpler, ordered, iteration.
* Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much
  for performance vs keeping the key, but helps replace old code).
* Uses a more modern C++ iterator API, deprecates the old one.
* Supports custom allocator (in case there is a wish to use a paged one).

This class aims to unify all the associative template usage and replace it by this one:
* Map<> (whereas key order does not matter, which is 99% of cases)
* HashMap<>
* OrderedHashMap<>
* OAHashMap<>
2022-05-12 11:21:29 +02:00
clayjohn
2bf8831dd6 SceneShader compiling 2022-05-11 21:00:21 -07:00
clayjohn
3bb8e6a9fe SkyShaders working 2022-05-11 21:00:21 -07:00
derammo
96c21bc749 opengl3 driver now works on windows including multi window
fixed and simplified gl_manager_windows
swap buffers now called for all windows
fixed missing pixel format setting in additional windows
    this makes them work in OpenGL contexts
changed verbose error printing to write once
    this error message happens very frequently while opengl3 is not finished
removed dead code no longer needed after changes
fixed comments that were misinformation
window messages during window creation now handled
    these were previously discarded
    messages now tunnel the required context
changed failure to create opengl3 window on windows to be more fatal
marked a problem with pen code
conditional compilation of vulkan and opengl3 on windows fixed
windows debug builds now show messages on debug console also
rendering driver selection box now shows only compiled drivers
marked some problematic code
thanks to akien-mga for patiently rewriting my style mistakes
2022-05-11 16:12:40 -04:00
Bastiaan Olij
9939cfc4c4 Split out bokeh_dof and copy effects 2022-05-11 11:08:56 +10:00
Rémi Verschelde
d8935b27a9 Fix warnings found by Emscripten 3.1.10
Fix `-Wunused-but-set-variable`, `-Wunqualified-std-cast-call`, and
`-Wliteral-range` warnings.
2022-05-10 13:03:13 +02:00
Yuri Roubinsky
a8bbe570ca Rename hint_albedo, hint_white/black in shaders 2022-05-09 22:50:18 +03:00
Yuri Roubinsky
8ed84a9f01 Fix instance uniform shader crash in custom functions 2022-05-09 17:10:42 +03:00
Rémi Verschelde
8fb02635d4
Merge pull request #60772 from MightiestGoat/multimesh-uniform-set
Fix the uniform set creation of multimesh with a invalidated buffer
2022-05-05 16:55:48 +02:00
mightygoat
61df370810 Check multimesh before uniform set creation 2022-05-05 12:25:02 +05:30
mightygoat
10209e31eb Fix the uniform set creation of multimesh with a invalidated buffer 2022-05-05 06:59:47 +05:30
Rémi Verschelde
477b53d280
Merge pull request #60568 from Chaosus/shader_keyword_completions
Add keyword completion to shader editor
2022-05-04 23:27:33 +02:00
Rémi Verschelde
c114823471
Merge pull request #58298 from Calinou/decal-distance-fade-use-easing 2022-05-04 21:50:20 +02:00
Aaron Franke
fa7a7795f0
Rename Basis get_axis to get_column, remove redundant methods 2022-05-03 09:37:47 -05:00
Rémi Verschelde
6530d46d67
Merge pull request #51102 from Calinou/renderingserver-add-api-version-getter
Add `get_video_adapter_api_version()` to RenderingServer
2022-05-03 14:44:55 +02:00
Rémi Verschelde
931838b330
Merge pull request #60627 from aaronfranke/rename-elements
Rename Transform2D and Basis `elements` to `columns` and `rows` respectively
2022-05-03 14:40:01 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00
Hugo Locurcio
31194f5b1c
Add get_video_adapter_api_version() to RenderingServer
This method can be used to get the graphics API version currently in
use (such as Vulkan). It can be used by projects for troubleshooting
or statistical purposes.
2022-05-03 01:18:35 +02:00
Hugo Locurcio
618c88c71b
Make Decal distance fade smoother
`smoothstep()` avoids the sudden transparency jump when entering or
leaving a decal's distance fade margin distance. This in turn helps
make opacity transitions less noticeable to the player, as it's
less likely to catch the player's eye.
2022-05-02 23:14:00 +02:00