NatronGitHub / Natron

Open-source video compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
http://NatronGitHub.github.io
GNU General Public License v2.0
4.64k stars 338 forks source link

Fix rendering bugs caused by intersecting rects with different mipMapLevels. #918

Closed acolwell closed 1 year ago

acolwell commented 1 year ago

Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. Additionally, make sure you've done all of these things:

PR Description

What type of PR is this? (Check one of the boxes below)

What does this pull request do?

This change fixes 2 bugs where RectI objects containing information for different mipMapLevels were being intersected with each other. This was causing visible compositing errors in the viewer when viewing the image zoomed out, partially clipped by the edge of the viewer, and then pressing the "Forces a new render for the current frame" button. This fix just makes sure the RectIs are converted to the proper mipMapLevel before being intersected.

I also included a few cleanup changes that do not modify existing functionality but make the code a little easier to follow and verify correctness.

Show a few screenshots (if this is a visual change)

RenderingBeforeBugFix RenderingAfterBugFix

Have you tested your changes (if applicable)? If so, how?

Yes. I've verified that my change fixes the rendering issues as shown in the image above.

Futher details of this pull request

These changes likely fix rendering issues in other scenarios as well. The one mentioned above is the easily repeatable one that I discovered and used for testing.

Technically, the isSupportedRenderScale() change isn't entirely necessary, but I noticed the cleanup opportunity while updating the rod code.