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

MRTK/Standard Shader Improvements #2129

Merged

Conversation

Cameron-Micka
Copy link
Member

@Cameron-Micka Cameron-Micka commented May 18, 2018

Overview

Integrating the latest work to improve the MRTK/Standard shader. Improvements include:

  • Support for non-D3D11 APIs (tested on iOS and Android devices using OpenGL ES and Metal)
  • Support for three hover lights (useful with IHMDs with multi-pointers)
  • Improved rounded corner algorithm
  • Closer match to the Unity/Standard shader
  • Improved shader based anti-aliasing support
  • Minor optimizations

aa
(Shader based anti-aliasing example.)

- Support for non-D3D11 APIs
- Support for two hover lights (useful with IHMDs with two pointers)
- Improved rounded corner algorithm
- Closer match to the Unity/Standard shader
- Minor optimizations
@StephenHodgson
Copy link
Contributor

StephenHodgson commented May 18, 2018

Support for two hover lights (useful with IHMDs with two pointers)

Kinda curious how hard it would be to support n th number of pointers.

private int hoverRadiusID;
private int hoverColorID;
// Two hover lights are supported at this time.
private const int hoverLightCount = 2;
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this a hard limit? What's preventing us from supporting any number?

fixed pointToHover = (1.0 - saturate(length(_HoverPosition - i.worldPosition.xyz) / _HoverRadius)) * _HoverColor.a;
fixed pointToHover0 = HoverLight(_HoverLight0, i.worldPosition.xyz, _HoverLightColor0.a);
#if defined(_MULTI_HOVER_LIGHT)
fixed pointToHover1 = HoverLight(_HoverLight1, i.worldPosition.xyz, _HoverLightColor1.a);
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see, we need to define a fixed point for each in the shader itself.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way to make this more generic to support any number of HoverLights?

Copy link
Member Author

@Cameron-Micka Cameron-Micka May 18, 2018

Choose a reason for hiding this comment

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

There isn't an explicit hard limit, but I wanted to settle on a number that didn't incur much performance overhead (especially for the HoloLens and "Core" Windows MR PCs). Two seemed like a good number since usually we have zero to two motion controllers/pointers (I'm sure that will change before we know it haha).

If there is an outcry for more hover lights, I'm happy to add a more generic solution in the future!

Copy link
Contributor

@StephenHodgson StephenHodgson May 18, 2018

Choose a reason for hiding this comment

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

Could we do 3 for now?

Cause chances are you'll have a gaze pointer as well as two controller pointers.

Copy link
Member Author

Choose a reason for hiding this comment

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

3 lights will be an easy change, I'll make those changes and upload them tomorrow. Since you are most likely to need 2+ hover lights on an immersive HMD we should have performance to spare. :)

@Cameron-Micka
Copy link
Member Author

@StephenHodgson I just pushed a commit that increases the HoverLight support to 3 lights. And, it should be simple to increase the amount if need be in the future (just need to change a constant in the shader and HoverLight.cs).

@david-c-kline david-c-kline merged commit b9a16ff into microsoft:Dev_Working_Branch May 23, 2018
@Alexees
Copy link
Contributor

Alexees commented Jul 5, 2018

Hi, I just dropped the HolographicButton prefab from june18_dev into a scene on Android platform and it looks like like this. Is the GL ES support somewhere to be found already
holographicbutton
?

@StephenHodgson
Copy link
Contributor

@Alexees please open new issues for questions. Thanks.

@microsoft microsoft locked as off-topic and limited conversation to collaborators Jul 5, 2018
@Cameron-Micka
Copy link
Member Author

@Alexees these changes are merged into the Dev_Working_Branch (and not the june18_dev branch yet). Try the version of the MRTK/Standard shader in that branch for Android/iOS compatibility. And, please open an issue as Stephen suggested if you encounter any problems!

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

Successfully merging this pull request may close these issues.

5 participants