Skip to content

Instantly share code, notes, and snippets.

@pixelmager
Last active February 26, 2017 19:36
Show Gist options
  • Save pixelmager/9031841c4cd7a495fcf2 to your computer and use it in GitHub Desktop.
Save pixelmager/9031841c4cd7a495fcf2 to your computer and use it in GitHub Desktop.
u4 to u5
Oh hey, they updated the physics-engiOMG-EVERYTHING-IS-BROKEN!!1
To match look of u4:
- disable all light-baking
- disable auto-patching shaders with fog (and switch fog back to whatever mode you were using)
- set Light Bounce to 0 on all lights... or you'll get a warning!1 (on every spot-light)
- Light-shaders are now overridden explicitly in the Lighting-tab
...all other shaders still override automagically... :p
ShadowMap backface-culling now defaults to Back ("on" used to mean twosided). This can be "fixed" by setting it on a per-object basis FOR EVERY OBJECT IN YOUR GAME (you should create a script).
Shaders
- COLOR should now be SV_Target... POSITION should be SV_POSITION, unless it is a app2vert-struct...
- the x2 factor on light-attenuation has been moved CPU-side, needs to be removed from all shaders.
- unity_FogColor is now defined per default. Also, you should use the values in unity_FogParams.
- object-scaling in unity4 is a source of many, many hours of horror:
· if an object was uniformly scaled, the scale would be in the uniform unity_Scale.w, object-positions were untouched. The scale was part of matrices.
· if an object was NON-uniformly scaled, the scale would be baked into vertices, matrices did not have scale
- surface shaders have new ways to destroy you shaders in u5... this is a good opportunity to stop using surface shaders!
· "alpha" now needs to be specified which type, defaults to the wrong one
· alpha will be overwritten to 1.0 for opaqaue objects... add "keepalpha" to NOT destroy your alpha... ...
· unity uses more interpolators, so fewer left for you. Rewrite surface-shaders to vert/frag...
- shadowmap sampling-functions have changed in subtle ways, on some platforms you now sample a depthmap.
- you have probably always been calculating your worldspace-normals the wrong way... you should have been using the inverse-transposed _Object2World (which was not directly available)... in u5 you can use the utility-function UnityObjectToWorldNormal()
-
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment