Skip to content

Conversation

@JMS55
Copy link
Contributor

@JMS55 JMS55 commented Jan 9, 2026

Objective

  • Improve denoising of mirror reflections (removes cross-hatching when static, and ghosting in motion)

Solution

Showcase

Before
image

After
image

let specular_motion_vector = calculate_motion_vector(virtual_position, virtual_previous_frame_position);

let F0 = calculate_F0(ray_hit.material.base_color, ray_hit.material.metallic, ray_hit.material.reflectance);
let wo = normalize(view.world_position - virtual_position);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not entirely sure about calculating wo like this for env_brdf_approx2, but it makes sense to me. Let me know what reviewers think.

@JMS55 JMS55 added A-Rendering Drawing game state to the screen C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. labels Jan 9, 2026
@JMS55 JMS55 added this to the 0.19 milestone Jan 9, 2026
@JMS55 JMS55 requested a review from SparkyPotato January 9, 2026 16:00
@JMS55
Copy link
Contributor Author

JMS55 commented Jan 9, 2026

This PR somehow broke Solari when compiling without DLSS. I need to figure out why.

let wo = normalize(view.world_position - virtual_position);
let virtual_normal = normalize(mirror_rotations * ray_hit.world_normal);

textureStore(specular_motion_vectors, pixel_id, vec4(specular_motion_vector, vec2(0.0)));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are specular motion vectors meant to be used with PSR?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so? It's a little hard to find literature on it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a noticeable difference in image quality in motion when they're set vs just defaulted to 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it, and I don't think so. Maybe it matters for more complex situations? Idk really.

@alice-i-cecile alice-i-cecile added the S-Needs-Review Needs reviewer attention (from anyone!) to move forward label Jan 11, 2026
Copy link
Contributor

@atlv24 atlv24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clear improvement in the showcase, and nothing egregious in the code.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jan 14, 2026
@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jan 14, 2026
Merged via the queue into bevyengine:main with commit 912214a Jan 14, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Rendering Drawing game state to the screen C-Refinement Improves output quality, without fixing a clear bug or adding new functionality. S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants