浏览代码

Pull request review corrections

/main
Anis Benyoub 6 年前
当前提交
39c3c58d
共有 3 个文件被更改,包括 12 次插入13 次删除
  1. 20
      com.unity.render-pipelines.core/CoreRP/Debugging/DebugShapes.cs
  2. 1
      com.unity.render-pipelines.high-definition/HDRP/Debug/DebugLightVolume.shader
  3. 4
      com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs

20
com.unity.render-pipelines.core/CoreRP/Debugging/DebugShapes.cs


public partial class DebugShapes
{
// Singleton
private static DebugShapes s_Instance = null;
static DebugShapes s_Instance = null;
static public DebugShapes instance
{

}
}
private Mesh m_sphereMesh = null;
private Mesh m_boxMesh = null;
private Mesh m_coneMesh = null;
private Mesh m_pyramidMesh = null;
Mesh m_sphereMesh = null;
Mesh m_boxMesh = null;
Mesh m_coneMesh = null;
Mesh m_pyramidMesh = null;
private void BuildSphere(ref Mesh outputMesh, float radius, uint longSubdiv, uint latSubdiv)
void BuildSphere(ref Mesh outputMesh, float radius, uint longSubdiv, uint latSubdiv)
{
// Make sure it is empty before pushing anything to it
outputMesh.Clear();

outputMesh.RecalculateBounds();
}
private void BuildBox(ref Mesh outputMesh, float length, float width, float height)
void BuildBox(ref Mesh outputMesh, float length, float width, float height)
{
outputMesh.Clear();

outputMesh.RecalculateBounds();
}
private void BuildCone(ref Mesh outputMesh, float height, float topRadius, float bottomRadius, int nbSides)
void BuildCone(ref Mesh outputMesh, float height, float topRadius, float bottomRadius, int nbSides)
{
outputMesh.Clear();

outputMesh.RecalculateBounds();
}
private void BuildPyramid(ref Mesh outputMesh, float width, float height, float depth)
void BuildPyramid(ref Mesh outputMesh, float width, float height, float depth)
{
outputMesh.Clear();

outputMesh.RecalculateBounds();
}
private void BuildShapes()
void BuildShapes()
{
m_sphereMesh = new Mesh();
BuildSphere(ref m_sphereMesh, 1.0f, 24, 16);

1
com.unity.render-pipelines.high-definition/HDRP/Debug/DebugLightVolume.shader


HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma enable_d3d11_debug_symbols
#include "CoreRP/ShaderLibrary/Common.hlsl"
#include "HDRP/ShaderVariables.hlsl"

4
com.unity.render-pipelines.high-definition/HDRP/Lighting/LightLoop/LightLoop.cs


}
}
#if UNITY_EDITOR
if (lightingDebug.displayLightVolumes)
{
// First of all let's do the regions for the light sources (we only support Poncutal and Area)

// Let's build the light's bounding sphere matrix
Light currentLegacyLight = cullResults.visibleLights[lightIdx].light;
if (currentLegacyLight == null) continue;
if (currentHDRLight == null) continue;
MaterialPropertyBlock materialBlock = new MaterialPropertyBlock();
Matrix4x4 positionMat = Matrix4x4.Translate(currentLegacyLight.transform.position);

cmd.DrawMesh(targetMesh, positionMat, m_DebugLightVolumeMaterial, 0, -1, materialBlock);
}
}
#endif
}
}
}
正在加载...
取消
保存