浏览代码

Fixed profiling scope errors

/seans-add-link-xml
Andre McGrail 4 年前
当前提交
0ebf7dd2
共有 1 个文件被更改,包括 8 次插入7 次删除
  1. 15
      Packages/com.verasl.water-system/Scripts/Rendering/WaterSystemFeature.cs

15
Packages/com.verasl.water-system/Scripts/Rendering/WaterSystemFeature.cs


public override void Execute(ScriptableRenderContext context, ref RenderingData renderingData)
{
CommandBuffer cmd = CommandBufferPool.Get(k_RenderWaterFXTag);
CommandBuffer cmd = CommandBufferPool.Get();
using (new ProfilingScope(cmd, m_WaterFX_Profile)) // makes sure we have profiling ability
{
context.ExecuteCommandBuffer(cmd);

if (cam.cameraType == CameraType.Preview || !WaterCausticMaterial)
return;
var sunMatrix = RenderSettings.sun != null
? RenderSettings.sun.transform.localToWorldMatrix
: Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(-45f, 45f, 0f), Vector3.one);
WaterCausticMaterial.SetMatrix("_MainLightDir", sunMatrix);
CommandBuffer cmd = CommandBufferPool.Get(k_RenderWaterCausticsTag);
CommandBuffer cmd = CommandBufferPool.Get();
var sunMatrix = RenderSettings.sun != null
? RenderSettings.sun.transform.localToWorldMatrix
: Matrix4x4.TRS(Vector3.zero, Quaternion.Euler(-45f, 45f, 0f), Vector3.one);
WaterCausticMaterial.SetMatrix("_MainLightDir", sunMatrix);
// Create mesh if needed
if (!m_mesh)
m_mesh = GenerateCausticsMesh(1000f);

正在加载...
取消
保存