浏览代码

Added indirect light control for stacklit

/main
Antoine Lelievre 6 年前
当前提交
779c6cd9
共有 9 个文件被更改,包括 36 次插入32 次删除
  1. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs
  2. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs
  3. 2
      com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs.meta
  4. 4
      com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl
  5. 29
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControllerEditor.cs
  6. 29
      com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControlEditor.cs
  7. 0
      /com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControllerEditor.cs.meta
  8. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs
  9. 0
      /com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs.meta

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


void PushGlobalParams(HDCamera hdCamera, CommandBuffer cmd)
{
IndirectLightingControl indirectLightVolume = VolumeManager.instance.stack.GetComponent< IndirectLightingControl >();
IndirectLightingController indirectLightVolume = VolumeManager.instance.stack.GetComponent< IndirectLightingController >();
Vector4 indirectLightData = new Vector4(indirectLightVolume.indirectDiffuseIntensity, indirectLightVolume.indirectSpecularIntensity, 0, 0);
using (new ProfilingSample(cmd, "Push Global Parameters", CustomSamplerId.TPPushGlobalParameters.GetSampler()))

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs


namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[Serializable]
public class IndirectLightingControl : VolumeComponent
public class IndirectLightingController : VolumeComponent
{
public MinFloatParameter indirectSpecularIntensity = new MinFloatParameter(1.0f, 0.0f);
public MinFloatParameter indirectDiffuseIntensity = new MinFloatParameter(1.0f, 0.0f);

2
com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs.meta


fileFormatVersion: 2
guid: b867368b7a8a6b34ca8118533fdfe3d2
guid: f034cba68ab55e046ae1445a42f18c0e
MonoImporter:
externalObjects: {}
serializedVersion: 2

4
com.unity.render-pipelines.high-definition/HDRP/Material/StackLit/StackLit.hlsl


// Subsurface scattering mode
float3 modifiedDiffuseColor = GetModifiedDiffuseColorForSSS(bsdfData);
// Apply volume indirect multipler
builtinData.bakeDiffuseLighting *= _IndirectLightingMultiplier.x;
lighting.indirect.specularReflected *= _IndirectLightingMultiplier.y;
// Apply the albedo to the direct diffuse lighting (only once). The indirect (baked)
// diffuse lighting has already had the albedo applied in GetBakedDiffuseLighting().

29
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControllerEditor.cs


using System.Collections;
using UnityEngine;
using UnityEditor;
using UnityEditor.Experimental.Rendering;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[VolumeComponentEditor(typeof(IndirectLightingController))]
public class IndirectLightingControllerEditor : VolumeComponentEditor
{
SerializedDataParameter m_IndirectDiffuseIntensity;
SerializedDataParameter m_IndirectSpecularIntensity;
public override void OnEnable()
{
var o = new PropertyFetcher<IndirectLightingController>(serializedObject);
m_IndirectSpecularIntensity = Unpack(o.Find(x => x.indirectSpecularIntensity));
m_IndirectDiffuseIntensity = Unpack(o.Find(x => x.indirectDiffuseIntensity));
}
public override void OnInspectorGUI()
{
PropertyField(m_IndirectDiffuseIntensity, CoreEditorUtils.GetContent("Indirect Diffuse Intensity|Multiplier for the baked diffuse lighting."));
PropertyField(m_IndirectSpecularIntensity, CoreEditorUtils.GetContent("Indirect Specular Intensity|Multiplier for the reflected specular light."));
}
}
}

29
com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControlEditor.cs


using System.Collections;
using UnityEngine;
using UnityEditor;
using UnityEditor.Experimental.Rendering;
namespace UnityEngine.Experimental.Rendering.HDPipeline
{
[CanEditMultipleObjects]
[VolumeComponentEditor(typeof(IndirectLightingControl))]
public class IndirectLightingControlEditor : VolumeComponentEditor
{
SerializedDataParameter m_IndirectDiffuseIntensity;
SerializedDataParameter m_IndirectSpecularIntensity;
public override void OnEnable()
{
var o = new PropertyFetcher<IndirectLightingControl>(serializedObject);
m_IndirectSpecularIntensity = Unpack(o.Find(x => x.indirectSpecularIntensity));
m_IndirectDiffuseIntensity = Unpack(o.Find(x => x.indirectDiffuseIntensity));
}
public override void OnInspectorGUI()
{
PropertyField(m_IndirectDiffuseIntensity, CoreEditorUtils.GetContent("Indirect Diffuse Intensity|Multiplier for the baked diffuse lighting."));
PropertyField(m_IndirectSpecularIntensity, CoreEditorUtils.GetContent("Indirect Specular Intensity|Multiplier for the reflected specular light."));
}
}
}

/com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControlEditor.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Editor/Lighting/IndirectLightingControllerEditor.cs.meta

/com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingControl.cs → /com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs

/com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingControl.cs.meta → /com.unity.render-pipelines.high-definition/HDRP/Lighting/IndirectLightingController.cs.meta

正在加载...
取消
保存