Commit graph

181 commits

Author SHA1 Message Date
Bastiaan Olij
0bd042c601 Change RendererSceneRender::GeometryInstance so more code is shared among renderers 2022-07-27 12:32:07 +10:00
Bastiaan Olij
bad5c659a4 Move Sky(RD) into environment
Move Fog logic from render scene render to fog
2022-07-26 10:19:40 +10:00
reduz
455c06ecd4 Implement Vector4, Vector4i, Projection
Implement built-in classes Vector4, Vector4i and Projection.

* Two versions of Vector4 (float and integer).
* A Projection class, which is a 4x4 matrix specialized in projection types.

These types have been requested for a long time, but given they were very corner case they were not added before.
Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity.

**Q**: Why Projection and not Matrix4?
**A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
2022-07-23 14:00:01 +02:00
Rémi Verschelde
fe929d4787
Merge pull request #62513 from reduz/shader_preprocessor_remake 2022-07-23 00:02:33 +02:00
Rémi Verschelde
4f7bfacfcd
Merge pull request #62478 from BastiaanOlij/split_effects_20220628 2022-07-22 23:44:52 +02:00
reduz
f649678402 Clean up Shader Preprocessor
* Moved preprocessor to Shader and ShaderInclude
* Clean up RenderingServer side
* Preprocessor is separate from parser now, but it emits tokens with include location hints.
* Improved ShaderEditor validation code
* Added include file code completion
* Added notification for all files affected by a broken include.
2022-07-22 22:53:03 +02:00
bruvzg
8823eae328
Rename OSX to macOS and iPhoneOS to iOS. 2022-07-21 09:37:52 +03:00
Bastiaan Olij
eefcb5ed67 Move screen space effects into a separate class 2022-07-19 13:27:39 +10:00
Bastiaan Olij
d139131aab Adding Variable Rate Shading support to Godot
Improve GI renderer and add VRS support
Implement render device has_feature and move subgroup settings to limit_get
2022-07-17 15:42:24 +10:00
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
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
Rémi Verschelde
55fca1cb94
Merge pull request #62344 from BastiaanOlij/extract_dependencies 2022-07-06 13:24:46 +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
6224b00365 Moved cube_to_dp and cubemap logic into CopyEffects 2022-06-24 18:04:28 +10:00
Bastiaan Olij
997810e417 Split GI effects and fix stereoscopic rendering of GI effects 2022-06-22 12:50:17 +10: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
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
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
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
trollodel
fe3371a9a9 Add timestamps to some rendering effects 2022-05-21 17:47:28 +02:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02: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
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
Bastiaan Olij
9939cfc4c4 Split out bokeh_dof and copy effects 2022-05-11 11:08:56 +10: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
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
Rémi Verschelde
c273ddc3ee Style: Partially apply clang-tidy's cppcoreguidelines-pro-type-member-init
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00
Rémi Verschelde
cab171c54e
Merge pull request #60547 from BastiaanOlij/split_tonemapper_effect
Splitting tonemapper into its own class
2022-04-28 08:33:44 +02:00
Bastiaan Olij
3b2267ba6d Splitting tonemapper into its own class 2022-04-28 15:00:30 +10:00
Hugo Locurcio
eb497bbaa7
Fix "ortogonal" -> "orthogonal" typo in rasterizer code 2022-04-26 21:49:44 +02:00
Bastiaan Olij
0b4fd92a17 Moved particles into ParticlesStorage 2022-04-17 13:13:22 +10:00
Bastiaan Olij
b6faf6c6c0 Move light, reflection probe and lightmap into LightStorage 2022-04-17 13:13:18 +10:00
Bastiaan Olij
6b28d94e77 Merge canvas and decal into TextureStorage and add render target 2022-04-17 12:59:50 +10:00
Rémi Verschelde
46ef52162e Color: Rename to_srgb/to_linear to include base color space
This helps reduce confusion around sRGB <> Linear conversions by making
both input and output color spaces explicit.
2022-04-13 11:45:52 +02:00
bruvzg
f851c4aa33
Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
Bastiaan Olij
b8be7903f3 Move storage for Mesh, MeshInstance, MultiMesh and Skeleton into MeshStorage 2022-04-02 16:29:04 +11:00
Bastiaan Olij
36defd1179 Extract global variable, shader and material storage 2022-03-31 21:49:42 +11:00
Bastiaan Olij
0fe06e9467 Extract Decal and Decal atlas from Storage class 2022-03-21 12:22:43 +11:00
Hugo Locurcio
c45d2c242b Replace DirectionalLight3D's use_in_sky_only with sky_mode enum
3 options are available:

- Light and Sky (default)
- Light Only (new)
- Sky Only (equivalent to `use_in_sky_only = true`)

Co-authored by: clayjohn <claynjohn@gmail.com>
2022-03-17 14:00:02 -07:00
Bastiaan Olij
57e5a33623 Split dummy renderer classes into separate files
Split canvas_texture_storage and texture_storage from render_storage class
2022-03-16 17:43:10 +11:00
kobewi
39d429e497 Change some math macros to constexpr
Changes `MAX`, `MIN`, `ABS`, `CLAMP` and `SIGN`.
2022-03-09 16:24:32 +01:00
Rémi Verschelde
1561737055
Merge pull request #49447 from Calinou/remove-shadow-color-property
Remove unused `shadow_color` property from Light3D
2022-03-08 07:48:05 +01:00
reduz
b0ca03b0a2 Add a UniformSet cache
* Changed syntax usage for RD::Uniform to create faster with a single RID
* Converted render pass setup to use this in clustered renderer to test.

This is the first step into creating a proper uniform set cache system to simplify large parts of the codebase.
2022-03-06 13:03:33 +01:00
Hugo Locurcio
aea104deb7
Remove unused shadow_color property from Light3D
This shadow color property was no longer effective since the shaders
were optimized to improve occupancy.
2022-03-04 23:12:18 +01:00
Rémi Verschelde
c787f59931
Merge pull request #58734 from Calinou/tweak-render-timestamp-names
Tweak render timestamp names for explicitness and consistency
2022-03-04 20:43:08 +01:00