Skip to content

fix(texture): fix texture overblur with st-blur parameters#5071

Merged
lgritz merged 7 commits intoAcademySoftwareFoundation:mainfrom
lecocqp:fix-texture-blur-overestimate
Mar 7, 2026
Merged

fix(texture): fix texture overblur with st-blur parameters#5071
lgritz merged 7 commits intoAcademySoftwareFoundation:mainfrom
lecocqp:fix-texture-blur-overestimate

Conversation

@lecocqp
Copy link
Copy Markdown
Contributor

@lecocqp lecocqp commented Mar 5, 2026

Fixes #5069

This PR fixes the texture blur overstimate reported in #5069

We provide the following changes:

  • Use the mathematically correct Pythagorean form to properly adjust the ellispse footprint with st-blur parameters.
  • Add a new legacy_texture_blur attribute in TextureSystem to opt into the fix without breaking existing renders.
  • Add a new --fix-texture-blur option in testtex to enable the fix.
  • Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding assistant.

Checklist:

  • I have read the guidelines on contributions and code review procedures.
  • I have updated the documentation if my PR adds features or changes
    behavior.
  • I am sure that this PR's changes are tested somewhere in the
    testsuite
    .
  • I have run and passed the testsuite in CI before submitting the
    PR, by pushing the changes to my fork and seeing that the automated CI
    passed there. (Exceptions: If most tests pass and you can't figure out why
    the remaining ones fail, it's ok to submit the PR and ask for help. Or if
    any failures seem entirely unrelated to your change; sometimes things break
    on the GitHub runners.)
  • My code follows the prevailing code style of this project and I
    fixed any problems reported by the clang-format CI test.
  • If I added or modified a public C++ API call, I have also amended the
    corresponding Python bindings. If altering ImageBufAlgo functions, I also
    exposed the new functionality as oiiotool options.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Mar 5, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@lecocqp lecocqp changed the title fix(texture): fix fix(texture): fix texture overblur with st-blur parameters Mar 5, 2026
@lecocqp lecocqp force-pushed the fix-texture-blur-overestimate branch 6 times, most recently from c2a8f95 to 51c2b9b Compare March 5, 2026 22:41
@lecocqp
Copy link
Copy Markdown
Contributor Author

lecocqp commented Mar 6, 2026

@lgritz, I think the PR is in good shape now and ready for review.

Last changes provided:

  • Rename the TextureSystem fix_texture_blur attribute to legacy_texture_blur and default it to false
  • Rename testtex option to --legacy-texture-blur and default it to false.
  • Modify texture-blurfix test to check the fixed blur and the old legacy blur.

@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented Mar 6, 2026

@lecocqp Can you rebase on top of the current main, I think I have fixed a number of pesky intermittent CI failures that are unrelated to your changes.

Comment on lines +2575 to +2576
} else if (name == "legacy_texture_blur" && type == TypeDesc::INT) {
m_legacy_texture_blur = (*(const int*)val != 0);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I suspect that the new field and handling of it should be in the TextureSystem and not in the ImageCache?

There is a division of labor here, and things specific to texture filtering go in the TextureSystem, while things related the file reads and tile caching policy are part of the ImageCache. Requests to the TS to set attributes in the underlying IC are just passed down transparently, so that from the renderer level, you can just set texturesys->attribute(...) and not need to know what lives where.

Copy link
Copy Markdown
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

Other than my comment about in which class the new field should live, it LGTM

@lecocqp lecocqp force-pushed the fix-texture-blur-overestimate branch 2 times, most recently from 11afd1b to 93e1e4b Compare March 7, 2026 00:22
@lecocqp lecocqp requested a review from lgritz March 7, 2026 00:37
@lecocqp
Copy link
Copy Markdown
Contributor Author

lecocqp commented Mar 7, 2026

I moved the new legacy_texture_blur attribute handling in TextureSystemImpl as you suggested.

I also rebased my branch on top of main, but I'm still seeing some CI failures.

@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented Mar 7, 2026

I also rebased my branch on top of main, but I'm still seeing some CI failures.

Random CI failures have really been kicking my ass all week. These don't seem to be related to your PR.

Copy link
Copy Markdown
Collaborator

@lgritz lgritz left a comment

Choose a reason for hiding this comment

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

LGTM!

I'll merge as soon as CI is finished. (And pending your acceptance of my #if suggestion.)

@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented Mar 7, 2026

Holy shit, why does every edit seem to fail MORE tests in CI, and none of them are related to this PR as near as I can tell? What is happening to the GitHub runners?

lecocqp and others added 7 commits March 7, 2026 00:58
This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the ellispse extents.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
…xture_blur` and default it to false

* Rename testtex option to `--legacy-texture-blur` and default it to false.
* Modify texture-blurfix test to check the fixed correct blur and the old legacy blur.

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Co-authored-by: Larry Gritz <lg@larrygritz.com>
Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz lgritz force-pushed the fix-texture-blur-overestimate branch from 7d4194d to 3b254ae Compare March 7, 2026 08:58
@lgritz
Copy link
Copy Markdown
Collaborator

lgritz commented Mar 7, 2026

I rebased this again, in the hopes that on top of the other fixes I merged, we'll finally pass CI. If it does, I will merge it as well.

@lgritz lgritz merged commit 30142ed into AcademySoftwareFoundation:main Mar 7, 2026
63 checks passed
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Mar 7, 2026
…ftwareFoundation#5071)

Fixes AcademySoftwareFoundation#5069

This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the
ellispse footprint with st-blur parameters.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into
the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding
assistant.

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Mar 7, 2026
…ftwareFoundation#5071)

Fixes AcademySoftwareFoundation#5069

This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the
ellispse footprint with st-blur parameters.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into
the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding
assistant.

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
lgritz pushed a commit that referenced this pull request Mar 11, 2026
The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of #5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Mar 12, 2026
…ndation#5080)

The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of AcademySoftwareFoundation#5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Mar 12, 2026
…ndation#5080)

The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of AcademySoftwareFoundation#5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ftwareFoundation#5071)

Fixes AcademySoftwareFoundation#5069

This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the
ellispse footprint with st-blur parameters.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into
the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding
assistant.

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ndation#5080)

The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of AcademySoftwareFoundation#5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ftwareFoundation#5071)

Fixes AcademySoftwareFoundation#5069

This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the
ellispse footprint with st-blur parameters.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into
the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding
assistant.

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ndation#5080)

The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of AcademySoftwareFoundation#5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad (Kuzmin) Erium <libalias@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ftwareFoundation#5071)

Fixes AcademySoftwareFoundation#5069

This PR fixes the texture blur overstimate reported in AcademySoftwareFoundation#5069

We provide the following changes:
* Use the mathematically correct Pythagorean form to properly adjust the
ellispse footprint with st-blur parameters.
* Add a new legacy_texture_blur attribute in TextureSystem to opt into
the fix without breaking existing renders.
* Add a new --fix-texture-blur option in testtex to enable the fix.
* Add a new texture-blurfix test.

Note: This PR has been partially edited using the Claude coding
assistant.

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
ssh4net pushed a commit to ssh4net/OpenImageIO that referenced this pull request Apr 1, 2026
…ndation#5080)

The m_legacy_texture_blur flag is set in TextureSystemImpl::Init, which
overrides the default initialisation depending on the OIIO version.

In other words, the texture blur fix was always enabled, regardless of
the OIIO version.

I also updated the help description for this flag in testtex.

This fixes minor shortcomings of AcademySoftwareFoundation#5071

---------

Signed-off-by: Pascal Lecocq <pascal.lecocq@gmail.com>
Signed-off-by: Vlad <shaamaan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Textures are over-blurred when the st-blur parameter is used.

2 participants