浏览代码

Added additional camera data component to controls shadows, depth texture and color.

/main
Felipe Lira 6 年前
当前提交
8929d979
共有 2 个文件被更改,包括 35 次插入5 次删除
  1. 11
      com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightCameraEditor.cs
  2. 29
      com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs

11
com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightCameraEditor.cs


public readonly GUIContent[] renderingPathOptions = { new GUIContent("Forward") };
public readonly GUIContent renderingPathInfo = new GUIContent("Lightweight Pipeline only supports Forward rendering path.");
public readonly GUIContent fixNow = new GUIContent("Fix now");
public readonly GUIContent additionalCameraDataLabel = new GUIContent("Add Additional Camera Data");
public readonly string mssaDisabledWarning = "Anti Aliasing is disabled in Lightweight Pipeline settings.";
};

using (var group = new EditorGUILayout.FadeGroupScope(m_ShowTargetEyeAnim.faded))
if (group.visible) settings.DrawTargetEye();
EditorGUILayout.Space();
EditorGUILayout.Space();
GameObject gameObject = camera.gameObject;
if (gameObject.GetComponent<LightweightAdditionalCameraData>() == null)
{
if (GUILayout.Button(s_Styles.additionalCameraDataLabel))
{
gameObject.AddComponent<LightweightAdditionalCameraData>();
}
}
settings.ApplyModifiedProperties();
}

29
com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs


// Discard variations lesser than kRenderScaleThreshold.
// Scale is only enabled for gameview.
// In XR mode, grab renderScale from XRSettings instead of SRP asset for now.
// This is just a temporary change pending full integration of XR with SRP
// This is just a temporary change pending full integration of XR with SRP
if (camera.cameraType == CameraType.Game)
{

} else {
}
else
{
} else {
}
else
{
cameraData.requiresDepthTexture = pipelineAsset.supportsCameraDepthTexture || cameraData.postProcessEnabled || cameraData.isSceneViewCamera;
cameraData.requiresDepthTexture = pipelineAsset.supportsCameraDepthTexture || cameraData.isSceneViewCamera;
cameraData.requiresSoftParticles = pipelineAsset.supportsSoftParticles;
cameraData.requiresOpaqueTexture = pipelineAsset.supportsCameraOpaqueTexture;
cameraData.opaqueTextureDownsampling = pipelineAsset.opaqueDownsampling;

LightweightAdditionalCameraData additionalCameraData = camera.gameObject.GetComponent<LightweightAdditionalCameraData>();
if (additionalCameraData != null)
{
cameraData.maxShadowDistance = (additionalCameraData.renderShadows) ? cameraData.maxShadowDistance : 0.0f;
cameraData.requiresDepthTexture &= additionalCameraData.requiresDepthTexture;
cameraData.requiresOpaqueTexture &= additionalCameraData.requiresColorTexture;
}
else if (!cameraData.isSceneViewCamera && camera.cameraType != CameraType.Reflection && camera.cameraType != CameraType.Preview)
{
cameraData.requiresDepthTexture = false;
cameraData.requiresOpaqueTexture = false;
}
cameraData.requiresDepthTexture |= cameraData.postProcessEnabled;
}
void InitializeRenderingData(ref CameraData cameraData, List<VisibleLight> visibleLights, int maxSupportedLocalLightsPerPass, int maxSupportedVertexLights, out RenderingData renderingData)

正在加载...
取消
保存