浏览代码

HDRenderPipeline decals: Addressed PR feedback

/Add-support-for-light-specular-color-tint
sebastienlagarde 7 年前
当前提交
2f16949c
共有 22 个文件被更改,包括 160 次插入12 次删除
  1. 1
      ScriptableRenderPipeline/HDRenderPipeline/HDCustomSamplerId.cs
  2. 9
      ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
  3. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs
  4. 6
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.shader
  5. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitData.hlsl
  6. 3
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  7. 8
      ScriptableRenderPipeline/HDRenderPipeline/Decal.meta
  8. 11
      ScriptableRenderPipeline/HDRenderPipeline/Decal/DecalProjectorComponent.cs.meta
  9. 11
      ScriptableRenderPipeline/HDRenderPipeline/Decal/DecalSystem.cs.meta
  10. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal.meta
  11. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.cs.hlsl.meta
  12. 11
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.cs.meta
  13. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.hlsl.meta
  14. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.shader.meta
  15. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalData.hlsl.meta
  16. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalProperties.hlsl.meta
  17. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalUtilities.hlsl.meta
  18. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Editor.meta
  19. 11
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Editor/DecalUI.cs.meta
  20. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/ShaderPass.meta
  21. 9
      ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/ShaderPass/DecalSharePass.hlsl.meta
  22. 9
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDBuffer.hlsl.meta

1
ScriptableRenderPipeline/HDRenderPipeline/HDCustomSamplerId.cs


DepthPrepass,
TransparentDepthPrepass,
GBuffer,
DBuffer,
DisplayDebugViewMaterial,
DebugViewMaterialGBuffer,
BlitDebugViewMaterialDebug,

9
ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs


RenderDepthPrepass(m_CullResults, hdCamera, renderContext, cmd, true);
RenderDBuffer(hdCamera.cameraPos, renderContext, cmd);
RenderDBuffer(hdCamera.cameraPos, renderContext, cmd);
RenderGBuffer(m_CullResults, hdCamera, renderContext, cmd);

void RenderDBuffer(Vector3 cameraPos, ScriptableRenderContext renderContext, CommandBuffer cmd)
{
using (new ProfilingSample(cmd, "Decals"))
using (new ProfilingSample(cmd, "Decals", GetSampler(CustomSamplerId.DBuffer)))
Color clearColor = new Color(0,0,0,0);
CoreUtils.SetRenderTarget(cmd, m_DbufferManager.GetDBuffers(), m_CameraDepthStencilBufferRT, ClearFlag.Color, clearColor);
CoreUtils.SetRenderTarget(cmd, m_DbufferManager.GetDBuffers(), m_CameraDepthStencilBufferRT, ClearFlag.Color, CoreUtils.clearColorAllBlack);
cmd.SetGlobalTexture(HDShaderIDs._MainDepthTexture, GetDepthTexture());
DecalSystem.instance.Render(renderContext, cameraPos, cmd);
}

3
ScriptableRenderPipeline/HDRenderPipeline/HDStringConstants.cs


public static readonly int _Size = Shader.PropertyToID("_Size");
public static readonly int _Source4 = Shader.PropertyToID("_Source4");
public static readonly int _Result1 = Shader.PropertyToID("_Result1");
public static readonly int _DBufferTexture0 = Shader.PropertyToID("_DBufferTexture0");
public static readonly int _DBufferTexture1 = Shader.PropertyToID("_DBufferTexture1");
}
}

6
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.shader


Shader "HDRenderPipeline/Decal"
Shader "HDRenderPipeline/Decal"
{
Properties
{

HLSLINCLUDE
#pragma target 4.5
#pragma only_renderers d3d11 ps4 metal // TEMP: until we go futher in dev
#pragma only_renderers d3d11 ps4 xboxone vulkan metal
//#pragma enable_d3d11_debug_symbols
//-------------------------------------------------------------------------------------

Pass
{
Name "DBuffer" // Name is not used
Tags { "LightMode" = "dBuffer" } // This will be only for opaque object based on the RenderQueue index
Tags { "LightMode" = "DBuffer" } // This will be only for opaque object based on the RenderQueue index
// need to optimize this and use proper Cull and ZTest modes for cases when decal geometry is clipped by camera
Cull Off

2
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitData.hlsl


surfaceData.specularOcclusion = 1.0;
#endif
AddDecalContribution(posInput.positionSS, surfaceData);
GetBuiltinData(input, surfaceData, alpha, bentNormalWS, depthOffset, builtinData);
}

3
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


// This is use with anisotropic material
surfaceData.tangentWS = Orthonormalize(surfaceData.tangentWS, surfaceData.normalWS);
AddDecalContribution(posInput.positionSS, surfaceData);
AddDecalContribution(posInput.positionSS, surfaceData);
}
#include "LitDataMeshModification.hlsl"

8
ScriptableRenderPipeline/HDRenderPipeline/Decal.meta


fileFormatVersion: 2
guid: e23938c16411b694c9f86517a2ad5e5e
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

11
ScriptableRenderPipeline/HDRenderPipeline/Decal/DecalProjectorComponent.cs.meta


fileFormatVersion: 2
guid: f19d9143a39eb3b46bc4563e9889cfbd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

11
ScriptableRenderPipeline/HDRenderPipeline/Decal/DecalSystem.cs.meta


fileFormatVersion: 2
guid: 3305c9249c40f8b43a953a8a6eb87a82
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal.meta


fileFormatVersion: 2
guid: ce1e252deae73a04a96dc6d2014164ca
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.cs.hlsl.meta


fileFormatVersion: 2
guid: 2f597db7b26e3364e96b55892e001ff8
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

11
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.cs.meta


fileFormatVersion: 2
guid: 77304d3868098cb40af6328dba0bafda
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.hlsl.meta


fileFormatVersion: 2
guid: 24e76285bfb1d4648aeaf39ced47c9ee
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Decal.shader.meta


fileFormatVersion: 2
guid: 1d64af84bdc970c4fae0c1e06dd95b73
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalData.hlsl.meta


fileFormatVersion: 2
guid: 8d7b72155c1f8c74592263fbe5a557df
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalProperties.hlsl.meta


fileFormatVersion: 2
guid: 295b85a50f6edfe488511041c695c48a
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/DecalUtilities.hlsl.meta


fileFormatVersion: 2
guid: 025b8dd135d8eac4da1b8178d944d4a6
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Editor.meta


fileFormatVersion: 2
guid: 63b8d3eb0967b4f41b631c98f7e9b027
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

11
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/Editor/DecalUI.cs.meta


fileFormatVersion: 2
guid: bd489cfbe365c5749980ef35538739db
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

8
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/ShaderPass.meta


fileFormatVersion: 2
guid: c95c191806c59d74ebecbd500cbed836
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/Material/Decal/ShaderPass/DecalSharePass.hlsl.meta


fileFormatVersion: 2
guid: 264d5aec19233224fa311299fb752e53
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

9
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassDBuffer.hlsl.meta


fileFormatVersion: 2
guid: 3e465a3a5bd2869419f16363a863b82d
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存