Created
August 12, 2013 15:50
-
-
Save aras-p/6212143 to your computer and use it in GitHub Desktop.
probe pseudocode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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