Skip to content

Android Shader Support - #6277

Merged
Cameron (Cameron-Micka) merged 3 commits into
microsoft:mrtk_developmentfrom
Cameron-Micka:androidShaderFixes
Oct 14, 2019
Merged

Android Shader Support#6277
Cameron (Cameron-Micka) merged 3 commits into
microsoft:mrtk_developmentfrom
Cameron-Micka:androidShaderFixes

Conversation

@Cameron-Micka

@Cameron-Micka Cameron (Cameron-Micka) commented Oct 11, 2019

Copy link
Copy Markdown
Member

Overview

A handful of users have been using the MRTK on Android platforms which use OpenGL ES renderers. This pull request attempts to address a few issues which have been found by the community.

Changes include:

  • Removing the Shader Model 5 requirement which was only the "earlydepthstencil" feature. Documentation hints that early depth stencil automatically gets enabled when the shader compiler detects it is feasible.
  • Fixing a handful of shader compilation warnings in OpenGL ES. (Note, some warnings only appear the first time a shader is compiled.)
  • Fallback shaders now default to MRTK ones.

Changes

Verification

I've tested on HoloLens, HoloLens 2, Oculus Quest, and Windows PC. If you have any other platforms to test on that would be much appreciated. Especially unusual OpenGL ES variants found on mobile phones.

As a reviewer, it is possible to check out this change locally by using the following
commands (substituting {PR_ID} with the ID of this pull request):

git fetch origin pull/{PR_ID}/head:name_of_local_branch

git checkout name_of_local_branch

@keveleigh

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@keveleigh

Kurtis (keveleigh) commented Oct 11, 2019

Copy link
Copy Markdown
Contributor

When first opening in Unity for Android, I see

image

not sure if this is fine? (Also the same message for Hidden/Instanced-Colored, but I don't think that's one of ours)

@Cameron-Micka

Copy link
Copy Markdown
Member Author

When first opening in Unity for Android, I see

image

not sure if this is fine? (Also the same message for Hidden/Instanced-Colored, but I don't think that's one of ours)

Nice find! Which OpenGL ES version are you using? I’m guessing the version you have specified doesn’t support geometry shaders and instancing. I’ll make the MRTK/Standard the fall back. Even though it won’t look anything like the hand triangles at least we won’t get magenta on Android.

@keveleigh

Copy link
Copy Markdown
Contributor

I'm in 2018.4.11, and I don't think I've changed any defaults (but I could be wrong!)

image

@Cameron-Micka

Copy link
Copy Markdown
Member Author

Interesting, thanks! I’ll give that a try on Monday. That looks like what I have.

@Cameron-Micka

Copy link
Copy Markdown
Member Author

Weird! The console never showed me those warnings (tried in 2018.4.11 too). But, I filtered all the shaders within the MRTK and was able to see those warnings in the inspector and pushed up the changes.

@keveleigh

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 2 pipeline(s).

@Cameron-Micka
Cameron (Cameron-Micka) merged commit 43ed92f into microsoft:mrtk_development Oct 14, 2019
@keveleigh
Kurtis (keveleigh) deleted the androidShaderFixes branch March 26, 2025 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform - Android Issues specific to the Android operating system Shaders / Materials

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants