Skip to content

Conversation

Aqil-Ahmad
Copy link

Description

Fixes texture transforms being reset when switching from Blinn-Phong to PBR materials and between PBR. Previously, custom scale, offset, and rotation settings would be lost, making it tedious to switch between PBR materials.

Related Issues

Issue Link: #4195


Checklist

Please ensure the following before requesting review:

  • I have provided a clear title and detailed description for this pull request.
  • If useful, I have included media such as screenshots and video to show off my changes.
  • The PR is linked to a relevant issue with sufficient context.
  • I have tested the changes locally and verified they work as intended.
  • All new and existing tests pass.
  • Code follows the project's style guidelines.
  • Documentation has been updated if needed.
  • Any dependent changes have been merged and published in downstream modules
  • I have reviewed the contributing guidelines.

Additional Notes

scndLife_vid.mp4

@github-actions github-actions bot added the c/cpp label Sep 20, 2025
@akleshchev
Copy link
Contributor

akleshchev commented Sep 23, 2025

pre-commit fails due to spaces.
Build fails due to outdated branch, I suggest updating to a newer develop (and updating your local build variables then wiping build folder)

I might be missing something, but the variant from previous PR looked better, sans lack of convertTextureTransformToPBR.

@Aqil-Ahmad
Copy link
Author

pre-commit fails due to spaces. Build fails due to outdated branch, I suggest updating to a newer develop (and updating your local build variables then wiping build folder)

I might be missing something, but the variant from previous PR looked better, sans lack of convertTextureTransformToPBR.

In the previous PR, applying PBR had an issue: texture values were only preserved in the preview. When clicking OK, the values reset to defaults (though changing them after applying PBR did preserve them). In addition, PBR-to-PBR conversions didn’t preserve values and subsequent PBRs still picked up texture values.

@akleshchev
Copy link
Contributor

akleshchev commented Sep 25, 2025

When clicking OK, the values reset to defaults

I suspect that's the issue with queueApply, basically doing 'queueApply(hit_obj, hit_face, NEW_asset_id, preserved_override)' works fine, but doing 'queueApply(hit_obj, hit_face, OLD_asset_id, preserved_override)' would ignore preserved_override and drop the overrides.

If that's indeed the cause, the solution is to compare current material id and if it didn't change then not send anything at 'OK', nothing changed after all.

@Aqil-Ahmad
Copy link
Author

If that's indeed the cause, the solution is to compare current material id and if it didn't change then not send anything at 'OK', nothing changed after all.

You were right: the OK issue came from calling queueApply with the same material ID, which cleared overrides.
I tried to preserve values in the PBR→PBR case but couldn’t get it to work; I suspect a clear-then-override ordering, even though the local logic looks correct.

@akleshchev
Copy link
Contributor

I tried to preserve values in the PBR→PBR case but couldn’t get it to work;

I think it did work in your closed PR with a 'drag&drop material over previous material' case.

@Aqil-Ahmad Aqil-Ahmad force-pushed the feature/pbr-transform-persistence branch from ffb5637 to cc84959 Compare September 28, 2025 20:01
@bennettgoble
Copy link
Member

@Aqil-Ahmad, @akleshchev has done some investigation and determined that we are blocked from completing this feature because of a server-side issue. I'd like to propose the following:

  1. We pay you out for the reward for your work so far: your efforts are appreciated and this problem is on our end
  2. We close this PR and the related issue until the issue is fixed on our server

@github-actions github-actions bot locked and limited conversation to collaborators Sep 29, 2025
@akleshchev akleshchev reopened this Sep 29, 2025
@akleshchev
Copy link
Contributor

akleshchev commented Sep 29, 2025

P.S. I will create a server ticket to fix it.

I was wrong and it was a viewer issue, fixed. Please update from develop.

I tested code from this PR (removed everythign from llpanelface.cpp and from llgltfmateriallist.cpp sans convertTextureTransformToPBR ) and the only issue appears to be a missed existing_override check (convertTextureTransformToPBR fires in case of a pbr-pbr transition), otherwise everything works as expected.

@Aqil-Ahmad Aqil-Ahmad force-pushed the feature/pbr-transform-persistence branch from cc84959 to c505d35 Compare September 30, 2025 15:00
@Aqil-Ahmad Aqil-Ahmad force-pushed the feature/pbr-transform-persistence branch from c505d35 to 1446d59 Compare October 3, 2025 14:54
@akleshchev akleshchev linked an issue Oct 3, 2025 that may be closed by this pull request
@Aqil-Ahmad Aqil-Ahmad requested a review from akleshchev October 4, 2025 17:02
sApplyQueue.push_back({ obj->getID(), side, asset_id, material });
}

if (sUpdates.size() >= MAX_TASK_UPDATES)
Copy link
Contributor

@akleshchev akleshchev Oct 4, 2025

Choose a reason for hiding this comment

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

Why are you removing this part?

A 'send' happening here is a questianable practice, but removal doesn't seem relevant to transform preservation. Otherwise changes seem solid if a bit too many repeats of the same code.

@secondlife secondlife unlocked this conversation Oct 4, 2025
Copy link
Contributor

@akleshchev akleshchev left a comment

Choose a reason for hiding this comment

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

Did some additional testing and everything seems to be in order, will squash tommorow then remove the 'material list not sending' part since that seems to be unintended result from a merge conflict.

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

Successfully merging this pull request may close these issues.

Make Scale/Offset/Rotation PERSIST when switching PBR Materials
3 participants