Skip to content

Instantly share code, notes, and snippets.

@toxicFork
Created March 14, 2015 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toxicFork/822d6ce7546b92403cbd to your computer and use it in GitHub Desktop.
Save toxicFork/822d6ce7546b92403cbd to your computer and use it in GitHub Desktop.
#if UNITY_SPECCUBE_BOX_PROJECTION || PLANE_CLIPPING_ENABLED
#define IN_WORLDPOS(i) i.posWorld
#else
#define IN_WORLDPOS(i) half3(0,0,0)
#endif
#define IN_LIGHTDIR_FWDADD(i) half3(i.tangentToWorldAndLightDir[0].w, i.tangentToWorldAndLightDir[1].w, i.tangentToWorldAndLightDir[2].w)
#define FRAGMENT_SETUP(x) FragmentCommonData x = \
FragmentSetup(i.tex, i.eyeVec, WorldNormal(i.tangentToWorldAndParallax), IN_VIEWDIR4PARALLAX(i), ExtractTangentToWorldPerPixel(i.tangentToWorldAndParallax), IN_WORLDPOS(i));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment