Skip to content

Instantly share code, notes, and snippets.

@aras-p
Created August 12, 2013 15:50
Show Gist options
  • Save aras-p/6212143 to your computer and use it in GitHub Desktop.
Save aras-p/6212143 to your computer and use it in GitHub Desktop.
probe pseudocode
class YourProbe : MonoBehaviour {
public Cubemap m_Probe;
public void Start() {
SetOntoShaders();
}
public void OnSelect() {
// do your "user picks stuff" thing,
// mip blurring and whatever
Cubemap b = new Cubemap(...);
m_Probe = b;
SetOntoShaders();
}
private void SetOntoShaders ()
{
Shader.SetGlobalTexture ("_ReflCube", m_Probe);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment