浏览代码

Various fixes

/main
Frédéric Vauchelles 7 年前
当前提交
a7658549
共有 11 个文件被更改,包括 40 次插入39 次删除
  1. 8
      ScriptableRenderPipeline/Core/CoreRP/Textures/RTHandleSystem.cs
  2. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs
  3. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs
  4. 11
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  5. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDUtils.cs
  6. 18
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.hlsl
  7. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
  8. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs
  10. 18
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs
  11. 8
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs

8
ScriptableRenderPipeline/Core/CoreRP/Textures/RTHandleSystem.cs


public partial class RTHandleSystem : IDisposable
{
public enum ResizeMode
{
{
}
}
internal enum RTCategory
{

m_MaxWidths[i] = 1;
m_MaxHeights[i] = 1;
}
}
}
public void Dispose()
{

{
Assert.AreEqual(this, rth.m_Owner);
rth.Release();
}
}
}
public void SetReferenceSize(int width, int height, bool msaa, MSAASamples msaaSamples)

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Camera/HDAdditionalCameraData.cs


using System;
using UnityEngine.Serialization;
namespace UnityEngine.Experimental.Rendering.HDPipeline

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugDisplay.cs


DebugUI.Widget[] m_DebugRenderingItems;
DebugUI.Widget[] m_DebugScreenSpaceTracingItems;
DebugUI.Widget[] m_DebugDecalsItems;
public float debugOverlayRatio = 0.33f;
public FullScreenDebugMode fullScreenDebugMode = FullScreenDebugMode.None;

Lit.ProjectionModel m_LastProjectionModel = Lit.ProjectionModel.None;
ScreenSpaceTracingDebug m_ScreenSpaceTracingDebugData;
public ScreenSpaceTracingDebug screenSpaceTracingDebugData
public ScreenSpaceTracingDebug screenSpaceTracingDebugData
internal set
internal set
{
m_ScreenSpaceTracingDebugData = value;
if (m_LastProjectionModel != m_ScreenSpaceTracingDebugData.tracingModel)

bool IsScreenSpaceTracingRefractionDebugEnabled()
{
return fullScreenDebugMode == FullScreenDebugMode.ScreenSpaceTracing
return fullScreenDebugMode == FullScreenDebugMode.ScreenSpaceTracing
&& lightingDebugSettings.debugLightingMode == DebugLightingMode.ScreenSpaceTracingRefraction;
}

11
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


{
Opaque,
PreRefraction,
Transparent,
Transparent
}
static readonly string[] k_ForwardPassDebugName =

// The pass "SRPDefaultUnlit" is a fall back to legacy unlit rendering and is required to support unity 2d + unity UI that render in the scene.
ShaderPassName[] m_ForwardAndForwardOnlyPassNames = { new ShaderPassName(), new ShaderPassName(), HDShaderPassNames.s_SRPDefaultUnlitName };
ShaderPassName[] m_ForwardOnlyPassNames = { new ShaderPassName(), HDShaderPassNames.s_SRPDefaultUnlitName };
ShaderPassName[] m_ForwardSSReflectionPassNames = { HDShaderPassNames.s_ForwardName };
ShaderPassName[] m_AllTransparentPassNames = { HDShaderPassNames.s_TransparentBackfaceName,
HDShaderPassNames.s_ForwardOnlyName,

RTHandles.Release(m_DebugColorPickerBuffer);
RTHandles.Release(m_DebugFullScreenTempBuffer);
m_DebugScreenSpaceTracingData.Release();
HDCamera.ClearAll();

Mathf.Log(Mathf.Min(previousDepthPyramidRT.rt.width, previousDepthPyramidRT.rt.height), 2),
0.0f
));
}
}
var previousColorPyramidRT = hdCamera.GetPreviousFrameRT((int)HDCameraFrameHistoryType.ColorPyramid);
if (previousColorPyramidRT != null)

Mathf.Log(Mathf.Min(previousColorPyramidRT.rt.width, previousColorPyramidRT.rt.height), 2),
0.0f
));
}
}
}
}

m_LightLoop.RenderShadows(renderContext, cmd, m_CullResults);
// Overwrite camera properties set during the shadow pass with the original camera properties.
renderContext.SetupCameraProperties(camera, m_FrameSettings.enableStereo);
renderContext.SetupCameraProperties(camera, m_FrameSettings.enableStereo);
hdCamera.SetupGlobalParams(cmd, m_Time, m_LastTime);
if (m_FrameSettings.enableStereo) hdCamera.SetupGlobalStereoParams(cmd);
}

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDUtils.cs


cmd.DrawProcedural(Matrix4x4.identity, GetBlitMaterial(), bilinear ? 2 : 3, MeshTopology.Quads, 4, 1, s_PropertyBlock);
}
public static void BlitTexture(CommandBuffer cmd, RTHandleSystem.RTHandle source, RTHandleSystem.RTHandle destination, Vector4 scaleBias, float mipLevel, bool bilinear)
public static void BlitTexture(CommandBuffer cmd, RTHandleSystem.RTHandle source, RTHandleSystem.RTHandle destination, Vector4 scaleBias, float mipLevel, bool bilinear)
{
s_PropertyBlock.SetTexture(HDShaderIDs._BlitTexture, source);
s_PropertyBlock.SetVector(HDShaderIDs._BlitScaleBias, scaleBias);

18
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/LightLoop.hlsl


uint envLightStart, envLightCount;
// Fetch first env light to provide the scene proxy for screen space computation
#ifdef LIGHTLOOP_TILE_PASS
#ifdef LIGHTLOOP_TILE_PASS
#else
#else
#endif
#endif
// Reflection / Refraction hierarchy is
// 1. Screen Space Refraction / Reflection

if (envLightCount > 0)
{
}
{
}
if (featureFlags & LIGHTFEATUREFLAGS_SSREFLECTION)
{

// Only apply the sky IBL if the sky texture is available
if ((featureFlags & LIGHTFEATUREFLAGS_SKY) && _EnvLightSkyEnabled)
{
// The sky is a single cubemap texture separate from the reflection probe texture array (different resolution and compression)
context.sampleReflection = SINGLE_PASS_CONTEXT_SAMPLE_SKY;
// The sky is a single cubemap texture separate from the reflection probe texture array (different resolution and compression)
context.sampleReflection = SINGLE_PASS_CONTEXT_SAMPLE_SKY;
// The sky data are generated on the fly so the compiler can optimize the code
EnvLightData envLightSky = InitSkyEnvLightData(0);
// The sky data are generated on the fly so the compiler can optimize the code
EnvLightData envLightSky = InitSkyEnvLightData(0);
// Only apply the sky if we haven't yet accumulated enough IBL lighting.
if (reflectionHierarchyWeight < 1.0)

1
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


#define GBufferType3 float4
#define HAS_REFRACTION (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE)) && (defined(_REFRACTION_SSRAY_PROXY) || defined(_REFRACTION_SSRAY_HIZ))
#define HAS_SSREFLECTION (defined(_REFLECTION_SSRAY_PROXY) || defined(_REFLECTION_SSRAY_HIZ))
#define DEFAULT_SPECULAR_VALUE 0.04

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.shader


#pragma shader_feature _VERTEX_WIND
#pragma shader_feature _ _REFRACTION_PLANE _REFRACTION_SPHERE
#pragma shader_feature _ _REFRACTION_SSRAY_PROXY _REFRACTION_SSRAY_HIZ
#pragma shader_feature _ _EMISSIVE_MAPPING_PLANAR _EMISSIVE_MAPPING_TRIPLANAR
#pragma shader_feature _ _MAPPING_PLANAR _MAPPING_TRIPLANAR
#pragma shader_feature _NORMALMAP_TANGENT_SPACE

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/RenderPipelineResources/BufferPyramid.cs


foreach (var rth in m_DepthPyramidMips)
RTHandles.Release(rth);
}
}
public int GetPyramidLodCount(Vector2Int size)
{

18
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyManager.cs


public class BuiltinSkyParameters
{
public Matrix4x4 pixelCoordToViewDirMatrix;
public Matrix4x4 invViewProjMatrix;
public Vector3 cameraPosWS;
public Vector4 screenSize;
public CommandBuffer commandBuffer;
public Light sunLight;
public RTHandleSystem.RTHandle colorBuffer;
public RTHandleSystem.RTHandle depthBuffer;
public HDCamera hdCamera;
public Matrix4x4 pixelCoordToViewDirMatrix;
public Matrix4x4 invViewProjMatrix;
public Vector3 cameraPosWS;
public Vector4 screenSize;
public CommandBuffer commandBuffer;
public Light sunLight;
public RTHandleSystem.RTHandle colorBuffer;
public RTHandleSystem.RTHandle depthBuffer;
public HDCamera hdCamera;
public DebugDisplaySettings debugSettings;

8
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Sky/SkyRenderingContext.cs


internal class SkyRenderingContext
{
IBLFilterGGX m_IBLFilterGGX;
RTHandleSystem.RTHandle m_SkyboxCubemapRT;
RTHandleSystem.RTHandle m_SkyboxGGXCubemapRT;
RTHandleSystem.RTHandle m_SkyboxMarginalRowCdfRT;
RTHandleSystem.RTHandle m_SkyboxConditionalCdfRT;
RTHandleSystem.RTHandle m_SkyboxCubemapRT;
RTHandleSystem.RTHandle m_SkyboxGGXCubemapRT;
RTHandleSystem.RTHandle m_SkyboxMarginalRowCdfRT;
RTHandleSystem.RTHandle m_SkyboxConditionalCdfRT;
Vector4 m_CubemapScreenSize;
Matrix4x4[] m_facePixelCoordToViewDirMatrices = new Matrix4x4[6];
Matrix4x4[] m_faceCameraInvViewProjectionMatrix = new Matrix4x4[6];

正在加载...
取消
保存