Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

[BUG-225337] Alpha Masked surfaces having a diffuse with alpha channel and normal and specular applied lose their shadows #4169

Open
sl-service-account opened this issue Aug 24, 2018 · 4 comments

Comments

@sl-service-account
Copy link

sl-service-account commented Aug 24, 2018

What just happened?

Steps to reproduce:
Step 1: Get this avatar: https://marketplace.secondlife.com/p/Orange-Nova-Snokra-Snake/13541472
Step 2: Unpack said avatar and wear its body.
Step 3: Wear the HUD, click the egg to extend the HUD, select the square icon to bring up the skin selection and click the first skin (brown) to apply it.
Step 4: Observe how the shadows of the worn avatar are invisible.

(Bonus Step 5): Select the avatar and remove either the specular or normal map.
(Bonus Step 6): Confirm that the avatar has a shadow again.

(Bonus Step 7): Select the avatar and change its diffuse alpha mode from "None" to "Alpha Mask" for single or multiple parts with both specular and normal map applied.
(Bonus Step 8): Confirm the changed parts now cast a shadow again.

Note: The reason we use the HUD to change the skin is to make sure we have a skin with an alpha channel in it.

What were you doing when it happened?

My avatar shadows vanished.

What were you expecting to happen instead?

I'd see a shadow.

Other information

Further testing seems to indicate that shadows vanish when the diffuse contains an alpha channel but is unused (set to None), setting the alpha mode to "Masking" makes the shadows reappear, also using a texture with no alpha channel does cast a shadow as well. Could this be an issue of the code detecting that there is an alpha channel without checking for the "None" alpha mode, e.g the Viewer handling it as alpha even when we clearly tell it not to?

Note: I'm testing this on my own Viewer currently as all LL Viewer compiles are broken and don't rez textures due to Openjpeg hence why i'd like to have confirmation whether this is something actually happening or just a weird interaction with my Viewer (which i hope it is not).

Attachments

Original Jira Fields
Field Value
Issue BUG-225337
Summary Alpha Masked surfaces having a diffuse with alpha channel and normal and specular applied lose their shadows
Type Bug
Priority Unset
Status Accepted
Resolution Accepted
Reporter NiranV Dean (niranv.dean)
Created at 2018-08-24T17:42:35Z
Updated at 2018-08-29T01:19:10Z
{
  'Build Id': 'unset',
  'Business Unit': ['Platform'],
  'Date of First Response': '2018-08-24T18:09:55.351-0500',
  "Is there anything you'd like to add?": 'Further testing seems to indicate that shadows vanish when the diffuse contains an alpha channel but is unused (set to None), setting the alpha mode to "Masking" makes the shadows reappear, also using a texture with no alpha channel does cast a shadow as well. Could this be an issue of the code detecting that there is an alpha channel without checking for the "None" alpha mode, e.g the Viewer handling it as alpha even when we clearly tell it not to?\r\n\r\nNote: I\'m testing this on my own Viewer currently as all LL Viewer compiles are broken and don\'t rez textures due to Openjpeg hence why i\'d like to have confirmation whether this is something actually happening or just a weird interaction with my Viewer (which i hope it is not).',
  'ReOpened Count': 0.0,
  'Severity': 'Unset',
  'System': 'SL Viewer',
  'Target Viewer Version': 'viewer-development',
  'What just happened?': 'My avatar shadows vanished.',
  'What were you doing when it happened?': 'Steps to reproduce:\r\nStep 1: Get this avatar: https://marketplace.secondlife.com/p/Orange-Nova-Snokra-Snake/13541472\r\nStep 2: Unpack said avatar and wear its body.\r\nStep 3: Wear the HUD, click the egg to extend the HUD, select the square icon to bring up the skin selection and click the first skin (brown) to apply it.\r\nStep 4: Observe how the shadows of the worn avatar are invisible.\r\n\r\n(Bonus Step 5): Select the avatar and remove either the specular or normal map.\r\n(Bonus Step 6): Confirm that the avatar has a shadow again.\r\n\r\n(Bonus Step 7): Select the avatar and change its diffuse alpha mode from "None" to "Alpha Mask" for single or multiple parts with both specular and normal map applied.\r\n(Bonus Step 8): Confirm the changed parts now cast a shadow again.\r\n\r\nNote: The reason we use the HUD to change the skin is to make sure we have a skin with an alpha channel in it.',
  'What were you expecting to happen instead?': "I'd see a shadow.",
}
@sl-service-account
Copy link
Author

NiranV Dean commented at 2018-08-24T17:58:15Z

Added some screenshots to illustrate the issue:
Snapshot_5180 shows a custom skin applied with no alpha channel in the diffuse texture.
Snapshot_5181 shows one of the stock skins applied with alpha channel in its diffuse texture.
Snapshot_5182 illustrates the issue further by showing that with "Masking" mode shadows reappear.
Snapshot_5183 illustrates the issue further by showing that with "None" mode shadows disappear.
Snapshot_5184 illustrates the issue further by showing that with "Emissive" mode shadows disappear.
Snapshot_5185 illustrates the issue further by showing that with "Blending" mode shadows disappear.

@sl-service-account
Copy link
Author

Whirly Fizzle commented at 2018-08-24T23:09:55Z

Note to self: https://bitbucket.org/lindenlab/viewer-cougar/commits/265c6f80ec5eb834b56bcb064a0413a36625832f#comment-6525921

@sl-service-account
Copy link
Author

NiranV Dean commented at 2018-08-25T21:50:15Z

Suggested fix can be found here:
https://bitbucket.org/NiranV/black-dragon-viewer/commits/2ecedbd921c3a0b66fbf4a785317a87a41e724ef

In addition i also needed to do
https://bitbucket.org/NiranV/black-dragon-viewer/commits/53334fd77bbc7dcd39558c0da9c5d4c0550d77ec

I'm not sure if the second one is also required on the official Viewer (could be something specific to my Viewer) but if it doesn't break anything there's probably no harm in applying that too seeing that the other alphaMask shader doesn't use vertex_color either.

@sl-service-account
Copy link
Author

NiranV Dean commented at 2018-08-29T01:18:37Z, updated at 2018-08-29T01:19:11Z

I'm seeing other people's rigged attachments getting attached to my own HUD sometimes on login until they fully load. I'll be investigating if my fix, this fix or anything other in the cougar code base caused this over the course of the next update and report (and Jira it if necessary) accordingly.

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

No branches or pull requests

1 participant