浏览代码

Merge pull request #1539 from Unity-Technologies/lw/camera-additional-data

Lw/camera additional data
/main
GitHub 7 年前
当前提交
ed505754
共有 3 个文件被更改,包括 36 次插入5 次删除
  1. 1
      com.unity.render-pipelines.lightweight/CHANGELOG.md
  2. 11
      com.unity.render-pipelines.lightweight/LWRP/Editor/LightweightCameraEditor.cs
  3. 29
      com.unity.render-pipelines.lightweight/LWRP/LightweightPipeline.cs

1
com.unity.render-pipelines.lightweight/CHANGELOG.md


## [Unreleased]
### Added
- Added camera additional data component to control shadows, depth and color texture
- pipeline now uses XRSEttings.eyeTextureResolutionScale as renderScale when in XR
### Changed

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)

正在加载...
取消
保存