浏览代码

Merge pull request #54 from Unity-Technologies/SkyFramework

Added the possibility to choose the update mode of sky environment lighting.
/main
GitHub 8 年前
当前提交
e9f42525
共有 9 个文件被更改,包括 234 次插入217 次删除
  1. 14
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 22
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/HDRISky/Editor/HDRISkyEditor.cs
  3. 132
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyManager.cs
  4. 17
      Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyParameters.cs
  5. 219
      Assets/TestScenes/HDTest/GlobalIlluminationTest.unity
  6. 9
      Assets/TestScenes/HDTest/GlobalIlluminationTest.meta
  7. 26
      Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs
  8. 12
      Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs.meta

14
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


m_lightLoop.RenderDeferredLighting(hdCamera, renderLoop, m_CameraColorBuffer);
}
void UpdateSkyEnvironment(HDCamera hdCamera, RenderLoop renderLoop)
{
m_SkyManager.UpdateEnvironment(hdCamera, m_lightLoop.GetCurrentSunLight(), renderLoop);
}
void RenderSky(HDCamera hdCamera, RenderLoop renderLoop)
{
m_SkyManager.RenderSky(hdCamera, m_lightLoop.GetCurrentSunLight(), m_CameraColorBufferRT, m_CameraDepthBufferRT, renderLoop);

using (new Utilities.ProfilingSample("Shadow Pass", renderLoop))
{
m_ShadowPass.Render(renderLoop, cullResults, out shadows);
}
}
renderLoop.SetupCameraProperties(camera); // Need to recall SetupCameraProperties after m_ShadowPass.Render
using (new Utilities.ProfilingSample("Build Light list", renderLoop))

PushGlobalParams(hdCamera, renderLoop);
}
}
UpdateSkyEnvironment(hdCamera, renderLoop);
RenderDeferredLighting(hdCamera, renderLoop);
RenderForward(cullResults, camera, renderLoop, true);

22
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/HDRISky/Editor/HDRISkyEditor.cs


{
private class Styles
{
public readonly GUIContent skyHDRI = new GUIContent("HDRI");
public readonly GUIContent skyResolution = new GUIContent("Resolution");
public readonly GUIContent skyExposure = new GUIContent("Exposure");
public readonly GUIContent skyRotation = new GUIContent("Rotation");
public readonly GUIContent skyMultiplier = new GUIContent("Multiplier");
public readonly GUIContent skyHDRI = new GUIContent("HDRI","Cubemap used to render the sky.");
public readonly GUIContent skyResolution = new GUIContent("Resolution", "Resolution of the environment lighting generated from the sky.");
public readonly GUIContent skyExposure = new GUIContent("Exposure", "Exposure of the sky in EV.");
public readonly GUIContent skyRotation = new GUIContent("Rotation", "Rotation of the sky.");
public readonly GUIContent skyMultiplier = new GUIContent("Multiplier", "Intensity multiplier for the sky.");
public readonly GUIContent environmentUpdateMode = new GUIContent("Environment Update Mode", "Specify how the environment lighting should be updated.");
public readonly GUIContent environmentUpdatePeriod = new GUIContent("Environment Update Period", "If environment update is set to realtime, period in seconds at which it is updated (0.0 means every frame).");
}
private static Styles s_Styles = null;

private SerializedProperty m_SkyExposure;
private SerializedProperty m_SkyMultiplier;
private SerializedProperty m_SkyRotation;
private SerializedProperty m_EnvUpdateMode;
private SerializedProperty m_EnvUpdatePeriod;
void OnEnable()
{

m_SkyMultiplier = serializedObject.FindProperty("multiplier");
m_SkyRotation = serializedObject.FindProperty("rotation");
m_EnvUpdateMode = serializedObject.FindProperty("updateMode");
m_EnvUpdatePeriod = serializedObject.FindProperty("updatePeriod");
}
public override void OnInspectorGUI()

EditorGUILayout.PropertyField(m_SkyExposure, styles.skyExposure);
EditorGUILayout.PropertyField(m_SkyMultiplier, styles.skyMultiplier);
EditorGUILayout.PropertyField(m_SkyRotation, styles.skyRotation);
EditorGUILayout.PropertyField(m_EnvUpdateMode, styles.environmentUpdateMode);
if(!m_EnvUpdateMode.hasMultipleDifferentValues && m_EnvUpdateMode.intValue == (int)EnvironementUpdateMode.Realtime)
{
EditorGUILayout.PropertyField(m_EnvUpdatePeriod, styles.environmentUpdatePeriod);
}
serializedObject.ApplyModifiedProperties();
}

132
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyManager.cs


//SkyResolution4096 = 4096
}
public enum EnvironementUpdateMode
{
OnChanged = 0,
OnDemand,
Realtime
}
public class BuiltinSkyParameters
{
public Matrix4x4 viewProjMatrix;

BuiltinSkyParameters m_BuiltinParameters = new BuiltinSkyParameters();
SkyRenderer m_Renderer = null;
int m_SkyParametersHash = 0;
bool m_NeedUpdateEnvironment = false;
bool m_NeedLowLevelUpdateEnvironment = false;
bool m_UpdateRequired = true;
float m_CurrentUpdateTime = 0.0f;
SkyParameters m_SkyParameters = null;

{
m_SkyParametersHash = 0;
m_SkyParameters = value;
m_UpdateRequired = true;
}
else
{

{
Utilities.Destroy(m_SkyboxCubemapRT);
Utilities.Destroy(m_SkyboxGGXCubemapRT);
m_UpdateRequired = true; // Special case. Even if update mode is set to OnDemand, we need to regenerate the environment after destroying the texture.
}
if (m_SkyboxCubemapRT == null)

// TODO: We need to have an API to send our sky information to Enlighten. For now use a workaround through skybox/cubemap material...
m_StandardSkyboxMaterial = Utilities.CreateEngineMaterial("Skybox/Cubemap");
m_GGXConvolveMaterial = Utilities.CreateEngineMaterial("Hidden/HDRenderLoop/GGXConvolve");
m_CurrentUpdateTime = 0.0f;
}
public void Cleanup()

return (m_Renderer == null) ? null : m_Renderer.GetSkyParameterType();
}
public void RenderSky(HDRenderLoop.HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, RenderLoop renderLoop)
public void RequestEnvironmentUpdate()
using (new Utilities.ProfilingSample("Sky Pass", renderLoop))
m_UpdateRequired = true;
}
public void UpdateEnvironment(HDRenderLoop.HDCamera camera, Light sunLight, RenderLoop renderLoop)
{
if (IsSkyValid())
using (new Utilities.ProfilingSample("Sky Environment Pass", renderLoop))
m_BuiltinParameters.renderLoop = renderLoop;
m_BuiltinParameters.sunLight = sunLight;
// We need one frame delay for this update to work since DynamicGI.UpdateEnvironment is executed direclty but the renderloop is not (so we need to wait for the sky texture to be rendered first)
if(m_NeedUpdateEnvironment)
if (IsSkyValid())
// TODO: Properly send the cubemap to Enlighten. Currently workaround is to set the cubemap in a Skybox/cubemap material
m_StandardSkyboxMaterial.SetTexture("_Tex", m_SkyboxCubemapRT);
RenderSettings.skybox = m_StandardSkyboxMaterial; // Setup this material as the default to be use in RenderSettings
RenderSettings.ambientIntensity = 1.0f; // fix this to 1, this parameter should not exist!
RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox; // Force skybox for our HDRI
RenderSettings.reflectionIntensity = 1.0f;
RenderSettings.customReflection = null;
DynamicGI.UpdateEnvironment();
m_NeedUpdateEnvironment = false;
}
m_CurrentUpdateTime += Time.deltaTime;
m_BuiltinParameters.renderLoop = renderLoop;
m_BuiltinParameters.sunLight = sunLight;
if (skyParameters.GetHash() != m_SkyParametersHash)
{
using (new Utilities.ProfilingSample("Sky Pass: Render Cubemap", renderLoop))
// We need one frame delay for this update to work since DynamicGI.UpdateEnvironment is executed direclty but the renderloop is not (so we need to wait for the sky texture to be rendered first)
if (m_NeedLowLevelUpdateEnvironment)
{
// TODO: Properly send the cubemap to Enlighten. Currently workaround is to set the cubemap in a Skybox/cubemap material
m_StandardSkyboxMaterial.SetTexture("_Tex", m_SkyboxCubemapRT);
RenderSettings.skybox = m_StandardSkyboxMaterial; // Setup this material as the default to be use in RenderSettings
RenderSettings.ambientIntensity = 1.0f; // fix this to 1, this parameter should not exist!
RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox; // Force skybox for our HDRI
RenderSettings.reflectionIntensity = 1.0f;
RenderSettings.customReflection = null;
DynamicGI.UpdateEnvironment();
m_NeedLowLevelUpdateEnvironment = false;
}
if (
(skyParameters.updateMode == EnvironementUpdateMode.OnDemand && m_UpdateRequired) ||
(skyParameters.updateMode == EnvironementUpdateMode.OnChanged && skyParameters.GetHash() != m_SkyParametersHash) ||
(skyParameters.updateMode == EnvironementUpdateMode.Realtime && m_CurrentUpdateTime > skyParameters.updatePeriod)
)
{
// Render sky into a cubemap - doesn't happen every frame, can be controlled
RenderSkyToCubemap(m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT);

m_NeedUpdateEnvironment = true;
m_NeedLowLevelUpdateEnvironment = true;
m_UpdateRequired = false;
m_SkyParametersHash = skyParameters.GetHash();
m_CurrentUpdateTime = 0.0f;
}
else
{
// Disabled for now.
// We need to remove RenderSkyToCubemap from the RenderCubemapGGXConvolution first as it needs the skyparameter to be valid.
//if(m_SkyParametersHash != 0)
//{
// // Clear sky light probe
// RenderSettings.skybox = null;
// RenderSettings.ambientIntensity = 1.0f; // fix this to 1, this parameter should not exist!
// RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox; // Force skybox for our HDRI
// RenderSettings.reflectionIntensity = 1.0f;
// RenderSettings.customReflection = null;
// DynamicGI.UpdateEnvironment();
m_SkyParametersHash = skyParameters.GetHash();
// // Clear temp cubemap and redo GGX from black
// Utilities.SetRenderTarget(renderLoop, m_SkyboxCubemapRT, ClearFlag.ClearColor);
// RenderCubemapGGXConvolution(renderLoop, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
// m_SkyParametersHash = 0;
//}
}
}
}
// Render the sky itself
Utilities.SetRenderTarget(renderLoop, colorBuffer, depthBuffer);
public void RenderSky(HDRenderLoop.HDCamera camera, Light sunLight, RenderTargetIdentifier colorBuffer, RenderTargetIdentifier depthBuffer, RenderLoop renderLoop)
{
using (new Utilities.ProfilingSample("Sky Pass", renderLoop))
{
if (IsSkyValid())
{
m_BuiltinParameters.renderLoop = renderLoop;
m_BuiltinParameters.sunLight = sunLight;
Utilities.SetRenderTarget(renderLoop, colorBuffer, depthBuffer);
}
else
{
// Disabled for now.
// We need to remove RenderSkyToCubemap from the RenderCubemapGGXConvolution first as it needs the skyparameter to be valid.
//if(m_SkyParametersHash != 0)
//{
// // Clear sky light probe
// RenderSettings.skybox = null;
// RenderSettings.ambientIntensity = 1.0f; // fix this to 1, this parameter should not exist!
// RenderSettings.ambientMode = UnityEngine.Rendering.AmbientMode.Skybox; // Force skybox for our HDRI
// RenderSettings.reflectionIntensity = 1.0f;
// RenderSettings.customReflection = null;
// DynamicGI.UpdateEnvironment();
// // Clear temp cubemap and redo GGX from black
// Utilities.SetRenderTarget(renderLoop, m_SkyboxCubemapRT, ClearFlag.ClearColor);
// RenderCubemapGGXConvolution(renderLoop, m_BuiltinParameters, skyParameters, m_SkyboxCubemapRT, m_SkyboxGGXCubemapRT);
// m_SkyParametersHash = 0;
//}
}
}
}

17
Assets/ScriptableRenderLoop/HDRenderLoop/Sky/SkyParameters.cs


[ExecuteInEditMode]
public class SkyParameters : MonoBehaviour
{
public float rotation = 0.0f;
public float exposure = 0.0f;
public float multiplier = 1.0f;
public SkyResolution resolution = SkyResolution.SkyResolution256;
protected class Unhashed : System.Attribute {}
protected FieldInfo[] m_Properties;
public float rotation = 0.0f;
public float exposure = 0.0f;
public float multiplier = 1.0f;
public SkyResolution resolution = SkyResolution.SkyResolution256;
public EnvironementUpdateMode updateMode = EnvironementUpdateMode.OnChanged;
public float updatePeriod = 0.0f;
private FieldInfo[] m_Properties;
protected void OnEnable()
{

int hash = 13;
foreach (var p in m_Properties)
{
bool unhashedAttribute = p.GetCustomAttributes(typeof(Unhashed), true).Length != 0;
if (obj != null) // Sometimes it can be a null reference.
if (obj != null && !unhashedAttribute) // Sometimes it can be a null reference.
hash = hash * 23 + obj.GetHashCode();
}
return hash;

219
Assets/TestScenes/HDTest/GlobalIlluminationTest.unity


m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_IndirectSpecularColor: {r: 0.5456157, g: 0.39781958, b: 0.24038762, a: 1}
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0

- {fileID: 190482350}
- {fileID: 1232831964}
- {fileID: 1543726726}
- {fileID: 1692663595}
m_Father: {fileID: 0}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1686135372}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1692663594
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1692663595}
- component: {fileID: 1692663596}
- component: {fileID: 1692663597}
m_Layer: 0
m_Name: SceneParameters
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1692663595
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1692663594}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1027688891}
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1692663596
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1692663594}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name:
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 512
skyHDRI: {fileID: 8900000, guid: 9b513842339ef704ca63ef696691bc34, type: 3}
--- !u!114 &1692663597
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1692663594}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 54bcd1d5cb4984847971142e9444d2fb, type: 3}
m_Name:
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 256
worldRayleighColorRamp:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
worldRayleighColorIntensity: 1
worldRayleighDensity: 10
worldRayleighExtinctionFactor: 1.1
worldRayleighIndirectScatter: 0.33
worldMieColorRamp:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_NumColorKeys: 2
m_NumAlphaKeys: 2
worldMieColorIntensity: 1
worldMieDensity: 15
worldMieExtinctionFactor: 0
worldMiePhaseAnisotropy: 0.9
worldNearScatterPush: 0
worldNormalDistance: 1000
heightRayleighColor: {r: 1, g: 1, b: 1, a: 1}
heightRayleighIntensity: 1
heightRayleighDensity: 10
heightMieDensity: 0
heightExtinctionFactor: 1.1
heightSeaLevel: 0
heightDistance: 50
heightPlaneShift: {x: 0, y: 0, z: 0}
heightNearScatterPush: 0
heightNormalDistance: 1000
skyDomeRotation: {x: 0, y: 0, z: 0}
skyDomeVerticalFlip: 0
skyDomeCubemap: {fileID: 8900000, guid: 9b513842339ef704ca63ef696691bc34, type: 3}
skyDomeExposure: 1
skyDomeTint: {r: 1, g: 1, b: 1, a: 1}
skyDomeTrackedYawRotation: {fileID: 0}
atmosphericShader: {fileID: 0}
worldScaleExponent: 1
depthTexture: 0
debugMode: 0
--- !u!1 &1736468424
GameObject:
m_ObjectHideFlags: 0

m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1879932837}
m_LocalRotation: {x: 0.07759436, y: -0.72047704, z: 0.08170084, w: 0.6842638}
m_LocalPosition: {x: 7.3, y: 1.41, z: -4.72}
m_LocalRotation: {x: 0.120674305, y: -0, z: -0, w: 0.9926922}
m_LocalPosition: {x: -0.56, y: 2.81, z: -12.59}
m_LocalEulerAnglesHint: {x: 12.939001, y: -92.953, z: 0}
m_LocalEulerAnglesHint: {x: 13.862, y: 0, z: 0}
--- !u!114 &1879932843
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 92bb16b4ee20841929b24d6bd771738d, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderLoop: {fileID: 11400000, guid: 2400b74f5ce370c4481e5dc417d03703, type: 2}
--- !u!1 &1910068096
GameObject:
m_ObjectHideFlags: 0

- {x: -1, y: 1, z: -1}
- {x: -1, y: -1, z: 1}
- {x: -1, y: -1, z: -1}
--- !u!1 &1944423445
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1944423448}
- component: {fileID: 1944423447}
- component: {fileID: 1944423446}
m_Layer: 0
m_Name: SceneSettings
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1944423446
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1944423445}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 59b6606ef2548734bb6d11b9d160bc7e, type: 3}
m_Name:
m_EditorClassIdentifier:
rotation: 0
exposure: 0
multiplier: 1
resolution: 256
updateMode: 1
updatePeriod: 0
skyHDRI: {fileID: 8900000, guid: 9b513842339ef704ca63ef696691bc34, type: 3}
--- !u!114 &1944423447
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1944423445}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bc357c46587fc9d4cb8f311794d7d2f3, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SkyRendererTypeName: UnityEngine.Experimental.ScriptableRenderLoop.HDRISkyRenderer
--- !u!4 &1944423448
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1944423445}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

9
Assets/TestScenes/HDTest/GlobalIlluminationTest.meta


fileFormatVersion: 2
guid: ebadb8fcbbf48c94baa8c99ca112e6ae
folderAsset: yes
timeCreated: 1481556119
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

26
Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.ScriptableRenderLoop;
public class TestRealtime : MonoBehaviour {
public GameObject m_SceneSettings = null;
public float m_RotationSpeed = 50.0f;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
if (m_SceneSettings != null)
{
HDRISkyParameters skyParams = m_SceneSettings.GetComponent<HDRISkyParameters>();
if (skyParams)
skyParams.rotation = (skyParams.rotation + Time.deltaTime * m_RotationSpeed) % 360.0f;
}
}
}

12
Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs.meta


fileFormatVersion: 2
guid: cc13745b85d04264da0951802c89e9ee
timeCreated: 1481892949
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存