浏览代码

Moved SSAO settings into CommonSettings.

/Branch_Batching2
Keijiro Takahashi 8 年前
当前提交
705fd129
共有 12 个文件被更改,包括 26 次插入84 次删除
  1. 7
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionContext.cs
  2. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources/AmbientOcclusion.shader
  3. 10
      Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  4. 16
      Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/CommonSettings.cs
  5. 26
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionSettings.cs
  6. 13
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionSettings.cs.meta
  7. 18
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/AOSettings.asset
  8. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/AOSettings.asset.meta
  9. 9
      Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Editor.meta
  10. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources.meta
  11. 0
      /Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources

7
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionContext.cs


internal static readonly int _CameraGBufferTexture1 = Shader.PropertyToID("_CameraGBufferTexture1");
}
AmbientOcclusionSettings m_Settings;
CommonSettings.ScreenSpaceAmbientOcclusionSettings m_Settings;
public AmbientOcclusionContext(AmbientOcclusionSettings settings, RenderTargetIdentifier[] gbufferIDs)
public AmbientOcclusionContext(CommonSettings.ScreenSpaceAmbientOcclusionSettings settings, RenderTargetIdentifier[] gbufferIDs)
{
m_Settings = settings;
m_GBufferIDs = gbufferIDs;

{
if (m_Sheet == null)
{
var material = new Material(m_Settings.aoShader) { hideFlags = HideFlags.DontSave };
var shader = Shader.Find("Hidden/HDPipeline/ScreenSpaceAmbientOcclusion");
var material = new Material(shader) { hideFlags = HideFlags.DontSave };
m_Sheet = new PropertySheet(material);
}

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources/AmbientOcclusion.shader


Shader "Hidden/PostProcessing/AmbientOcclusion"
Shader "Hidden/HDPipeline/ScreenSpaceAmbientOcclusion"
{
SubShader
{

10
Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


public TextureSettings textureSettings { get { return m_TextureSettings; } set { m_TextureSettings = value; } }
// Renderer Settings (per "scene")
[SerializeField] private CommonSettings.Settings m_CommonSettings = CommonSettings.Settings.s_Defaultsettings;
[SerializeField] private CommonSettings m_CommonSettings;
public CommonSettings.Settings commonSettingsToUse
public CommonSettings commonSettingsToUse
return CommonSettingsSingleton.overrideSettings.settings;
return CommonSettingsSingleton.overrideSettings;
return m_CommonSettings;
}

public void UpdateCommonSettings()
{
var commonSettings = commonSettingsToUse;
var commonSettings = commonSettingsToUse.settings;
m_ShadowSettings.directionalLightCascadeCount = commonSettings.shadowCascadeCount;
m_ShadowSettings.directionalLightCascades = new Vector3(commonSettings.shadowCascadeSplit0, commonSettings.shadowCascadeSplit1, commonSettings.shadowCascadeSplit2);

m_SkyManager.skySettings = owner.skySettingsToUse;
m_PostProcessContext = new PostProcessRenderContext();
m_SsaoContext = new AmbientOcclusionContext(new AmbientOcclusionSettings(), m_gbufferManager.GetGBuffers());
m_SsaoContext = new AmbientOcclusionContext(owner.commonSettingsToUse.screenSpaceAmbientOcclusionSettings, m_gbufferManager.GetGBuffers());
}
void InitializeDebugMaterials()

16
Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/CommonSettings.cs


};
}
[Serializable]
public sealed class ScreenSpaceAmbientOcclusionSettings
{
[Range(0, 2)]
public float intensity = 1.0f;
public float radius = 0.5f;
[Range(1, 32)]
public int sampleCount = 8;
public bool downsampling = true;
}
[SerializeField]
private Settings m_Settings = Settings.s_Defaultsettings;

set { m_Settings = value; }
}
public ScreenSpaceAmbientOcclusionSettings screenSpaceAmbientOcclusionSettings;
}
}

26
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionSettings.cs


using UnityEngine;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
public sealed class AmbientOcclusionSettings : ScriptableObject
{
[Range(0, 2)]
public float intensity = 1.0f;
public float radius = 0.5f;
[Range(1, 32)]
public int sampleCount = 8;
public bool downsampling = true;
// SSAO shader: hidden in inspector.
[SerializeField]
Shader m_aoShader;
public Shader aoShader
{
get { return m_aoShader; }
}
}
}

13
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Runtime/AmbientOcclusionSettings.cs.meta


fileFormatVersion: 2
guid: 3b6f679b62de9f94bbdc6a8acce5e110
timeCreated: 1494886884
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences:
- m_aoShader: {fileID: 4800000, guid: cf0db7f5267ad944dbf4326b7102c9ca, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

18
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/AOSettings.asset


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3b6f679b62de9f94bbdc6a8acce5e110, type: 3}
m_Name: AOSettings
m_EditorClassIdentifier:
intensity: 1
radius: 0.5
sampleCount: 8
downsampling: 1
m_aoShader: {fileID: 4800000, guid: cf0db7f5267ad944dbf4326b7102c9ca, type: 3}

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/AOSettings.asset.meta


fileFormatVersion: 2
guid: fcc5323b0ecc350428972c61f4780b54
timeCreated: 1494891906
licenseType: Pro
NativeFormatImporter:
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Editor.meta


fileFormatVersion: 2
guid: 45a54c87809570549a059aaddf8ad804
folderAsset: yes
timeCreated: 1494636845
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

/Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Shaders.meta → /Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources.meta

/Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Shaders → /Assets/ScriptableRenderPipeline/HDRenderPipeline/AmbientOcclusion/Resources

正在加载...
取消
保存