浏览代码

HDRenderLoop: Move a lot of files for better classification

/main
Sebastien Lagarde 8 年前
当前提交
ba76c316
共有 57 个文件被更改,包括 287 次插入181 次删除
  1. 26
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  2. 4
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterialGBuffer.shader
  3. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl
  4. 10
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl
  5. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader
  6. 4
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader
  7. 6
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl
  8. 6
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl
  9. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred.meta
  10. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward.meta
  11. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin.meta
  12. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit.meta
  13. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.meta
  14. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.meta
  15. 197
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs
  16. 157
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.cs
  17. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward/LightingForward.hlsl.meta
  18. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader.meta
  19. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader
  20. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward/LightingForward.hlsl
  21. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.hlsl
  22. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.hlsl.meta
  23. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.hlsl.meta
  24. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.hlsl
  25. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl.meta
  26. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.hlsl
  27. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.hlsl.meta
  28. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.meta
  29. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.hlsl.meta
  30. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.meta
  31. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs
  32. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.hlsl
  33. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl
  34. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.meta
  35. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.hlsl.meta
  36. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader
  37. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader.meta
  38. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.shader
  39. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.shader.meta
  40. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl
  41. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl.meta
  42. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitUI.cs.meta
  43. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitUI.cs
  44. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLit.shader
  45. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLit.shader.meta
  46. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl
  47. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl.meta
  48. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitUI.cs
  49. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitUI.cs.meta
  50. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs
  51. 0
      /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.hlsl

26
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


Material m_DeferredMaterial;
Material m_FinalPassMaterial;
// TODO: Find a way to automatically create/iterate through these kind of class
Lit.RenderLoop m_litRenderLoop = new Lit.RenderLoop();
// Debug
Material m_DebugViewMaterialGBuffer;

{
ClearComputeBuffers();
// Init lit gbuffer
gbufferManager.gbufferCount = Lit.GBufferDescription.s_gbufferCount;
for (int gbufferIndex = 0; gbufferIndex < gbufferManager.gbufferCount; ++gbufferIndex)
{
gbufferManager.SetBufferDescription(gbufferIndex, "_CameraGBufferTexture" + gbufferIndex, Lit.GBufferDescription.RTFormat[gbufferIndex], Lit.GBufferDescription.RTReadWrite[gbufferIndex]);
}
s_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture");
s_CameraDepthBuffer = Shader.PropertyToID("_CameraDepthTexture");

m_cubeReflTexArray = new TextureCacheCubemap();
m_cubeReflTexArray.AllocTextureArray(32, (int)m_TextureSettings.reflectionCubemapSize, TextureFormat.BC6H, true);
// Init Lit material buffer - GBuffer and init
gbufferManager.gbufferCount = m_litRenderLoop.GetGBufferCount();
for (int gbufferIndex = 0; gbufferIndex < gbufferManager.gbufferCount; ++gbufferIndex)
{
gbufferManager.SetBufferDescription(gbufferIndex, "_CameraGBufferTexture" + gbufferIndex, m_litRenderLoop.RTFormat[gbufferIndex], m_litRenderLoop.RTReadWrite[gbufferIndex]);
}
m_litRenderLoop.Rebuild();
m_litRenderLoop.OnDisable();
s_punctualLightList.Release();
s_envLightList.Release();

public override void Render(Camera[] cameras, RenderLoop renderLoop)
{
if (!m_litRenderLoop.isInit)
{
m_litRenderLoop.RenderInit(renderLoop);
}
// Do anything we need to do upon a new frame.
NewFrame();

4
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterialGBuffer.shader


#pragma vertex VertDeferred
#pragma fragment FragDeferred
#include "Assets/ScriptableRenderLoop/ShaderLibrary/Color.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterial.hlsl"
#include "Assets/ScriptableRenderLoop/ShaderLibrary/Color.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterial.hlsl"
DECLARE_GBUFFER_TEXTURE(_CameraGBufferTexture);
DECLARE_GBUFFER_BAKE_LIGHTING(_CameraGBufferTexture);

2
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl


#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl"
#include "LightingForward.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward/LightingForward.hlsl"
#endif // UNITY_LIGHTING_INCLUDED

10
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl


#include "Assets/ScriptableRenderLoop/ShaderLibrary/Debug.hlsl"
#include "Assets/ScriptableRenderLoop/ShaderLibrary/GeometricTools.hlsl"
#include "../ShaderConfig.cs"
#include "../LightDefinition.cs.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderConfig.cs"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.hlsl"
//-----------------------------------------------------------------------------
// common Encode/Decode functions

// BuiltinData
//-----------------------------------------------------------------------------
#include "BuiltinData.hlsl"
#include "Builtin/BuiltinData.hlsl"
//-----------------------------------------------------------------------------
// SurfaceData

#ifdef UNITY_MATERIAL_LIT
#include "Lit.hlsl"
#include "Lit/Lit.hlsl"
#include "Unlit.hlsl"
#include "Unlit/Unlit.hlsl"
#endif
//-----------------------------------------------------------------------------

2
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader


// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_DISNEYGXX
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderVariables.hlsl"
DECLARE_GBUFFER_TEXTURE(_CameraGBufferTexture);

4
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader


#include "Assets/ScriptableRenderLoop/ShaderLibrary/Common.hlsl"
#define UNITY_MATERIAL_UNLIT
#include "Material/Material.hlsl"
#include "ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Material.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderVariables.hlsl"
float4 _Color;
UNITY_DECLARE_TEX2D(_ColorMap);

6
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl


// No guard header!
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Lighting/Lighting.hlsl" // This include Material.hlsl
#include "ShaderVariables.hlsl"
#include "Debug/DebugViewMaterial.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterial.hlsl"
// This files is generated by the ShaderGraph or written by hand

6
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl


// No guard header!
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl
#include "Lighting/Lighting.hlsl" // This include Material.hlsl
#include "ShaderVariables.hlsl"
#include "Debug/DebugViewMaterial.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/Lighting.hlsl" // This include Material.hlsl
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/ShaderVariables.hlsl"
#include "Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Debug/DebugViewMaterial.hlsl"
// This files is generated by the ShaderGraph or written by hand

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred.meta


fileFormatVersion: 2
guid: df85c88f855185249aad13cf37a4952a
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward.meta


fileFormatVersion: 2
guid: 8f27521401d2efc4fb35f246e296940e
folderAsset: yes
timeCreated: 1476653182
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin.meta


fileFormatVersion: 2
guid: af4ee1f6f88b039449ba02003b0f332d
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit.meta


fileFormatVersion: 2
guid: cebd0ba54432759488065d1592e05692
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.meta


fileFormatVersion: 2
guid: bc7a695b2cdc540469c664a11eb502d0
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.meta


fileFormatVersion: 2
guid: 355ba1f7a06cc7a4abe51689715bb1e7
folderAsset: yes
timeCreated: 1476653182
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

197
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs


using UnityEngine;
using UnityEngine.Rendering;
using System;
//-----------------------------------------------------------------------------
// structure definition
//-----------------------------------------------------------------------------
namespace UnityEngine.ScriptableRenderLoop
{
namespace Lit
{
[GenerateHLSL(PackingRules.Exact)]
public enum MaterialId
{
LitStandard = 0,
LitSSS = 1,
LitClearCoat = 2,
LitSpecular = 3,
LitAniso = 4 // Should be the last as it is not setup by the users but generated based on anisotropy property
};
//-----------------------------------------------------------------------------
// SurfaceData
//-----------------------------------------------------------------------------
// Main structure that store the user data (i.e user input of master node in material graph)
[GenerateHLSL(PackingRules.Exact, false, true, 1000)]
public struct SurfaceData
{
[SurfaceDataAttributes("Base Color")]
public Vector3 baseColor;
[SurfaceDataAttributes("Specular Occlusion")]
public float specularOcclusion;
[SurfaceDataAttributes("Normal")]
public Vector3 normalWS;
[SurfaceDataAttributes("Smoothness")]
public float perceptualSmoothness;
[SurfaceDataAttributes("Material ID")]
public MaterialId materialId;
[SurfaceDataAttributes("Ambient Occlusion")]
public float ambientOcclusion;
// MaterialId dependent attribute
// standard
[SurfaceDataAttributes("Tangent")]
public Vector3 tangentWS;
[SurfaceDataAttributes("Anisotropy")]
public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction)
[SurfaceDataAttributes("Metalic")]
public float metalic;
[SurfaceDataAttributes("Specular")]
public float specular; // 0.02, 0.04, 0.16, 0.2
// SSS
[SurfaceDataAttributes("SubSurface Radius")]
public float subSurfaceRadius;
[SurfaceDataAttributes("Thickness")]
public float thickness;
[SurfaceDataAttributes("SubSurface Profile")]
public int subSurfaceProfile;
// Clearcoat
[SurfaceDataAttributes("Coat Normal")]
public Vector3 coatNormalWS;
[SurfaceDataAttributes("Coat Smoothness")]
public float coatPerceptualSmoothness;
// SpecColor
[SurfaceDataAttributes("Specular Color")]
public Vector3 specularColor;
};
//-----------------------------------------------------------------------------
// BSDFData
//-----------------------------------------------------------------------------
[GenerateHLSL(PackingRules.Exact, false, true, 1030)]
public struct BSDFData
{
public Vector3 diffuseColor;
public Vector3 fresnel0;
public float specularOcclusion;
public Vector3 normalWS;
public float perceptualRoughness;
public float roughness;
public float materialId;
// MaterialId dependent attribute
// standard
public Vector3 tangentWS;
public Vector3 bitangentWS;
public float roughnessT;
public float roughnessB;
public float anisotropy;
// fold into fresnel0
// SSS
public float subSurfaceRadius;
public float thickness;
public int subSurfaceProfile;
// Clearcoat
public Vector3 coatNormalWS;
public float coatRoughness;
// SpecColor
// fold into fresnel0
};
//-----------------------------------------------------------------------------
// GBuffer management
//-----------------------------------------------------------------------------
[GenerateHLSL(PackingRules.Exact)]
public enum GBufferMaterial
{
Count = 3
};
public class RenderLoop : Object
{
#if (VELOCITY_IN_GBUFFER)
public const int s_GBufferCount = (int)GBufferMaterial.Count + 2; // +1 for emissive buffer
#else
public const int s_GBufferCount = (int)GBufferMaterial.Count + 1;
#endif
public int GetGBufferCount() { return s_GBufferCount; }
public RenderTextureFormat[] RTFormat =
{
RenderTextureFormat.ARGB32,
RenderTextureFormat.ARGB2101010,
RenderTextureFormat.ARGB32,
#if (VELOCITY_IN_GBUFFER)
RenderTextureFormat.RGHalf,
#endif
RenderTextureFormat.RGB111110Float
};
public RenderTextureReadWrite[] RTReadWrite =
{
RenderTextureReadWrite.sRGB,
RenderTextureReadWrite.Linear,
RenderTextureReadWrite.Linear,
#if (VELOCITY_IN_GBUFFER)
RenderTextureReadWrite.Linear,
#endif
RenderTextureReadWrite.Linear
};
public Material m_InitPreDFG;
public bool isInit;
private RenderTexture s_PreIntegratedDFG;
Material CreateEngineMaterial(string shaderPath)
{
Material mat = new Material(Shader.Find(shaderPath) as Shader);
mat.hideFlags = HideFlags.HideAndDontSave;
return mat;
}
public void Rebuild()
{
m_InitPreDFG = CreateEngineMaterial("Hidden/Unity/LightingDeferred");
s_PreIntegratedDFG = new RenderTexture(128, 128, 0, RenderTextureFormat.ARGBHalf);
isInit = false;
}
public void OnDisable()
{
if (m_InitPreDFG) DestroyImmediate(m_InitPreDFG);
// TODO: how to delete RenderTexture ?
isInit = false;
}
public void RenderInit(UnityEngine.Rendering.RenderLoop renderLoop)
{
var cmd = new CommandBuffer();
cmd.name = "Init PreDFG";
cmd.Blit(null, new RenderTargetIdentifier(s_PreIntegratedDFG), m_InitPreDFG, 0);
renderLoop.ExecuteCommandBuffer(cmd);
cmd.Dispose();
isInit = true;
}
}
}
}

157
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.cs


using UnityEngine;
//-----------------------------------------------------------------------------
// structure definition
//-----------------------------------------------------------------------------
namespace UnityEngine.ScriptableRenderLoop
{
namespace Lit
{
[GenerateHLSL(PackingRules.Exact)]
public enum MaterialId
{
LitStandard = 0,
LitSSS = 1,
LitClearCoat = 2,
LitSpecular = 3,
LitAniso = 4 // Should be the last as it is not setup by the users but generated based on anisotropy property
};
//-----------------------------------------------------------------------------
// SurfaceData
//-----------------------------------------------------------------------------
// Main structure that store the user data (i.e user input of master node in material graph)
[GenerateHLSL(PackingRules.Exact, false, true, 1000)]
public struct SurfaceData
{
[SurfaceDataAttributes("Base Color")]
public Vector3 baseColor;
[SurfaceDataAttributes("Specular Occlusion")]
public float specularOcclusion;
[SurfaceDataAttributes("Normal")]
public Vector3 normalWS;
[SurfaceDataAttributes("Smoothness")]
public float perceptualSmoothness;
[SurfaceDataAttributes("Material ID")]
public MaterialId materialId;
[SurfaceDataAttributes("Ambient Occlusion")]
public float ambientOcclusion;
// MaterialId dependent attribute
// standard
[SurfaceDataAttributes("Tangent")]
public Vector3 tangentWS;
[SurfaceDataAttributes("Anisotropy")]
public float anisotropy; // anisotropic ratio(0->no isotropic; 1->full anisotropy in tangent direction)
[SurfaceDataAttributes("Metalic")]
public float metalic;
[SurfaceDataAttributes("Specular")]
public float specular; // 0.02, 0.04, 0.16, 0.2
// SSS
[SurfaceDataAttributes("SubSurface Radius")]
public float subSurfaceRadius;
[SurfaceDataAttributes("Thickness")]
public float thickness;
[SurfaceDataAttributes("SubSurface Profile")]
public int subSurfaceProfile;
// Clearcoat
[SurfaceDataAttributes("Coat Normal")]
public Vector3 coatNormalWS;
[SurfaceDataAttributes("Coat Smoothness")]
public float coatPerceptualSmoothness;
// SpecColor
[SurfaceDataAttributes("Specular Color")]
public Vector3 specularColor;
};
//-----------------------------------------------------------------------------
// BSDFData
//-----------------------------------------------------------------------------
[GenerateHLSL(PackingRules.Exact, false, true, 1030)]
public struct BSDFData
{
public Vector3 diffuseColor;
public Vector3 fresnel0;
public float specularOcclusion;
public Vector3 normalWS;
public float perceptualRoughness;
public float roughness;
public float materialId;
// MaterialId dependent attribute
// standard
public Vector3 tangentWS;
public Vector3 bitangentWS;
public float roughnessT;
public float roughnessB;
public float anisotropy;
// fold into fresnel0
// SSS
public float subSurfaceRadius;
public float thickness;
public int subSurfaceProfile;
// Clearcoat
public Vector3 coatNormalWS;
public float coatRoughness;
// SpecColor
// fold into fresnel0
};
//-----------------------------------------------------------------------------
// GBuffer management
//-----------------------------------------------------------------------------
[GenerateHLSL(PackingRules.Exact)]
public enum GBufferMaterial
{
Count = 3
};
struct GBufferDescription
{
#if (VELOCITY_IN_GBUFFER)
public const int s_gbufferCount = (int)GBufferMaterial.Count + 2; // +1 for emissive buffer
#else
public const int s_gbufferCount = (int)GBufferMaterial.Count + 1;
#endif
public static RenderTextureFormat[] RTFormat =
{
RenderTextureFormat.ARGB32,
RenderTextureFormat.ARGB2101010,
RenderTextureFormat.ARGB32,
#if (VELOCITY_IN_GBUFFER)
RenderTextureFormat.RGHalf,
#endif
RenderTextureFormat.RGB111110Float
};
public static RenderTextureReadWrite[] RTReadWrite =
{
RenderTextureReadWrite.sRGB,
RenderTextureReadWrite.Linear,
RenderTextureReadWrite.Linear,
#if (VELOCITY_IN_GBUFFER)
RenderTextureReadWrite.Linear,
#endif
RenderTextureReadWrite.Linear
};
}
}
}

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward/LightingForward.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred.shader.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred.shader → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingDeferred/LightingDeferred.shader

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightingForward/LightingForward.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.cs.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.cs.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.cs.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.cs.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.cs.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/BuiltinData.cs → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Builtin/BuiltinData.cs

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.cs.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.cs.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LightDefinition.cs.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LightDefinition.cs.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Unlit.shader → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Unlit.shader.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Unlit/Unlit.shader.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lit.shader → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.shader

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lit.shader.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/Lit.shader.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LitTemplate.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LitTemplate.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitTemplate.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LitUI.cs.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitUI.cs.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LitUI.cs → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LitUI.cs

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLit.shader → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLit.shader

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLit.shader.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLit.shader.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLitTemplate.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLitTemplate.hlsl.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitTemplate.hlsl.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLitUI.cs → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitUI.cs

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LayeredLitUI.cs.meta → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/LayeredLit/LayeredLitUI.cs.meta

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LightDefinition.cs → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs

/Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/LightDefinition.cs.hlsl → /Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Lighting/LightDefinition.cs.hlsl

正在加载...
取消
保存