Commit Graph

63 Commits

Author SHA1 Message Date
e956e80c1f Style: clang-format: Disable AllowShortIfStatementsOnASingleLine
Part of #33027, also discussed in #29848.

Enforcing the use of brackets even on single line statements would be
preferred, but `clang-format` doesn't have this functionality yet.
2020-05-10 13:12:16 +02:00
03b13e0c69 Style: Add missing copyright headers 2020-05-10 13:12:16 +02:00
ec7b481170 Renamed plane's d to distance 2020-05-10 12:12:51 +02:00
3a11baaeac Turn the anisotropic filtering setting into an enum
Since it only accepts power-of-two values, exposing it as an enum
makes more sense. This also allows for adding property hints to indicate
the performance cost of each value.

This also improves property hints for MSAA and FXAA.
2020-05-08 12:07:35 +02:00
bef52957d0 Merge pull request #38226 from Calinou/increase-camera3d-fov
Increase the default Camera3D field of view to 75
2020-05-07 21:16:21 +02:00
34ee273e20 Calculate sun diameter even when not using shadows 2020-05-01 22:22:35 -07:00
ccc4f3899c Increase the default Camera3D field of view to 75
A vertical FOV of 75 degrees is roughly equivalent to a 91 degree
horizontal FOV on a 4:3 display (~107.51 degrees on 16:9),
which is close to the typical default FOV used in PC games.

Note that this doesn't apply to the in-editor camera which keeps its
FOV to 70. This is because it doesn't display in fullscreen;
its viewport only displays in the center of the editor (roughly).
This means the viewport won't cover the viewer's eyes as much. Therefore,
the editor camera FOV should be slightly lower to account for this.

Since this changes the default value, this may break existing projects
slightly.

For the record, this was already done in
https://github.com/godotengine/godot-demo-projects/pull/260
for the official demo projects.
2020-05-01 14:03:27 +02:00
b4a5bbaea2 Merge pull request #38337 from RandomShaper/time_rollback
Improve shader time roll over
2020-04-30 16:25:20 +02:00
f7706659b5 Improve shader time roll over
- Resurrect it for GL ES 2
- Add it to the Vulkan rasterizer
- Expose the setting from the `RenderingServer`, since it does not belong in any specific rasterizer
2020-04-30 11:42:11 +02:00
459cab99f4 Fixed unbounded dual-paraboloid shadow map culling.
Dual paraboloid shadowmaps were ending up with infinitely large volumes of area behind the hemisphere un-culled.

This change just adds a back plane to the convex shape used for the culling volume.
2020-04-29 19:24:43 -07:00
58435b0c91 Merge pull request #20371 from aaronfranke/vector-lerp
[Core] [Mono] [GDNative] Rename "linear_interpolate" methods to "lerp"
2020-04-29 15:50:00 +02:00
1d45a269f8 Merge pull request #38302 from qarmin/format_set
RasterizerStorageRD: Don't override format value
2020-04-29 14:16:52 +02:00
540156b387 [Core] Rename linear_interpolate to lerp 2020-04-29 04:02:49 -04:00
0bf6a86db4 Merge pull request #37795 from Chaosus/shader_fix_const_order2
Fix shader constant sorting
2020-04-29 09:41:34 +02:00
ad6bcea49d Don't override format value 2020-04-28 18:51:17 +02:00
0e9942a671 Fix copy paste array index bug 2020-04-28 18:26:57 +02:00
2bb119c088 Fix "redefinition of 'ssr' with a different type" shader compile error. 2020-04-23 13:56:04 +03:00
c5a721f58d Fix missing DEFVAL for RenderingDevice.index_buffer_create 2020-04-22 16:52:04 +02:00
f8ef38efed Add proper type to most public API uses of Array 2020-04-21 12:16:45 -03:00
ae09b55a19 Exposed RenderingDevice to script API
Also added an easier way to load native GLSL shaders.

Extras:

Had to fix no-cache for subresources in resource loader, it was not properly working, making shaders not properly reload.

Note:

The precommit hooks are broken because they don't seem to support enums from one class being used in another.
Feel free to fix this after merging this PR.
2020-04-20 21:21:58 -03:00
49d0c6a5c9 Ability to create local RenderingDevice instances. 2020-04-18 21:47:17 -03:00
17304f1aae Merge pull request #37949 from reduz/implement-global-shader-uniforms
Implement global and per instance shader uniforms.
2020-04-17 18:36:06 +02:00
cfda0e3770 Merge pull request #37953 from clayjohn/VULKAN-sky-sun-size
Add light size to Sky Shaders
2020-04-17 18:35:45 +02:00
7cd2ff309c Add light size to Sky Shaders 2020-04-17 09:32:24 -07:00
0e1c66d9fc Implement global and per instance shader uniforms.
Adds two keywords to shader language for uniforms:
-'global'
-'instance'

This allows them to reference values outside the material.
2020-04-17 12:35:41 -03:00
0ff929a926 Use sky properly for ambient and reflections 2020-04-16 23:45:30 -07:00
61d86190e0 Fix texture check in decal setup 2020-04-15 12:06:02 -07:00
6f293ed795 Add support for projectors in spot and omni lights. 2020-04-14 17:05:45 -03:00
5e5103f460 Merge pull request #37861 from reduz/implement-decals
Implement decals
2020-04-14 17:13:20 +02:00
5944eb6e7f Implement decals
Also implemented decal atlas, so projectors and other stuff can be added.
Sidenote: Had to make RID hashable, so some unrelated includes changed
in order to include it in hashfuncs.h
2020-04-14 11:13:34 -03:00
88c0a9e3de Fixes leak with CopyToFbShaderRD 2020-04-13 11:39:44 +02:00
06748a2b5f Merge pull request #37749 from clayjohn/Vulkan-improved-ss
Add vogel filter and settings to soft shadows
2020-04-13 00:39:37 +02:00
a57dc398db Implement MSAA 2020-04-12 15:33:57 -03:00
16ae2cc1bf Add screen space AA option, with FXAA implementation. 2020-04-12 10:57:18 -03:00
9dc19f7619 Merge pull request #37808 from reduz/port-effects-to-compute
Moved most of the effect code to compute.
2020-04-11 23:38:05 -03:00
d81911490b Moved most of the effect code to compute.
Simplifies it and improves performance.
Improves image barrier handling per mipmap on RenderingDeviceVulkan
2020-04-11 19:44:07 -03:00
636d4bad99 Merge pull request #37794 from clayjohn/VULKAN-SSS-sky
Fix SSS affecting Sky
2020-04-11 16:30:51 +02:00
bc30f541e6 Fix shader constant sorting 2020-04-11 12:40:17 +03:00
e3a9af2db1 Fix SSS affecting Sky 2020-04-11 01:20:24 -07:00
621f6f09a8 Add proper quality settings to soft shadows 2020-04-10 23:09:17 -07:00
d06f8ef75a Shows proper scene render time in editor info
Also fixed GPU profiler, which was not working on nvidia hardware.
2020-04-10 14:19:30 -03:00
a152ef9a10 Merge pull request #37662 from qarmin/rasterizer_server_last
Free items before finishing rendering server
2020-04-10 11:50:13 +02:00
c2f0d58c36 Merge pull request #37722 from reduz/implement-softshadows
Support light size and soft shadows
2020-04-10 10:24:57 +02:00
6a730ffeab Support light size and soft shadows 2020-04-09 15:11:15 -03:00
afc8c6391c Renaming all ARVR nodes to XR 2020-04-09 15:33:01 +10:00
4ffc0d6b3f Refactored shadowmapping.
- Made shadow bias size independent, so it will remain when changing light or camera size.
- Implemented normal offset bias, which greatly enhances quality.
- Added transmission to subsurface scattering
- Reimplemented shadow filter modes

Closes #17260
2020-04-08 11:19:43 -03:00
b5fd03fc36 Free items before finishing rendering server 2020-04-07 19:12:07 +02:00
853f677c7e Fixed leak with SpecularMergeShaderRD 2020-04-04 17:48:30 +02:00
c54f80d35c Re-implement subsurface scattering.
The size settings are more "just works", with default scale and depth scale
values that don't need much tweaking.

Additionally, a "skin" mode was added so skin looks better.
EDIT: Cleaned up SSR filter shader a bit.
2020-04-04 11:44:28 -03:00
aeb95ef006 Merge pull request #37438 from clayjohn/VULKAN-sky-invert
Invert Sky subpass cubemap z direction
2020-04-03 15:59:26 +02:00