Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created August 9, 2013 21:02
Show Gist options
  • Save aras-p/6197162 to your computer and use it in GitHub Desktop.
Save aras-p/6197162 to your computer and use it in GitHub Desktop.
hacking shadow filtering in unity

Forward rendering:

  • Most of "shadow sampling" is in AutoLight.cginc include file somewhere in Unity.
  • Now, if you copy that file into your project somewhere, and have some shaders in the same folder - then these shaders will use yur local "hijacked" copy.
  • In all the functions that sample shadowmap, you could for example add more taps etc.

Deferred lighting:

  • most of shadow sampling code is in Internal-PrePassCollectShadows.shader / Internal-PrePassLighting.shader.
  • copy these built-in shaders into Resources folder of your project (Resources so they are always included into game build)
  • restart Unity and hack them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment