secondlife / jira-archive

3 stars 0 forks source link

[BUG-227673] issues with bakes-on-mesh and alpha modes #5903

Closed sl-service-account closed 9 months ago

sl-service-account commented 5 years ago

What just happened?

Incorrect viewer rendering of a bakes-on-mesh texture on a mesh avatar when assigning the texture and alpha blend mode via script

What were you doing when it happened?

I'm working on the updates to the Tonic mesh bodies and other things to support bakes-on-mesh. In developing the script code for this I stumbled upon an issue where when applying the bakes-on-mesh texture to the prim in the linkset with an alpha blend mode of MASK does not work every time.

It's a bit annoying to repeat, but the steps are like this:

wear mesh, assign the bakes-on-mesh textures to the mesh with the alpha blend mode set to NONE (via script).

If you right click edit the mesh and look at the texture you'll see that it's the baked texture if you click on the texture.

Next, keeping the mesh on, assign the bakes-on-mesh texture and set the alpha blend mode to MASK with a value of 128 again using a script (NOT USING THE in world prim editor). Nothing will change. If you right click edit the prim again you will see what is wrong (I've attached a screen snapshot).

Notice how the alpha mode is NONE but it should be mask because that's what the script did (you can see that I was verifying the script behavior in the chat log - my message saying "skin alpha_mode 2..." is confirming that the arguments about to be passed to llSetLinkPrimitiveParamsFast are correct.

Now if you take that mesh off and put it back on, Voila! it will be correct and the mode when editing the prim will show MASK.

What were you expecting to happen instead?

What I expect to see is that the blend mode should be MASK not NONE as that is what the script has set.

Other information

I was trying to debug using system clothing layer alpha masks when combined with my bakes-on-mesh body and seeing strange behavior.

Attachments

Original Jira Fields | Field | Value | | ------------- | ------------- | | Issue | BUG-227673 | | Summary | issues with bakes-on-mesh and alpha modes | | Type | Bug | | Priority | Unset | | Status | Closed | | Resolution | Accepted | | Labels | bakesonmesh | | Reporter | Fizz Savira (fizz.savira) | | Created at | 2019-09-26T23:43:55Z | | Updated at | 2022-11-30T15:02:40Z | ``` { 'Build Id': 'unset', 'Business Unit': ['Platform'], 'Date of First Response': '2019-09-27T12:25:16.137-0500', "Is there anything you'd like to add?": 'I was trying to debug using system clothing layer alpha masks when combined with my bakes-on-mesh body and seeing strange behavior.', 'ReOpened Count': 0.0, 'Severity': 'Unset', 'System': 'SL Viewer', 'Target Viewer Version': 'viewer-development', 'What just happened?': 'Incorrect viewer rendering of a bakes-on-mesh texture on a mesh avatar when assigning the texture and alpha blend mode via script', 'What were you doing when it happened?': 'I\'m working on the updates to the Tonic mesh bodies and other things to support bakes-on-mesh. In developing the script code for this I stumbled upon an issue where when applying the bakes-on-mesh texture to the prim in the linkset with an alpha blend mode of MASK does not work every time.\r\n\r\nIt\'s a bit annoying to repeat, but the steps are like this:\r\n\r\nwear mesh, assign the bakes-on-mesh textures to the mesh with the alpha blend mode set to NONE (via script).\r\n\r\nIf you right click edit the mesh and look at the texture you\'ll see that it\'s the baked texture if you click on the texture.\r\n\r\nNext, keeping the mesh on, assign the bakes-on-mesh texture and set the alpha blend mode to MASK with a value of 128 again using a script (NOT USING THE in world prim editor). Nothing will change. If you right click edit the prim again you will see what is wrong (I\'ve attached a screen snapshot).\r\n\r\nNotice how the alpha mode is NONE but it should be mask because that\'s what the script did (you can see that I was verifying the script behavior in the chat log - my message saying "skin alpha_mode 2..." is confirming that the arguments about to be passed to llSetLinkPrimitiveParamsFast are correct.\r\n\r\nNow if you take that mesh off and put it back on, Voila! it will be correct and the mode when editing the prim will show MASK.\r\n', 'What were you expecting to happen instead?': 'What I expect to see is that the blend mode should be MASK not NONE as that is what the script has set.', 'Where': 'http://maps.secondlife.com/secondlife/Tonic%20Water/101/211/1001', } ```
sl-service-account commented 5 years ago

Kyle Linden commented at 2019-09-27T17:25:16Z

Hi Fizz,

I follow what you're saying and this certainly sounds plausible given some of the known issues with Bakes on Mesh presently. Will you provide some sample content and the script for a reproduction case. You may pass this content directly to Dan Linden and Kyle Linden.

Additionally, can you reproduce similar results using mesh content and scripted alpha updates on the release viewer immediately prior to Bakes on Mesh? That is LMR#3 which you can download here: https://releasenotes.secondlife.com/viewer/6.2.4.529638.html

This will help us determine if it is an issue new to Bakes on Mesh.

NOTE: You will need to update your viewer settings to opt-out of automatic updates in Me > Preferences > Setup > Software updates before you install the older viewer. Once done with the experiment, remember to restore these preferences.

Please press the Info Provided button when you have updated this issue.

Thanks!

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-01T19:00:22Z

Sorry for the delay - I'm working on a simplified test case and of course that's working fine. I will update once I have the test case available.

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-01T21:05:26Z

I have sent a folder to both Kyle and Dan Linden with the test object and script plus a notecard with instructions on how to use all of that.

 

 

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-01T21:32:01Z

I am updating the specifics of the bug here after doing some testing to be able to carefully reproduce the issue.

It boils down to this: apply the texture TEXTURE_BLANK with alpha mode of MASK to a prim; look at the PRIM and you will see that the displayed alpha mode is not MASK but is grayed out. Update the texture via script to BAKED_whatver with alpha mode of MASK and then again edit the prim and you will see an alpha mode of NONE instead of MASK.

 

I believe this is an old (but important) rendering glitch - I had issues in the past with appliers sometimes rendering incorrectly on my mesh body products. Eventually I gave up trying to solve it and switched my scripts over to force the alpha mode to BLEND and it seemed to clear up the issue.

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-01T21:37:12Z

One more (hopefully) detail to help reproduce this - wear a partial classic alpha mask somewhere on BAKED_UPPER. Doing that seems to make the test more reliable. Also, there is a typo in the chat messages - it says "none" where it means mask as I updated the test but forgot the chat message oops.

sl-service-account commented 5 years ago

Kyle Linden commented at 2019-10-03T18:02:39Z

Hi Fizz,

Thank you for all of the details and testing. We have reviewed the contents and the script and have a follow up question.

If you change the order of operations to set the texture to one that supports alpha modes (so not using the default blank) and then use LSL to change the alpha mode, does the issue still reproduce?

The viewer UI doesn't permit using alpha modes when opaque textures are used.

Please let us know and press the Info Provided button when you update this report.

Thanks!

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-03T21:27:12Z, updated at 2019-10-03T21:27:30Z

I have provided an updated test as requested (sent to Kyle Linden). And no surprise, the viewer gets the mode correct when transitioning from a diffuse texture with alpha to the BOM texture when using mask for blend modes. That's nice and all, but not a solution.

TEXTURE_BLANK is just one example of how the prims in question can have a texture with no alpha and mask mode and go to a texture with alpha and mask mode. An example is wearing an applier texture made by some 3rd party that has no alpha and then switching to the BOM baked texture.

sl-service-account commented 5 years ago

Fizz Savira commented at 2019-10-03T21:28:15Z

See my comment already added :)

sl-service-account commented 5 years ago

Whirly Fizzle commented at 2019-10-04T17:29:35Z, updated at 2019-10-04T17:30:00Z

Using the first test kit with TEXTURE_BLANK.

sl-service-account commented 5 years ago

Kyle Linden commented at 2019-10-04T17:39:19Z

Hi Fizz,

Thanks for the updated information. Importing as a bug.

Thanks!

sl-service-account commented 1 year ago

AndreyK ProductEngine commented at 2022-11-30T15:02:40Z

Pushed a fix into DRTVWR-559.