Commit graph

124 commits

Author SHA1 Message Date
Marcel Admiraal 8acd13a456 Rename Quat to Quaternion 2021-06-04 18:14:32 +01:00
Aaron Franke de3f6699a5
Rename Transform to Transform3D in core 2021-06-03 07:30:01 -04:00
reduz 0d2e02945b Implement shader caching
* Shader compilation is now cached. Subsequent loads take less than a millisecond.
* Improved game, editor and project manager startup time.
* Editor uses .godot/shader_cache to store shaders.
* Game uses user://shader_cache
* Project manager uses $config_dir/shader_cache
* Options to tweak shader caching in project settings.
* Editor path configuration moved from EditorSettings to new class, EditorPaths, so it can be available early on (before shaders are compiled).
* Reworked ShaderCompilerRD to ensure deterministic shader code creation (else shader may change and cache will be invalidated).
* Added shader compression with SMOLV: https://github.com/aras-p/smol-v
2021-05-31 10:13:09 +02:00
Rémi Verschelde f1abfbbeb1
Merge pull request #48837 from Soupstraw/shader-pi
Added constants PI, TAU and E to the shader language
2021-05-25 18:07:15 +02:00
Rémi Verschelde f050719da8
Merge pull request #48933 from Chaosus/shader_array_params
Allow shader arrays to be passed as parameters and return value in functions
2021-05-25 11:47:08 +02:00
Joosep Jääger 16567321ba Added constants PI, TAU and E to the shader language 2021-05-25 12:15:08 +03:00
reduz 789713b008 Support for 2D particles to collide against SDF
-Added SDF collision support for 2D particles
-Changed the SDF generation to be fully signed
2021-05-23 16:43:36 -03:00
Yuri Roubinsky 5874b7a29c Allow shader arrays to be passed as parameters and return value 2021-05-22 20:15:03 +03:00
Winston Hartnett 96fa2ee2a0 Fix instance uniform typo 2021-05-20 21:11:40 -05:00
Rémi Verschelde 4219a4cb6f
Fix typos with codespell
Using codespell 2.0.0.

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

$ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po"
$ git diff // undo unwanted changes
```
2021-05-20 12:38:56 +02:00
Yuri Roubinsky 6135744786 Implements length() shader function for arrays in structs 2021-05-19 21:50:11 +03:00
Bastiaan Olij 02980be834 Implementing blit shader with versions 2021-05-12 22:52:28 +10:00
Rémi Verschelde 0c693f8781
Merge pull request #48472 from BastiaanOlij/render_state
Make better use of our render_state struct
2021-05-12 13:44:03 +02:00
reduz 479391ef54 Fixes missng 2D engine bits
-Mesh2D now works
-MultiMesh2D now works
-Polygon2D now works
-Added hooks for processing 2D particles
-Skeleton2D now works

2D particles still not working, but stuff needed for it is now implemented.
2021-05-11 11:21:36 -03:00
Bastiaan Olij 308b26762b Split RenderDataRD struct from RenderState struct to simplify passing our render data around the renderer. 2021-05-10 21:52:15 +10:00
Rémi Verschelde 7449d6c752
Merge pull request #48435 from BastiaanOlij/no_repeat_mobile_renderer
Remove repeat from forward mobile renderer
2021-05-05 16:19:03 +02:00
Bastiaan Olij cc45ed448b Remove repeat from forward mobile renderer 2021-05-04 11:37:58 +10:00
jfons 6995b0429c Assorted fixes to UV unwrapping and GPU lightmapper
Various fixes to UV2 unwrapping and the GPU lightmapper. Listed here for
context in case of git blame/bisect:

* Fix UV2 unwrapping on import, also cleaned up the unwrap cache code.
* Fix saving of RGBA images in EXR format.
* Fixes to the GPU lightmapper:
	- Added padding between atlas elements, avoids bleeding.
	- Remove old SDF generation code.
	- Fix baked attenuation for Omni/Spot lights.
	- Fix baking of material properties onto UV2 (wireframe was
	  wrongly used before).
	- Disable statically baked lights for objects that have a
	  lightmap texture to avoid applying the same light twice.
	- Fix lightmap pairing in RendererSceneCull.
	- Fix UV2 array generated from `RenderingServer::mesh_surface_get_arrays()`.
	- Port autoexposure fix for OIDN from 3.x.
	- Save debug textures as EXR when using floating point format.
2021-05-03 18:10:34 +02:00
Bastiaan Olij 58ff0dac1a Create mobile renderer 2021-05-03 21:54:11 +10:00
reduz 90056460ad Implement Particle Trails
-Enable the trails and set the length in seconds
-Provide a mesh with a skeleton and a skin
-Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh
-Works deterministically
-Fixed particle collisions (were broken)
-Not working in 2D yet (that will happen next)
2021-04-30 17:38:02 -03:00
Rémi Verschelde 305b2a15bf
Merge pull request #48239 from akien-mga/goodbye-copymem
Core: Drop custom `copymem`/`zeromem` defines
2021-04-28 11:04:05 +02:00
Rémi Verschelde 95cfce661b
Merge pull request #48050 from JFonS/occlusion_culling 2021-04-27 19:07:12 +02:00
Rémi Verschelde 8247667a3e
Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
Dennis Brakhane 31d41d83c3 Remove duplicate comments
A few single line comments were duplicated, probably due to bad merges.

This commit removes the obviously duplicate ones.
2021-04-25 20:03:52 +02:00
jfons 4d9d99bb82 Implement occlusion culling
Added an occlusion culling system with support for static occluder meshes.
It can be enabled via `Project Settings > Rendering > Occlusion Culling > Use Occlusion Culling`.

Occluders are defined via the new `Occluder3D` resource and instanced using the new
`OccluderInstance3D` node. The occluders can also be automatically baked from a
scene using the built-in editor plugin.
2021-04-23 21:45:23 +02:00
Bastiaan Olij ebf10fe736 Fix reflection probe 2021-04-21 23:42:29 +10:00
reduz 906882ee66 Split particle shader entry points
* Particle shaders now have start() and process()
* Particle collision happens between them.
* The RESTART property is kept, so porting an old shader is still possible.

This fixes the problem of particle collisions not functioning on the first particle frame.
2021-04-17 12:22:55 -03:00
reduz d3b49c416a Refactor GLSL shader compilation
-Used a more consistent set of keywords for the shader
-Remove all harcoded entry points
-Re-wrote the GLSL shader parser, new system is more flexible. Allows any entry point organization.
-Entry point for sky shaders is now sky().
-Entry point for particle shaders is now process().
2021-04-14 11:37:52 -03:00
Bastiaan Olij 71c5d73b5e Remove low_end option from renderer, being replaced by separate implementation 2021-04-09 22:04:56 +10:00
Bastiaan Olij dad40fa2df Move clustered renderer functionality 2021-04-05 23:11:38 +10:00
Rémi Verschelde d83761ba80
Style: Apply clang-tidy's readability-braces-around-statements 2021-04-05 14:09:59 +02:00
Rémi Verschelde 65a2888057
Style: Apply clang-tidy's modernize-use-default-member-init 2021-04-05 13:37:27 +02:00
Bastiaan Olij e93c9fc4ed As GLSLang seems to be all or nothing, added our own defines 2021-03-31 21:47:25 +11:00
Bastiaan Olij 7f63c9e7c9 Changed SCsub for shaders to find shaders automatically and create dependencies with include files 2021-03-18 12:59:47 +11:00
Ignacio Abal ccdd7ab890 Added validation when assigning heightfield_resolution (Fix #46281) 2021-03-17 12:03:52 -03:00
Bastiaan Olij f7cbeb0d1b Removed time duplicate from ForwardClustered. Just use the variable from its superclass 2021-03-11 18:08:10 +11:00
Bastiaan Olij 73b5eb2673 Combine init_gi and init_sdfgi into a single init 2021-03-11 18:07:33 +11:00
Bastiaan Olij 52ab369d5f Renamed one more Forward render struct and fixed typo 2021-03-11 14:18:05 +11:00
Bastiaan Olij dfc41eb6f6 Moving RendererStorageRD *storage to protected, no sense duplicating it in forward_clustered 2021-03-11 13:24:23 +11:00
Bastiaan Olij a895844c82 Renaming RendererSceneRenderForward to RendererSceneRenderForwardClustered so we can introduce RendererSceneRenderForwardMobile 2021-03-10 22:34:50 +11:00
Rémi Verschelde 3856bc5afe
Merge pull request #46642 from BastiaanOlij/sdfgi_rename_and_cleanup
Renamed SDGIShader to SDFGIShader and moved a bunch of things to private
2021-03-08 08:22:48 +01:00
Ev1lbl0w 1f0b60c47d
Fix negative VRAM values 2021-03-05 21:48:20 +00:00
Bastiaan Olij 760be46a81 Renamed SDGIShader to SDFGIShader and moved a bunch of things to private 2021-03-04 11:53:09 +11:00
Bastiaan Olij 1f96ba5141 Moving GI code into RendererServerGIRD
Moving Skyshader code into RendererServerSkyRD
2021-02-25 15:15:48 +11:00
Clay John 32dec4accd
Merge pull request #45326 from clayjohn/VULKAN-ign-shadows
Use Interleaved gradient noise for shadow samples
2021-02-18 13:17:41 -08:00
reduz 64140eaf42 Reorganize Project Settings
-Advanced Settings toggle also hides advanced properties when disabled
-Simplified Advanced Bar (errors were just plain redundant)
-Reorganized rendering quality settings.
-Reorganized miscelaneous settings for clean up.
2021-02-18 11:23:34 -03:00
Kayomn fa8a47e1bf Fix math error in blend shape application tolerance 2021-02-17 10:30:29 +01:00
Rémi Verschelde e9a25b8552
Merge pull request #45859 from Kayomn/master
Accomodate blend shape ranges of -1 to +1 for Vulkan
2021-02-12 09:26:14 +01:00
Yuri Roubinsky dd0874e717 Allow passing varying from fragment to light shader function 2021-02-11 15:59:21 +03:00
reduz 8b19ffd810 Make Servers truly Thread Safe
-Rendering server now uses a split RID allocate/initialize internally, this allows generating RIDs immediately but initialization to happen later on the proper thread (as rendering APIs generally requiere to call on the right thread).
-RenderingServerWrapMT is no more, multithreading is done in RenderingServerDefault.
-Some functions like texture or mesh creation, when renderer supports it, can register and return immediately (so no waiting for server API to flush, and saving staging and command buffer memory).
-3D physics server changed to be made multithread friendly.
-Added PhysicsServer3DWrapMT to use 3D physics server from multiple threads.
-Disablet Bullet (too much effort to make multithread friendly, this needs to be fixed eventually).
2021-02-10 13:21:46 -03:00