Arseny Kapoulkine
92f2bc70dd
Relax motion vector updates to allow skipped frames for skeletons
...
Before this change, a skeleton that was not updated every frame would
result in a difference of 2+ between last_change and frame index every
frame, which would disable the buffer rotation and set motion vectors to
zero. This results in significant visual artifacts for FSR2 that are
especially prominent on the characters that move together with the view
such as the main character in third person mode.
This is a significant problem for high refresh rate displays: at 120 Hz,
we are effectively guaranteed to skip skeleton updates every other frame
with skeleton update happening during physics processing, and the lack
of physics interpolation for skeletons. This happens by default in TPS
demo when FSR2 is enabled.
In other places where motion vectors are disabled, such as multi-mesh
and mesh rendering (where previous transform is updated), the logic
effectively allows for a single-frame gap in updates, because it
compares the frame where the update happened (which is the current frame
if updates are consistent) with the current frame, so the latency of 0
means "update just happened", but both multi-mesh and mesh transform
updates permit a latency of 1 as well.
Here, however, last_change is updated *after* the frame processing has
concluded, so a zero-latency update has a distance of 1. Allowing a
distance of 2 (latency 1) reduces the severity of the problem and aligns
the logic with transform updates.
Note that the problem will still happen when refresh rate is noticeably
higher than physics rate times 2. For example, it still happens at 240
Hz. However, a longer latency allowance is inconsistent with other
transforms and could lead to issues, so ideally long term physical
interpolation of skeleton transforms would completely solve this.
2024-08-17 11:10:41 -07:00
Rémi Verschelde
5b6d9a7dd8
Merge pull request #95659 from clayjohn/RD-sky-affect
...
Ensure `fog_sky_affect` is used even when using a background color
2024-08-16 23:49:58 +02:00
clayjohn
37be585fdf
Ensure fog_sky_affect is used even when using a background color
2024-08-16 14:11:08 -07:00
kevinkuo52
3388a4a360
pass in render_info to _fill_instance_data for alpha to fix overdraw call count
2024-08-16 08:59:36 -07:00
Rémi Verschelde
664ff6f7c4
Merge pull request #95547 from Chaosus/shader_fix_for_middle_expression
...
Fix middle expression of `for` loop to accept not only operators
2024-08-16 14:36:10 +02:00
Rémi Verschelde
0f9925c0f9
Merge pull request #95542 from KoBeWi/go_bind_yourself
...
Remove empty `bind_methods()`
2024-08-16 14:35:51 +02:00
Rémi Verschelde
851d0a764d
Merge pull request #95536 from jsjtxietian/rename-alpha-scissor
...
Fix undefined `alpha_scissor` in standard shader
2024-08-16 14:35:38 +02:00
Rémi Verschelde
9c77f57a1d
Merge pull request #95350 from Chaosus/shader_fix_for_loop_comma_crash
...
Fix shader crash when the comma used in `for` loop as a trailing
2024-08-16 14:33:42 +02:00
Rémi Verschelde
d1706b0200
Merge pull request #95450 from clayjohn/RD-local-device
...
Fail when submit or sync called on main rendering device
2024-08-16 10:36:09 +02:00
Rémi Verschelde
afbcd0810f
Merge pull request #95438 from clayjohn/SSR-roughness-fix
...
Use transformed roughness instead of raw roughness to calculate roughness fade in SSR
2024-08-16 10:36:03 +02:00
Rémi Verschelde
94e9b2e2af
Merge pull request #95379 from SlashScreen/fix_dir_light_layers
...
Consider visual layers for DirectionalLight
2024-08-16 10:35:44 +02:00
Rémi Verschelde
b1c624beb5
Merge pull request #95270 from Lssikkes/ls-multimesh-reset-only
...
Fix for multimesh motion vector corruption
2024-08-16 10:35:26 +02:00
Rémi Verschelde
5098ac587e
Merge pull request #94896 from jsjtxietian/carry-subgroup
...
Fix uniform subgroup in shader will carry out to next group
2024-08-16 10:35:00 +02:00
Rémi Verschelde
46c6865979
Merge pull request #92391 from rburing/fti_3d
...
Physics interpolation (3D)
2024-08-16 10:33:37 +02:00
Chaosus
3272f00525
Fix middle expression of for
loop to accept not only operators
2024-08-15 10:29:19 +03:00
kobewi
065dd099dd
Remove empty bind_methods()
2024-08-15 08:24:32 +02:00
jsjtxietian
970a237c20
Fix undefined alpha_scissor
in standard shader
2024-08-15 11:44:11 +08:00
Slashscreen
4457b11ff0
Apply patch for considering visual layers for DirectionalLight
...
Co-authored-by: majikayogames <152851004+majikayogames@users.noreply.github.com>
2024-08-13 08:45:38 -07:00
clayjohn
b0e33aa00f
Fail when submit or sync called on main rendering device
...
Fail if submit or sync called multiple times in a row
2024-08-12 15:50:01 -07:00
clayjohn
b99d0d778a
Use transformed roughness instead of raw roughness to calculate roughness fade in SSR
2024-08-12 12:04:16 -07:00
Chaosus
d74749fd60
Fix shader crash when the comma used in for
loop as a trailing
2024-08-10 11:23:11 +03:00
Sen
52cd5acdda
Fix for multimesh motion vector corruption by resetting motion vector state and filling both halves of buffer
2024-08-08 16:19:31 +02:00
Jamie Pate
f8c99efc3b
Fix LightmapGI causes crash when using --headless
...
Fixes #89119
Add dummy LightmapInstance and Lightmap resources for headless rendering
Prevents the RenderingServer from crashing when it accesses
lightmap_instance->base_data
2024-08-07 11:38:05 +02:00
Rémi Verschelde
52f22902c7
Merge pull request #94902 from clayjohn/SHADER-hints
...
Restrict sampler hint validation to only screen texture hints
2024-07-30 12:29:04 +02:00
clayjohn
a2f2699208
Restrict sampler hint validation to only screen texture hints
2024-07-28 22:31:57 -07:00
jsjtxietian
e6c45fbe5d
Fix uniform subgroup in shader will carry out to next group
2024-07-29 11:07:09 +08:00
Bastiaan Olij
1eb0039b6e
Fix regression around OpenGL swapchain optimisation for OpenXR
2024-07-29 12:46:58 +10:00
clayjohn
ba3457dfff
Emit normal_roughness compatibility code in custom functions
2024-07-26 10:45:36 -07:00
jsjtxietian
38fad35356
Fix editor crash when shader has incorrect global array declaration
2024-07-26 11:53:11 +08:00
BlueCube3310
eb3b217777
RenderingDevice: Use the correct amount of layers for Cubemaps for boundary checks
2024-07-24 20:26:46 +02:00
Rémi Verschelde
62c88a4052
Merge pull request #94671 from Chaosus/shader_fix_varying
...
Fix shader crash when using a varying in separate func before it defined
2024-07-24 09:59:31 +02:00
Rémi Verschelde
139cf025c9
Merge pull request #94629 from RandomShaper/fix_undef_position
...
Fix position from vertex shader partially uninitialized
2024-07-24 09:59:24 +02:00
Feiyue Zhang
6f30df4b6a
Linearize color if HDR 2D is on
2024-07-24 09:49:50 +02:00
Yuri Rubinsky
965b2f6ca4
Fix shader crash when using a varying in separate func before it defined
2024-07-23 21:55:18 +03:00
BlueCube3310
741bb152ae
RenderingDevice: Fix getting cubemap data
2024-07-23 13:44:28 +02:00
Pedro J. Estébanez
0064532c1e
Fix position from vertex shader partially uninitialized
2024-07-23 09:04:54 +02:00
Yuri Rubinsky
574e61a542
Fix crash when assigning more textures than expected to texture array
2024-07-22 20:51:11 +03:00
Rémi Verschelde
587f1d0cb0
Merge pull request #92817 from Alex2782/fix_glsl_Mali-G
...
Fix glsl shader for Android Mali-GXXx GPUs and Vulkan API 1.3.xxx
2024-07-22 17:24:04 +02:00
Alexander Hartmann
78ede4f8b6
Fix glsl shader for Android Mali-GXXx GPUs and Vulkan API 1.3.xxx
2024-07-20 22:01:35 +02:00
Garteal
2606831d71
SDFGI: fix crash if update_data is nullptr
2024-07-19 18:27:32 +02:00
Rémi Verschelde
47e99d55b3
Merge pull request #94388 from BastiaanOlij/expose_more_methods_scene_buffers_rd
...
Expose more state in RenderSceneBuffersRD
2024-07-19 11:10:46 +02:00
Rémi Verschelde
ceb1801db2
Merge pull request #94492 from jsjtxietian/fsr-1
...
Add warning when use FSR1 on renderer other than forward plus
2024-07-18 10:45:50 +02:00
Rémi Verschelde
0f1e2c38a8
Merge pull request #94069 from RandomShaper/fix_vk_vali_blocky
...
RenderingDevice: Leave handling of compressed block granularity to the driver
2024-07-18 10:45:27 +02:00
Rémi Verschelde
590628feda
Merge pull request #86516 from jsjtxietian/fix-camera-direction
...
Fix incorrect `CAMERA_DIRECTION_WORLD` calculation
2024-07-18 10:45:20 +02:00
jsjtxietian
46ed290fef
Add warning when use FSR1 on renderer other than forward plus
2024-07-18 12:10:18 +08:00
Rémi Verschelde
a963f111cb
Merge pull request #94462 from jsjtxietian/more-type
...
Make ShaderLanguage's parser recognize sampler passed in from array
2024-07-17 12:24:11 +02:00
Rémi Verschelde
c5e5fa3d9f
Merge pull request #94289 from clayjohn/MOBILE-multimesh-spec-constant
...
Use a spec constant to control whether the MultiMesh branch is used in the vertex shader.
2024-07-17 12:24:01 +02:00
Rémi Verschelde
c2375d0b12
Merge pull request #94184 from mertkasar/ssr-rotation-fix
...
Fix SSR orientation issues when using orthogonal camera
2024-07-17 11:43:25 +02:00
Rémi Verschelde
0268ceaa5c
Merge pull request #94064 from bruvzg/lcd_aa_modulate
...
Fix LCD font AA modulation in RendererRD.
2024-07-17 11:43:03 +02:00
jsjtxietian
3859817614
Make shaderLanguage's parser recognize sampler passed in from array
2024-07-17 16:52:44 +08:00