浏览代码

SRP API changes by peter

/main
MingWai 6 年前
当前提交
01439ebc
共有 9 个文件被更改,包括 32 次插入24 次删除
  1. 5
      Assets/Scripts/Camera/LODTweaker.cs
  2. 5
      Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs
  3. 4
      Packages/com.verasl.water-system/Scripts/Rendering/PlanerReflections.cs
  4. 18
      Packages/com.verasl.water-system/Scripts/Rendering/WaterFXPass.cs
  5. 4
      Packages/com.verasl.water-system/Scripts/Water.cs
  6. 2
      Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl
  7. 2
      Packages/com.verasl.water-system/Shaders/WaterInput.hlsl
  8. 10
      Packages/manifest.json
  9. 6
      ProjectSettings/QualitySettings.asset

5
Assets/Scripts/Camera/LODTweaker.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
using UnityEngine.Rendering;
namespace BoatAttack
{

void OnEnable()
{
LightweightRenderPipeline.beginCameraRendering += SetMaxLOD; // listen for LWRP camera callback
RenderPipelineManager.beginCameraRendering += SetMaxLOD; // listen for LWRP camera callback
LightweightRenderPipeline.beginCameraRendering -= SetMaxLOD; // stop listening for LWRP camera callback
RenderPipelineManager.beginCameraRendering -= SetMaxLOD; // stop listening for LWRP camera callback
}
}
}

5
Packages/com.verasl.water-system/Scripts/MainCameraAlign.cs


using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Experimental.Rendering.LightweightPipeline;
using UnityEngine.Rendering;
namespace WaterSystem
{

private void OnEnable()
{
LightweightRenderPipeline.beginCameraRendering += UpdatePosition;
RenderPipelineManager.beginCameraRendering += UpdatePosition;
LightweightRenderPipeline.beginCameraRendering -= UpdatePosition;
RenderPipelineManager.beginCameraRendering -= UpdatePosition;
}
void UpdatePosition(Camera cam)

4
Packages/com.verasl.water-system/Scripts/Rendering/PlanerReflections.cs


namespace UnityEngine.Experimental.Rendering.LightweightPipeline
{
[ImageEffectAllowedInSceneView]
public class PlanerReflections : MonoBehaviour, IBeforeCameraRender
{
[System.Serializable]

UpdateReflectionCamera(camera);
CullResults cullResults = new CullResults();
LightweightRenderPipeline.RenderSingleCamera(pipelineInstance, context, m_ReflectionCamera, ref cullResults);
LightweightRenderPipeline.RenderSingleCamera(pipelineInstance, context, m_ReflectionCamera);
GL.invertCulling = false;
RenderSettings.fog = true;

18
Packages/com.verasl.water-system/Scripts/Rendering/WaterFXPass.cs


const string k_RenderWaterFXTag = "Render Water FX";
private RenderTargetHandle m_WaterFX = RenderTargetHandle.CameraTarget;
private FilterRenderersSettings transparentFilterSettings { get; set; }
private FilteringSettings transparentFilterSettings { get; set; }
public WaterFXPassImpl()
{

transparentFilterSettings = new FilterRenderersSettings(true)
{
renderQueueRange = RenderQueueRange.transparent,
};
transparentFilterSettings = new FilteringSettings(RenderQueueRange.transparent);
}
public override void Execute(ScriptableRenderer renderer, ScriptableRenderContext context, ref RenderingData renderingData)

context.ExecuteCommandBuffer(cmd);
cmd.Clear();
var drawSettings = CreateDrawRendererSettings(renderingData.cameraData.camera,
SortFlags.CommonTransparent, RendererConfiguration.None, renderingData.supportsDynamicBatching);
var drawSettings = CreateDrawingSettings(renderingData.cameraData.camera,
SortingCriteria.CommonTransparent, PerObjectData.None, renderingData.supportsDynamicBatching);
var filteringSettings = transparentFilterSettings;
context.DrawRenderers(renderingData.cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filteringSettings);
context.DrawRenderers(renderingData.cullResults.visibleRenderers, ref drawSettings, transparentFilterSettings);
{
context.DrawRenderers(renderingData.cullResults, ref drawSettings, ref filteringSettings);
}
}

4
Packages/com.verasl.water-system/Scripts/Water.cs


else
useComputeBuffer = false;
Init();
LightweightRenderPipeline.beginCameraRendering += BeginCameraRendering;
RenderPipelineManager.beginCameraRendering += BeginCameraRendering;
if(resources == null)
{

{
if(Application.isPlaying)
GerstnerWavesJobs.Cleanup();
LightweightRenderPipeline.beginCameraRendering -= BeginCameraRendering;
RenderPipelineManager.beginCameraRendering -= BeginCameraRendering;
if (_depthCam)
{
_depthCam.targetTexture = null;

2
Packages/com.verasl.water-system/Shaders/WaterCommon.hlsl


half3 Refraction(half2 distortion, half mip)
{
half3 refrac = SAMPLE_TEXTURE2D_LOD(_CameraOpaqueTexture, sampler_CameraOpaqueTexture_linear, distortion, mip);
half3 refrac = SAMPLE_TEXTURE2D_LOD(_CameraOpaqueTexture, sampler_CameraOpaqueTexture_linear_clamp, distortion, mip);
return refrac;
}

2
Packages/com.verasl.water-system/Shaders/WaterInput.hlsl


#endif
TEXTURE2D(_WaterFXMap);
TEXTURE2D(_CameraDepthTexture);
TEXTURE2D(_CameraOpaqueTexture); SAMPLER(sampler_CameraOpaqueTexture_linear);
TEXTURE2D(_CameraOpaqueTexture); SAMPLER(sampler_CameraOpaqueTexture_linear_clamp);
TEXTURE2D(_WaterDepthMap); SAMPLER(sampler_WaterDepthMap_linear_clamp);

10
Packages/manifest.json


"com.unity.cinemachine": "2.2.7",
"com.unity.collab-proxy": "1.2.9",
"com.unity.mathematics": "0.0.12-preview.17",
"com.unity.package-manager-ui": "2.0.0-preview.7",
"com.unity.postprocessing": "2.0.13-preview",
"com.unity.package-manager-ui": "2.1.0-preview.1",
"com.unity.postprocessing": "2.0.15-preview",
"com.unity.render-pipelines.core": "file:../../../../SRP/ScriptableRenderPipeline/Assets/com.unity.render-pipelines.core",
"com.unity.render-pipelines.lightweight": "file:../../../../SRP/ScriptableRenderPipeline/Assets/com.unity.render-pipelines.lightweight",
"com.unity.shadergraph": "file:../../../../SRP/ScriptableRenderPipeline/Assets/com.unity.shadergraph",
"com.unity.render-pipelines.core": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.render-pipelines.core",
"com.unity.render-pipelines.lightweight": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.render-pipelines.lightweight",
"com.unity.shadergraph": "file:D:/UnityProject/ScriptableRenderPipeline/com.unity.shadergraph",
"com.unity.textmeshpro": "1.3.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.animation": "1.0.0",

6
ProjectSettings/QualitySettings.asset


particleRaycastBudget: 4
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2

particleRaycastBudget: 16
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2

particleRaycastBudget: 64
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2

particleRaycastBudget: 256
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2

particleRaycastBudget: 1024
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
- serializedVersion: 2

particleRaycastBudget: 4096
asyncUploadTimeSlice: 2
asyncUploadBufferSize: 4
asyncUploadPersistentBuffer: 1
resolutionScalingFixedDPIFactor: 1
excludedTargetPlatforms: []
m_PerPlatformDefaultQuality:

正在加载...
取消
保存