Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

FIX: Missing avatar graphics when you build and run a standalone Unity application

cyberealitycybereality Posts: 26,156 Oculus Staff
Missing avatar graphics when you build and run a standalone Unity application (.exe).

Unity strips our shaders from the build because Avatar mesh parts are dynamically spawned. Also, our shaders currently require compiling with 64-bit addressing.

Steps to workaround:
1. Click Edit > Project Settings > Graphics. Under Always Included Shaders, add +3 to Size, and then add the following shading elements: AvatarSurfaceShader, AvatarSurfaceShaderPBS, and AvatarSurfaceShaderSelfOccluding.
2. In the Build Settings window, set Architecture to x86_x64.
AMD Ryzen 7 1800X | MSI X370 Titanium | G.Skill 16GB DDR4 3200 | EVGA SuperNOVA 1000 | Corsair Hydro H110i
Gigabyte RX Vega 64 x2 | Samsung 960 Evo M.2 500GB | Seagate FireCuda SSHD 2TB | Phanteks ENTHOO EVOLV


  • phindlephindle Posts: 48
    Brain Burst
    Thanks cyberreality.

    If you have problems with shader compilation errors when you build a standalone application, try adding the following lines to the .shader files which don't build:

    #pragma exclude_renderers gles3 metal d3d11_9x xbox360 xboxone ps3 ps4 psp2 
    #pragma target 3.0

    (And if you see : #pragma target 2.0, replace the "2.0" with "3.0". ShaderModel 2 only supports 32 const registers).

  • l0g1kl0g1k Posts: 47 Oculus Start Member
    This would apply to GearVR too, right?
Sign In or Register to comment.