17.08.2015 Views

Fast mobile shaders or rather Mobile! Fast!

Fast mobile shaders - Unity Technologies Blog

Fast mobile shaders - Unity Technologies Blog

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Unity•Currently prefer HLSL <strong>shaders</strong>• W<strong>or</strong>ks on all platf<strong>or</strong>ms!••We cross compile + optimize into GLSLfloat/half/fixed = highp/mediump/lowp•If writing GLSL, limit to <strong>mobile</strong> +desktop OpenGL right nowIn Unity, <strong>shaders</strong> most often written in HLSL (aka Cg); we cross compile into GLSL ES f<strong>or</strong><strong>mobile</strong> platf<strong>or</strong>ms.When you use float/half/fixed types in HLSL, they end up highp/mediump/lowp precisionqualifiers in GLSL ES.We find no perf<strong>or</strong>mance penalty f<strong>or</strong> the cross-compilation step. If you find any <strong>shaders</strong> thatare suboptimal after HLSL->GLSL conversion, please let us know!You can also write GLSL directly if you want to, but doing that limits you to OpenGL-likeplatf<strong>or</strong>ms (e.g. <strong>mobile</strong> + Mac) since we currently do not have GLSL->HLSL translation tools.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!