|
|
|
|
|
|
// Define select preprocessor symbols.
|
|
|
|
UpdateKeywords(true); |
|
|
|
|
|
|
|
if (depthTexture == DepthTexture.Disable) |
|
|
|
{ |
|
|
|
// Disable depth texture rendering.
|
|
|
|
Camera.current.depthTextureMode = DepthTextureMode.None; |
|
|
|
} |
|
|
|
|
|
|
|
UpdateDynamicUniforms(); |
|
|
|
|
|
|
|
if (instance && instance != this) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
void OnWillRenderObject() |
|
|
|
{ |
|
|
|
/* |
|
|
|
/* For now, we only use the directional light we are attached to, and the current camera. */ |
|
|
|
// For now, we only use the directional light we are attached to, and the current camera.
|
|
|
|
|
|
|
|
if (depthTexture == DepthTexture.Disable) |
|
|
|
{ |
|
|
|
|
|
|
// Set shader constants.
|
|
|
|
UpdateDynamicUniforms(); |
|
|
|
|
|
|
|
/* |
|
|
|
if(useOcclusion) { |
|
|
|
|
|
|
|
if (useOcclusion) { |
|
|
|
var camRgt = m_currentCamera.transform.right; |
|
|
|
var camUp = m_currentCamera.transform.up; |
|
|
|
var camFwd = m_currentCamera.transform.forward; |
|
|
|
|
|
|
|
|
|
|
void UpdateDynamicUniforms() |
|
|
|
{ |
|
|
|
/* For now, we only use the directional light we are attached to, and the current camera. */ |
|
|
|
|
|
|
|
var trackedYaw = skyDomeTrackedYawRotation ? skyDomeTrackedYawRotation.eulerAngles.y : 0f; |
|
|
|
Shader.SetGlobalMatrix("_SkyDomeRotation", |
|
|
|
Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(skyDomeRotation.x, 0f, 0f), Vector3.one) |
|
|
|