Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libobs: Use floating point textures when loading floating point image files #10605

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lain-B
Copy link
Collaborator

@Lain-B Lain-B commented Apr 26, 2024

Description

Allows the ability to open image files with floating point precision as floating point textures without unnecessarily downsampling to unsigned 8bit integer precision.

Motivation and Context

Someone told me that they were trying to load an image file with 32bit floating point precision per channel to do some sort of advanced shader stuff, and that important precision information was being lost. They didn't know why. I noticed that they were being converted away to 8bit unsigned integer RGBA unnecessarily despite the fact that we supported the texture format natively, so I just fixed it in like 5 minutes.

How Has This Been Tested?

Tested it with a .tiff file containing 32bit floating point precision RGBA file, opened it with an image source, checked the debugger to make sure the code path was being executed, checked the visible result, everything checked out.

Types of changes

  • Tweak (non-breaking change to improve existing functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

Certain file types (such as .tiff) can contain RGB data of floating
point bit depth. This allows reading that data as-is without
unnecessarily converting it to a lower bit depth.
@Lain-B Lain-B added the Enhancement Improvement to existing functionality label Apr 26, 2024
@tytan652
Copy link
Collaborator

tytan652 commented May 4, 2024

Use of AV_PIX_FMT_RGBAF32LE and AV_PIX_FMT_RGBAF16LE need to be guarded behind libavutil version from FFmpeg 6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants