-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
MRTK/Standard Shader Improvements #2129
Conversation
- 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
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; |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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. :)
@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). |
@Alexees please open new issues for questions. Thanks. |
@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! |
Overview
Integrating the latest work to improve the MRTK/Standard shader. Improvements include:
(Shader based anti-aliasing example.)