浏览代码

Update default scene settings object creation to include exp fog and all relevant component.

/main
Julien Ignace 7 年前
当前提交
b2315b94
共有 3 个文件被更改,包括 6 次插入7 次删除
  1. 5
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
  2. 5
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/ExponentialFog.cs
  3. 3
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/LinearFog.cs

5
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs


Undo.RegisterCreatedObjectUndo(sceneSettings, "Create " + sceneSettings.name);
Selection.activeObject = sceneSettings;
var volume = sceneSettings.AddComponent<Volume>();
volume.isGlobal = true;
volume.Add<HDShadowSettings>(true);
visualEnv.fogType.value = FogType.Exponential;
volume.Add<ProceduralSky>(true);
volume.Add<ExponentialFog>(true);
}
class DoCreateNewAsset<TAssetType> : ProjectWindowCallback.EndNameEditAction where TAssetType : ScriptableObject

5
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/ExponentialFog.cs


{
public class ExponentialFog : AtmosphericScattering
{
// Exp Fog
// Exponential fog
public MinFloatParameter fogDistance = new MinFloatParameter(100.0f, 0.0f);
public MinFloatParameter fogDistance = new MinFloatParameter(200.0f, 0.0f);
cmd.SetGlobalVector(m_ExpFogParam, new Vector4(Mathf.Max(0.0f, fogDistance), 0.0f, 0.0f, 0.0f));
}
}

3
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/LinearFog.cs


{
private readonly static int m_LinearFogParam = Shader.PropertyToID("_LinearFogParameters");
// Linear Fog
public MinFloatParameter fogStart = new MinFloatParameter(500.0f, 0.0f);
public MinFloatParameter fogEnd = new MinFloatParameter(1000.0f, 0.0f);

// Linear Fog
cmd.SetGlobalVector(m_LinearFogParam, new Vector4(fogStart, fogEnd, 1.0f / (fogEnd - fogStart), 0.0f));
}
}
正在加载...
取消
保存