You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-31 18:41:20 +00:00
Merge pull request #114227 from BastiaanOlij/fix_asp_regression
Fix OpenGL motion vector regression
This commit is contained in:
@@ -2411,8 +2411,8 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
|
|||||||
|
|
||||||
scene_state.data.emissive_exposure_normalization = -1.0; // Use default exposure normalization.
|
scene_state.data.emissive_exposure_normalization = -1.0; // Use default exposure normalization.
|
||||||
|
|
||||||
bool enough_vertex_attribs_for_motion_blue = GLES3::Config::get_singleton()->max_vertex_attribs >= 22;
|
bool enough_vertex_attribs_for_motion_vectors = GLES3::Config::get_singleton()->max_vertex_attribs >= 22;
|
||||||
if (rt && rt->overridden.velocity_fbo != 0 && enough_vertex_attribs_for_motion_blue) {
|
if (rt && rt->overridden.velocity_fbo != 0 && enough_vertex_attribs_for_motion_vectors) {
|
||||||
// First frame we render motion vectors? Use our current data!
|
// First frame we render motion vectors? Use our current data!
|
||||||
if (scene_state.prev_data_state == 0) {
|
if (scene_state.prev_data_state == 0) {
|
||||||
scene_state.prev_data_state = 1;
|
scene_state.prev_data_state = 1;
|
||||||
@@ -2534,7 +2534,7 @@ void RasterizerSceneGLES3::render_scene(const Ref<RenderSceneBuffers> &p_render_
|
|||||||
scene_state.reset_gl_state();
|
scene_state.reset_gl_state();
|
||||||
|
|
||||||
GLuint motion_vectors_fbo = rt ? rt->overridden.velocity_fbo : 0;
|
GLuint motion_vectors_fbo = rt ? rt->overridden.velocity_fbo : 0;
|
||||||
if (motion_vectors_fbo != 0 && enough_vertex_attribs_for_motion_blue) {
|
if (motion_vectors_fbo != 0 && enough_vertex_attribs_for_motion_vectors) {
|
||||||
RENDER_TIMESTAMP("Motion Vectors Pass");
|
RENDER_TIMESTAMP("Motion Vectors Pass");
|
||||||
glBindFramebuffer(GL_FRAMEBUFFER, motion_vectors_fbo);
|
glBindFramebuffer(GL_FRAMEBUFFER, motion_vectors_fbo);
|
||||||
|
|
||||||
|
|||||||
@@ -231,7 +231,10 @@ layout(std140) uniform SceneDataBlock { // ubo:2
|
|||||||
scene_data_block;
|
scene_data_block;
|
||||||
|
|
||||||
#ifdef RENDER_MOTION_VECTORS
|
#ifdef RENDER_MOTION_VECTORS
|
||||||
layout(std140) uniform SceneData prev_scene_data; // ubo:12
|
layout(std140) uniform PrevSceneDataBlock { // ubo:12
|
||||||
|
SceneData data;
|
||||||
|
}
|
||||||
|
prev_scene_data_block;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef RENDER_MOTION_VECTORS
|
#ifndef RENDER_MOTION_VECTORS
|
||||||
@@ -464,7 +467,10 @@ layout(std140) uniform MultiviewDataBlock { // ubo:8
|
|||||||
multiview_data_block;
|
multiview_data_block;
|
||||||
|
|
||||||
#ifdef RENDER_MOTION_VECTORS
|
#ifdef RENDER_MOTION_VECTORS
|
||||||
layout(std140) uniform MultiviewData prev_multiview_data; // ubo:13
|
layout(std140) uniform PrevMultiviewDataBlock { // ubo:13
|
||||||
|
MultiviewData data;
|
||||||
|
}
|
||||||
|
prev_multiview_data_block;
|
||||||
#endif // RENDER_MOTION_VECTORS
|
#endif // RENDER_MOTION_VECTORS
|
||||||
|
|
||||||
#endif // USE_MULTIVIEW
|
#endif // USE_MULTIVIEW
|
||||||
@@ -909,7 +915,7 @@ void main() {
|
|||||||
compressed_aabb_position,
|
compressed_aabb_position,
|
||||||
prev_world_transform,
|
prev_world_transform,
|
||||||
model_flags,
|
model_flags,
|
||||||
prev_scene_data.data,
|
prev_scene_data_block.data,
|
||||||
#ifdef USE_INSTANCING
|
#ifdef USE_INSTANCING
|
||||||
input_instance_xform0, input_instance_xform1, input_instance_xform2,
|
input_instance_xform0, input_instance_xform1, input_instance_xform2,
|
||||||
input_instance_color_custom_data,
|
input_instance_color_custom_data,
|
||||||
@@ -927,9 +933,9 @@ void main() {
|
|||||||
uv2_attrib,
|
uv2_attrib,
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_MULTIVIEW
|
#ifdef USE_MULTIVIEW
|
||||||
prev_multiview_data.projection_matrix_view[ViewIndex],
|
prev_multiview_data_block.data.projection_matrix_view[ViewIndex],
|
||||||
prev_multiview_data.inv_projection_matrix_view[ViewIndex],
|
prev_multiview_data_block.data.inv_projection_matrix_view[ViewIndex],
|
||||||
prev_multiview_data.eye_offset[ViewIndex].xyz,
|
prev_multiview_data_block.data.eye_offset[ViewIndex].xyz,
|
||||||
#endif
|
#endif
|
||||||
uv_scale,
|
uv_scale,
|
||||||
prev_clip_position);
|
prev_clip_position);
|
||||||
|
|||||||
Reference in New Issue
Block a user