浏览代码

Merge pull request #10 from EvgeniiG/master

Add area light support with Fresnel and Disney Diffuse
/main
GitHub 8 年前
当前提交
82b0fe2c
共有 23 个文件被更改,包括 3118 次插入1049 次删除
  1. 1
      .gitignore
  2. 34
      Assets/ScriptableRenderLoop/AdditionalLightData.cs
  3. 88
      Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs
  4. 6
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl
  5. 54
      Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePassLoop.hlsl
  6. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Material.meta
  7. 2
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit.meta
  8. 980
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.cs
  9. 130
      Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl
  10. 29
      Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl
  11. 688
      Assets/TestScenes/HDTest/HDRenderLoopTest.unity
  12. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders.meta
  13. 92
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/unlitTwoSided.mat
  14. 8
      Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/unlitTwoSided.mat.meta
  15. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material.meta
  16. 9
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit.meta
  17. 1001
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.DisneyDiffuse.cs
  18. 12
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.DisneyDiffuse.cs.meta
  19. 1001
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.GGX.cs
  20. 12
      Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.GGX.cs.meta

1
.gitignore


Assets/UnityHDRI.meta
Assets/UnityHDRI/Gareoult/GareoultWhiteBalanced.exr
obj/Debug/Assembly-CSharp.csproj.FileListAbsolute.txt

34
Assets/ScriptableRenderLoop/AdditionalLightData.cs


public bool affectDiffuse = true;
public bool affectSpecular = true;
// Area Light Hack
public bool treatAsAreaLight = false;
public bool isDoubleSided = false;
[RangeAttribute(0.0f, 20.0f)]
public float areaLightLength = 0.0f;
[RangeAttribute(0.0f, 20.0f)]
public float areaLightWidth = 0.0f;
public static float GetInnerSpotPercent01(AdditionalLightData lightData)
{
if (lightData != null)

return lightData.shadowResolution;
else
return DefaultShadowResolution;
}
public static bool GetTreatAsAreaLight(AdditionalLightData lightData)
{
if (lightData != null)
return lightData.treatAsAreaLight;
else
return false;
}
public static bool GetIsDoubleSided(AdditionalLightData lightData)
{
if (lightData != null)
return lightData.isDoubleSided;
else
return false;
}
public static Vector2 GetAreaLightDimensions(AdditionalLightData lightData)
{
if (lightData != null)
return new Vector2(lightData.areaLightLength, lightData.areaLightWidth);
else
return new Vector2(0.0f, 0.0f);
}
}
}

88
Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.cs


private ComputeBuffer s_punctualLightList;
private ComputeBuffer s_envLightList;
private ComputeBuffer s_areaLightList;
private ComputeBuffer s_punctualShadowList;
private TextureCacheCubemap m_cubeReflTexArray;

if (s_punctualLightList != null)
s_punctualLightList.Release();
if (s_areaLightList != null)
s_areaLightList.Release();
if (s_punctualShadowList != null)
s_punctualShadowList.Release();

{
ClearComputeBuffers();
s_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture");
s_CameraDepthBuffer = Shader.PropertyToID("_CameraDepthTexture");
s_CameraColorBuffer = Shader.PropertyToID("_CameraColorTexture");
s_CameraDepthBuffer = Shader.PropertyToID("_CameraDepthTexture");
s_punctualLightList = new ComputeBuffer(MaxLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(PunctualLightData)));
s_envLightList = new ComputeBuffer(MaxLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(EnvLightData)));
s_punctualLightList = new ComputeBuffer(MaxLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(PunctualLightData)));
s_areaLightList = new ComputeBuffer(MaxLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(AreaLightData)));
s_envLightList = new ComputeBuffer(MaxLights, System.Runtime.InteropServices.Marshal.SizeOf(typeof(EnvLightData)));
m_DeferredMaterial = CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_FinalPassMaterial = CreateEngineMaterial("Hidden/HDRenderLoop/FinalPass");
m_DeferredMaterial = CreateEngineMaterial("Hidden/HDRenderLoop/Deferred");
m_FinalPassMaterial = CreateEngineMaterial("Hidden/HDRenderLoop/FinalPass");
// Debug
m_DebugViewMaterialGBuffer = CreateEngineMaterial("Hidden/HDRenderLoop/DebugViewMaterialGBuffer");

m_LitRenderLoop.OnDisable();
s_punctualLightList.Release();
s_areaLightList.Release();
if (m_DeferredMaterial) DestroyImmediate(m_DeferredMaterial);
if (m_DeferredMaterial) DestroyImmediate(m_DeferredMaterial);
if (m_FinalPassMaterial) DestroyImmediate(m_FinalPassMaterial);
m_cubeReflTexArray.Release();

void UpdatePunctualLights(VisibleLight[] visibleLights, ref ShadowOutput shadowOutput)
{
var lights = new List<PunctualLightData>();
var pLights = new List<PunctualLightData>();
var aLights = new List<AreaLightData>();
for (int lightIndex = 0; lightIndex < Math.Min(visibleLights.Length, MaxLights); lightIndex++)
for (int lightIndex = 0, numLights = Math.Min(visibleLights.Length, MaxLights); lightIndex < numLights; ++lightIndex)
if (light.lightType != LightType.Spot && light.lightType != LightType.Point && light.lightType != LightType.Directional)
if (light.lightType == LightType.Area) {
// Skip area lights which are currently only used for baking.
}
var additionalLightData = light.light.GetComponent<AdditionalLightData>();
// Correct intensity calculation (different from Unity)
var lightColorR = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.r);
var lightColorG = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.g);
var lightColorB = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.b);
var additionalData = light.light.GetComponent<AdditionalLightData>();
// Test whether we should treat this punctual light as an area light.
// It's a temporary hack until the proper UI support is added.
if (AdditionalLightData.GetTreatAsAreaLight(additionalData))
{
AreaLightData lightData = new AreaLightData();
// TODO: add AreaShapeType.Line support for small widths.
lightData.shapeType = AreaShapeType.Rectangle;
lightData.size = new Vector2(additionalData.areaLightLength, additionalData.areaLightWidth);
lightData.twoSided = additionalData.isDoubleSided ? 1.0f : 0.0f;
lightData.positionWS = light.light.transform.position;
lightData.forward = light.light.transform.forward; // Note: Light direction is oriented backward (-Z)
lightData.up = light.light.transform.up;
lightData.right = light.light.transform.right;
lightData.color = new Vector3(lightColorR, lightColorG, lightColorB);
lightData.diffuseScale = additionalData.affectDiffuse ? 1.0f : 0.0f;
lightData.specularScale = additionalData.affectSpecular ? 1.0f : 0.0f;
lightData.shadowDimmer = additionalData.shadowDimmer;
lightData.invSqrAttenuationRadius = 1.0f / (light.range * light.range);
aLights.Add(lightData);
// TODO: shadows.
continue;
}
var l = new PunctualLightData();

l.invSqrAttenuationRadius = 1.0f / (light.range * light.range);
}
// Correct intensity calculation (Different from Unity)
var lightColorR = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.r);
var lightColorG = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.g);
var lightColorB = light.light.intensity * Mathf.GammaToLinearSpace(light.light.color.b);
l.color.Set(lightColorR, lightColorG, lightColorB);

{
var spotAngle = light.light.spotAngle;
var innerConePercent = AdditionalLightData.GetInnerSpotPercent01(additionalLightData);
var innerConePercent = AdditionalLightData.GetInnerSpotPercent01(additionalData);
var cosSpotOuterHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * Mathf.Deg2Rad), 0.0f, 1.0f);
var cosSpotInnerHalfAngle = Mathf.Clamp(Mathf.Cos(spotAngle * 0.5f * innerConePercent * Mathf.Deg2Rad), 0.0f, 1.0f); // inner cone

l.angleOffset = 2.0f;
}
l.diffuseScale = AdditionalLightData.GetAffectDiffuse(additionalLightData) ? 1.0f : 0.0f;
l.specularScale = AdditionalLightData.GetAffectSpecular(additionalLightData) ? 1.0f : 0.0f;
l.shadowDimmer = AdditionalLightData.GetShadowDimmer(additionalLightData);
l.diffuseScale = AdditionalLightData.GetAffectDiffuse(additionalData) ? 1.0f : 0.0f;
l.specularScale = AdditionalLightData.GetAffectSpecular(additionalData) ? 1.0f : 0.0f;
l.shadowDimmer = AdditionalLightData.GetShadowDimmer(additionalData);
l.IESIndex = -1;
l.cookieIndex = -1;

}
}
lights.Add(l);
pLights.Add(l);
s_punctualLightList.SetData(lights.ToArray());
s_punctualLightList.SetData(pLights.ToArray());
s_areaLightList.SetData(aLights.ToArray());
Shader.SetGlobalInt("_PunctualLightCount", lights.Count);
Shader.SetGlobalBuffer("_AreaLightList", s_areaLightList);
Shader.SetGlobalInt("_PunctualLightCount", pLights.Count);
Shader.SetGlobalInt("_AreaLightCount", aLights.Count);
Shader.SetGlobalBuffer("_PunctualShadowList", s_punctualShadowList);
}

6
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePass.hlsl


// Constant and structure declaration
// ----------------------------------------------------------------------------
StructuredBuffer<PunctualLightData> _PunctualLightList;
StructuredBuffer<EnvLightData> _EnvLightList;
StructuredBuffer<PunctualLightData> _PunctualLightList;
StructuredBuffer<AreaLightData> _AreaLightList;
StructuredBuffer<EnvLightData> _EnvLightList;
StructuredBuffer<PunctualShadowData> _PunctualShadowList;
//TEXTURE2D_ARRAY(_ShadowArray);

CBUFFER_START(UnityPerLightLoop)
int _PunctualLightCount;
int _AreaLightCount;
int _EnvLightCount;
EnvLightData _EnvLightSky;
float4 _ShadowMapSize;

54
Assets/ScriptableRenderLoop/HDRenderLoop/Lighting/SinglePass/SinglePassLoop.hlsl


LightLoopContext context;
ZERO_INITIALIZE(LightLoopContext, context);
diffuseLighting = float3(0.0, 0.0, 0.0);
diffuseLighting = float3(0.0, 0.0, 0.0);
for (int i = 0; i < _PunctualLightCount; ++i)
int i = 0; // Declare once to avoid the D3D11 compiler warning.
for (i = 0; i < _PunctualLightCount; ++i)
float3 localDiffuseLighting;
float3 localSpecularLighting;
EvaluateBSDF_Punctual(context, V, positionWS, prelightData, _PunctualLightList[i], bsdfData, localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
float3 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Punctual(context, V, positionWS, prelightData, _PunctualLightList[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
/*
for (int i = 0; i < 4; ++i)
for (i = 0; i < _AreaLightCount; ++i)
float4 localDiffuseLighting;
float4 localSpecularLighting;
EvaluateBSDF_Area(0, V, positionWS, areaLightData[i], bsdfData, localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;
float3 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Area(context, V, positionWS, prelightData, _AreaLightList[i], bsdfData,
localDiffuseLighting, localSpecularLighting);
diffuseLighting += localDiffuseLighting;
specularLighting += localSpecularLighting;
*/
float3 iblDiffuseLighting = float3(0.0, 0.0, 0.0);
float weightDiffuse = 0.0;
float3 iblDiffuseLighting = float3(0.0, 0.0, 0.0);
float weightSpecular = 0.0;
float weightDiffuse = 0.0;
float weightSpecular = 0.0;
for (int j = 0; j < _EnvLightCount; ++j)
for (i = 0; i < _EnvLightCount; ++i)
float3 localDiffuseLighting;
float3 localSpecularLighting;
float3 localDiffuseLighting, localSpecularLighting;
EvaluateBSDF_Env(context, V, positionWS, prelightData, _EnvLightList[j], bsdfData, localDiffuseLighting, localSpecularLighting, weight);
iblDiffuseLighting = lerp(iblDiffuseLighting, localDiffuseLighting, weight.x); // Should be remove by the compiler if it is smart as all is constant 0
EvaluateBSDF_Env(context, V, positionWS, prelightData, _EnvLightList[i], bsdfData, localDiffuseLighting, localSpecularLighting, weight);
iblDiffuseLighting = lerp(iblDiffuseLighting, localDiffuseLighting, weight.x); // Should be remove by the compiler if it is smart as all is constant 0
iblSpecularLighting = lerp(iblSpecularLighting, localSpecularLighting, weight.y);
}

float3 localDiffuseLighting;
float3 localSpecularLighting;
float3 localDiffuseLighting, localSpecularLighting;
iblDiffuseLighting = lerp(iblDiffuseLighting, localDiffuseLighting, weight.x); // Should be remove by the compiler if it is smart as all is constant 0
iblDiffuseLighting = lerp(iblDiffuseLighting, localDiffuseLighting, weight.x); // Should be remove by the compiler if it is smart as all is constant 0
diffuseLighting += iblDiffuseLighting;
diffuseLighting += iblDiffuseLighting;
specularLighting += iblSpecularLighting;
diffuseLighting += bakeDiffuseLighting;

2
Assets/ScriptableRenderLoop/HDRenderLoop/Material.meta


fileFormatVersion: 2
guid: b7bc5becc2cf7f14292d68bcd5fdeba6
guid: 752ba4c5a264906428ff58cb5973e10a
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro

2
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit.meta


fileFormatVersion: 2
guid: bc7a695b2cdc540469c664a11eb502d0
guid: 24406b9cf8c7f2543b7d20ead11e37d5
folderAsset: yes
timeCreated: 1476653183
licenseType: Pro

980
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.cs
文件差异内容过多而无法显示
查看文件

130
Assets/ScriptableRenderLoop/HDRenderLoop/Material/Lit/Lit.hlsl


// Use optimization of Precomputing LambdaV
// TODO: Test if this is a win
// #define LIT_USE_BSDF_PRE_LAMBDAV
// TODO: Check if anisotropy with a dynamic if on anisotropy > 0 is performant. Because it may mean we always calculate both isotropy and anisotropy case.
// Maybe we should always calculate anisotropy in case of standard ? Don't think the compile can optimize correctly.
// TODO: Check if anisotropy with a dynamic if on anisotropy > 0 is performant. Because it may mean we always calculate both isotrpy and anisotropy case.
// Maybe we should always calculate anisotropy in case of standard ? Don't think the compile can optimize correctly.
// TODO: How can I declare a sampler for this one that is bilinear filtering
SAMPLER2D(sampler_PreIntegratedFGD);
#define SRL_PointSampler sampler_PreIntegratedFGD // Used for all textures
// TODO: This one should be set into a constant Buffer at pass frequency (with _Screensize)
TEXTURE2D(_PreIntegratedFGD);
TEXTURE2D(_LtcGGXMatrix); // RGBA
TEXTURE2D(_LtcDisneyDiffuseMatrix); // RGBA
TEXTURE2D(_LtcMultiGGXFresnelDisneyDiffuse); // RGB, A unused
// Helper functions/variable specific to this materia
// Helper functions/variable specific to this material
//-----------------------------------------------------------------------------
float PackMaterialId(int materialId)

return int(round(f * 3.0));
}
// TODO: How can I declare a sampler for this one that is bilinear filtering
// TODO: This one should be set into a constant Buffer at pass frequency (with _Screensize)
TEXTURE2D(_PreIntegratedFGD);
SAMPLER2D(sampler_PreIntegratedFGD);
TEXTURE2D(_LtcGGXMatrix);
SAMPLER2D(sampler_LtcGGXMatrix);
TEXTURE2D(_LtcGGXMagnitude);
SAMPLER2D(sampler_LtcGGXMagnitude);
// For image based lighting, a part of the BSDF is pre-integrated.
// This is done both for specular and diffuse (in case of DisneyDiffuse)
void GetPreIntegratedFGD(float NdotV, float perceptualRoughness, float3 fresnel0, out float3 specularFGD, out float diffuseFGD)

// _PreIntegratedFGD.y = Gv * Fc
// Pre integrate DisneyDiffuse FGD:
// _PreIntegratedFGD.z = DisneyDiffuse
float3 preFGD = SAMPLE_TEXTURE2D_LOD(_PreIntegratedFGD, sampler_PreIntegratedFGD, float2(NdotV, perceptualRoughness), 0).xyz;
float3 preFGD = SAMPLE_TEXTURE2D_LOD(_PreIntegratedFGD, SRL_PointSampler, float2(NdotV, perceptualRoughness), 0).xyz;
// f0 * Gv * (1 - Fc) + Gv * Fc
specularFGD = fresnel0 * preFGD.x + preFGD.y;

// image based lighting
// These variables aim to be use with EvaluateBSDF_Env
float3 iblNormalWS; // Normal to be use with image based lighting
float3 iblR; // Reflction vector, same as above.
float3 iblR; // Reflection vector, same as above.
float3 specularFGD; // Store preconvole BRDF for both specular and diffuse
float diffuseFGD;

// area light
float3x3 minV;
float ltcGGXMagnitude;
float3x3 ltcXformGGX; // TODO: make sure the compiler not wasting VGPRs on constants
float3x3 ltcXformDisneyDiffuse; // TODO: make sure the compiler not wasting VGPRs on constants
float ltcGGXFresnelMagnitudeDiff; // The difference of magnitudes of GGX and Fresnel
float ltcGGXFresnelMagnitude;
float ltcDisneyDiffuseMagnitude;
// Shadow (sampling rotation disc)
float2 unPositionSS;

// Get the inverse LTC matrix for GGX
// Note we load the matrix transpose (avoid to have to transpose it in shader)
preLightData.minV = 0.0;
preLightData.minV._m22 = 1.0;
preLightData.minV._m00_m02_m11_m20 = SAMPLE_TEXTURE2D_LOD(_LtcGGXMatrix, sampler_LtcGGXMatrix, uv, 0);
preLightData.ltcXformGGX = 0.0;
preLightData.ltcXformGGX._m22 = 1.0;
preLightData.ltcXformGGX._m00_m02_m11_m20 = SAMPLE_TEXTURE2D_LOD(_LtcGGXMatrix, SRL_PointSampler, uv, 0);
preLightData.ltcGGXMagnitude = SAMPLE_TEXTURE2D_LOD(_LtcGGXMagnitude, sampler_LtcGGXMagnitude, uv, 0).w;
// Get the inverse LTC matrix for Disney Diffuse
// Note we load the matrix transpose (avoid to have to transpose it in shader)
preLightData.ltcXformDisneyDiffuse = 0.0;
preLightData.ltcXformDisneyDiffuse._m22 = 1.0;
preLightData.ltcXformDisneyDiffuse._m00_m02_m11_m20 = SAMPLE_TEXTURE2D_LOD(_LtcDisneyDiffuseMatrix, SRL_PointSampler, uv, 0);
preLightData.ltcGGXFresnelMagnitudeDiff = SAMPLE_TEXTURE2D_LOD(_LtcMultiGGXFresnelDisneyDiffuse, SRL_PointSampler, uv, 0).r;
preLightData.ltcGGXFresnelMagnitude = SAMPLE_TEXTURE2D_LOD(_LtcMultiGGXFresnelDisneyDiffuse, SRL_PointSampler, uv, 0).g;
preLightData.ltcDisneyDiffuseMagnitude = SAMPLE_TEXTURE2D_LOD(_LtcMultiGGXFresnelDisneyDiffuse, SRL_PointSampler, uv, 0).b;
// Shadow
preLightData.unPositionSS = coord.unPositionSS;

#endif
D = D_GGX(NdotH, bsdfData.roughness);
}
specularLighting = F * Vis * D;
specularLighting = F * (Vis * D);
#ifdef LIT_DIFFUSE_LAMBERT_BRDF
float diffuseTerm = Lambert();
#else

float sqrDist = dot(unL, unL);
float3 L = normalize(unL);
// Cosine of the angle between the light direction and the normal of the light's surface.
float cosLNs = dot(-L, Ns);
cosLNs = lightData.twoSided ? abs(cosLNs) : saturate(cosLNs);
float illuminance = saturate(dot(Ns, -L)) * saturate(dot(bsdfData.normalWS, L)) / (sqrDist * lightPdf);
float illuminance = cosLNs * saturate(dot(bsdfData.normalWS, L)) / (sqrDist * lightPdf);
float3 localDiffuseLighting = float3(0.0, 0.0, 0.0);
float3 localSpecularLighting = float3(0.0, 0.0, 0.0);

#ifdef LIT_DISPLAY_REFERENCE
IntegrateGGXAreaRef(V, positionWS, preLightData, lightData, bsdfData, diffuseLighting, specularLighting);
#else
float halfWidth = lightData.size.x * 0.5;
float halfWidth = lightData.size.x * 0.5;
float3 p0 = lightData.positionWS + lightData.right * -halfWidth + lightData.up * halfHeight;
float3 p0 = lightData.positionWS + lightData.right * -halfWidth + lightData.up * halfHeight;
float3 p2 = lightData.positionWS + lightData.right * halfWidth + lightData.up * -halfHeight;
float3 p3 = lightData.positionWS + lightData.right * halfWidth + lightData.up * halfHeight;
float3 p2 = lightData.positionWS + lightData.right * halfWidth + lightData.up * -halfHeight;
float3 p3 = lightData.positionWS + lightData.right * halfWidth + lightData.up * halfHeight;
float4x3 L = matL - float4x3(positionWS, positionWS, positionWS, positionWS);
float4x3 L = matL - float4x3(positionWS, positionWS, positionWS, positionWS);
// TODO: Can we get early out based on diffuse computation ? (if all point are clip)
diffuseLighting = float3(0.0, 0.0, 0.0);
diffuseLighting = float3(0.0, 0.0, 0.0);
// TODO: Fresnel is missing here but should be present
specularLighting.rgb = LTCEvaluate(V, bsdfData.normalWS, preLightData.minV, L, lightData.twoSided) * preLightData.ltcGGXMagnitude;
float ltcValue;
//#ifdef LIT_DIFFUSE_LAMBERT_BRDF
// Lambert diffuse term (here it should be Disney)
float3x3 identity = 0;
identity._m00_m11_m22 = 1.0;
diffuseLighting.rgb = LTCEvaluate(V, bsdfData.normalWS, identity, L, lightData.twoSided) * bsdfData.diffuseColor;
//#else
// TODO: Disney
//#endif
// Divide all by 2 PI as it is Lambert integration for diffuse
diffuseLighting.rgb *= lightData.color * INV_TWO_PI * lightData.diffuseScale;
specularLighting.rgb *= lightData.color * INV_TWO_PI * lightData.specularScale;
// Evaluate the diffuse part.
{
#ifdef DIFFUSE_LAMBERT_BRDF
static const float3x3 identity3x3 = {1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0};
ltcValue = LTCEvaluate(V, bsdfData.normalWS, identity3x3, L, lightData.twoSided);
#else
ltcValue = LTCEvaluate(V, bsdfData.normalWS, preLightData.ltcXformDisneyDiffuse, L, lightData.twoSided);
#endif
if (ltcValue == 0.0)
{
// The polygon is either back-facing, or has been completely clipped.
return;
}
#ifndef DIFFUSE_LAMBERT_BRDF
// TODO: verify that we do not need to multiply by PI.
ltcValue *= preLightData.ltcDisneyDiffuseMagnitude;
#endif
ltcValue *= lightData.diffuseScale;
diffuseLighting = bsdfData.diffuseColor * lightData.color * ltcValue;
}
// Evaluate the specular part.
{
float3 fresnelTerm = bsdfData.fresnel0 * preLightData.ltcGGXFresnelMagnitudeDiff
+ (float3)preLightData.ltcGGXFresnelMagnitude;
ltcValue = LTCEvaluate(V, bsdfData.normalWS, preLightData.ltcXformGGX, L, lightData.twoSided);
ltcValue *= lightData.specularScale;
specularLighting = fresnelTerm * lightData.color * ltcValue;
}
// TODO: current area light code doesn't take into account artist attenuation radius!
#endif
}

/*
#ifdef LIT_DIFFUSE_LAMBERT_BRDF
diffuseLighting.rgb = IntegrateLambertIBLRef(lightData, bsdfData);
diffuseLighting = IntegrateLambertIBLRef(lightData, bsdfData);
diffuseLighting.rgb = IntegrateDisneyDiffuseIBLRef(lightLoopContext, V, lightData, bsdfData);
diffuseLighting = IntegrateDisneyDiffuseIBLRef(lightLoopContext, V, lightData, bsdfData);
diffuseLighting.a = 1.0;
*/
diffuseLighting = float3(0.0, 0.0, 0.0);

29
Assets/ScriptableRenderLoop/ShaderLibrary/AreaLighting.hlsl


// Even though that replaced the switch with just some indexing and no branches, it became
// way, way slower - mem fetch stalls?
// clip
uint n = 0;
switch (config)
{

break;
}
if (n == 0)
return 0;
if (n == 3)
L[3] = L[0];
if (n == 4)
L4 = L[0];
if (n == 0) return 0;
L[3] = normalize(L[3]);
L4 = normalize(L4);
switch (n)
{
case 3:
L[3] = L[0];
break;
case 4:
L[3] = normalize(L[3]);
L4 = L[0];
break;
default: // 1, 2, 5
L[3] = normalize(L[3]);
L4 = normalize(L4);
break;
}
// 3. Integrate
float sum = 0;

if (n == 5)
sum += IntegrateEdge(L4, L[0]);
return twoSided > 0.0 ? abs(sum) : max(0.0, sum);
sum *= INV_TWO_PI; // Normalization of the integral of cosine over the sphere
return twoSided ? abs(sum) : max(sum, 0.0);
}
float LTCEvaluate(float3 V, float3 N, float3x3 minV, float4x3 L, bool twoSided)

688
Assets/TestScenes/HDTest/HDRenderLoopTest.unity


m_Father: {fileID: 2091750487}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &146321727
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 146321728}
- component: {fileID: 146321731}
- component: {fileID: 146321730}
- component: {fileID: 146321729}
m_Layer: 0
m_Name: Quad (4)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &146321728
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 146321727}
m_LocalRotation: {x: 0, y: -0.17364825, z: 0, w: 0.9848078}
m_LocalPosition: {x: -2.5, y: 0, z: 6}
m_LocalScale: {x: 2, y: 10.000004, z: 1.0000005}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: -20, z: 0}
--- !u!23 &146321729
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 146321727}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 2e59d95585e72d64ba03c9a2d2d400e4, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &146321730
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 146321727}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &146321731
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 146321727}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &159538337
Prefab:
m_ObjectHideFlags: 0

m_Father: {fileID: 505986554}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &291640076
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 291640077}
- component: {fileID: 291640080}
- component: {fileID: 291640079}
- component: {fileID: 291640078}
m_Layer: 0
m_Name: Quad (5)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &291640077
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 291640076}
m_LocalRotation: {x: 0, y: -0.21643952, z: 0, w: 0.97629607}
m_LocalPosition: {x: -5, y: 0, z: 4.9}
m_LocalScale: {x: 2, y: 10.000004, z: 1.0000005}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: -25, z: 0}
--- !u!23 &291640078
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 291640076}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 65143432471e8af4db8443b42a8f1b3c, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &291640079
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 291640076}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &291640080
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 291640076}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &294303871
GameObject:
m_ObjectHideFlags: 0

shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1
treatAsAreaLight: 0
isDoubleSided: 0
areaLightLength: 0
areaLightWidth: 0
--- !u!108 &580932149
Light:
m_ObjectHideFlags: 0

shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1
treatAsAreaLight: 0
isDoubleSided: 0
areaLightLength: 0
areaLightWidth: 0
--- !u!1001 &744696321
Prefab:
m_ObjectHideFlags: 0

m_RemovedComponents: []
m_ParentPrefab: {fileID: 100100000, guid: e641a36bceddbf24a89656e94dafb3e5, type: 2}
m_IsPrefabParent: 0
--- !u!1 &745410966
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 745410967}
- component: {fileID: 745410970}
- component: {fileID: 745410969}
- component: {fileID: 745410968}
m_Layer: 0
m_Name: Quad (3)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &745410967
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745410966}
m_LocalRotation: {x: 0, y: -0.13052624, z: 0, w: 0.9914449}
m_LocalPosition: {x: 0, y: 0, z: 6.9}
m_LocalScale: {x: 2, y: 10.000004, z: 1.0000005}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: -15, z: 0}
--- !u!23 &745410968
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745410966}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 1a5c63b3aa502e6419f403dd3f0f0410, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &745410969
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745410966}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &745410970
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 745410966}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &747895456
GameObject:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 818701168}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &827169273
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 827169276}
- component: {fileID: 827169275}
- component: {fileID: 827169274}
m_Layer: 0
m_Name: Test - LTC Area Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &827169274
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 827169273}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 7a68c43fe1f2a47cfa234b5eeaa98012, type: 3}
m_Name:
m_EditorClassIdentifier:
shadowResolution: 512
innerSpotPercent: 0
shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1
treatAsAreaLight: 1
isDoubleSided: 1
areaLightLength: 16
areaLightWidth: 2
--- !u!108 &827169275
Light:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 827169273}
m_Enabled: 1
serializedVersion: 7
m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Lightmapping: 4
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &827169276
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 827169273}
m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068}
m_LocalPosition: {x: -100, y: 8, z: 15}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 925222274}
- {fileID: 1035351686}
- {fileID: 1883914491}
- {fileID: 1907476404}
- {fileID: 745410967}
- {fileID: 146321728}
- {fileID: 291640077}
m_Father: {fileID: 0}
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &851265586
GameObject:
m_ObjectHideFlags: 0

m_Father: {fileID: 1363055975}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &925222273
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 925222274}
- component: {fileID: 925222277}
- component: {fileID: 925222276}
- component: {fileID: 925222275}
m_Layer: 0
m_Name: LightQuad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &925222274
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 925222273}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 16, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &925222275
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 925222273}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 492d83e00e5c35841bcdbcea025f2c50, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &925222276
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 925222273}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &925222277
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 925222273}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &928571527
GameObject:
m_ObjectHideFlags: 0

shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1
treatAsAreaLight: 0
isDoubleSided: 0
areaLightLength: 0
areaLightWidth: 0
--- !u!108 &970745599
Light:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1016495509}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1035351685
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1035351686}
- component: {fileID: 1035351689}
- component: {fileID: 1035351688}
- component: {fileID: 1035351687}
m_Layer: 0
m_Name: Quad
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1035351686
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1035351685}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.5, y: 0, z: 8}
m_LocalScale: {x: 2, y: 10, z: 1}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!23 &1035351687
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1035351685}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 7af9798eeefeae34c83aca56762a2938, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &1035351688
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1035351685}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &1035351689
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1035351685}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1035518232
GameObject:
m_ObjectHideFlags: 0

shadowDimmer: 1
affectDiffuse: 1
affectSpecular: 1
treatAsAreaLight: 0
isDoubleSided: 0
areaLightLength: 0
areaLightWidth: 0
--- !u!1 &1883914490
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1883914491}
- component: {fileID: 1883914494}
- component: {fileID: 1883914493}
- component: {fileID: 1883914492}
m_Layer: 0
m_Name: Quad (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1883914491
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1883914490}
m_LocalRotation: {x: 0, y: -0.043619405, z: 0, w: 0.9990483}
m_LocalPosition: {x: 5, y: 0, z: 7.9}
m_LocalScale: {x: 2, y: 10.000004, z: 1.0000005}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: -5, z: 0}
--- !u!23 &1883914492
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1883914490}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: 444534c618931b84ab4770dc517021df, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &1883914493
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1883914490}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &1883914494
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1883914490}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &1889215922
Prefab:
m_ObjectHideFlags: 0

m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1899786477}
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1907476403
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1907476404}
- component: {fileID: 1907476407}
- component: {fileID: 1907476406}
- component: {fileID: 1907476405}
m_Layer: 0
m_Name: Quad (2)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1907476404
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1907476403}
m_LocalRotation: {x: 0, y: -0.08715578, z: 0, w: 0.9961947}
m_LocalPosition: {x: 2.5, y: 0, z: 7.5}
m_LocalScale: {x: 2, y: 10.000004, z: 1.0000005}
m_Children: []
m_Father: {fileID: 827169276}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: -10, z: 0}
--- !u!23 &1907476405
MeshRenderer:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1907476403}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_Materials:
- {fileID: 2100000, guid: dcad493d968f31e4ba561145c394919b, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 1
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingOrder: 0
--- !u!64 &1907476406
MeshCollider:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1907476403}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Convex: 0
m_InflateMesh: 0
m_SkinWidth: 0.01
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!33 &1907476407
MeshFilter:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1907476403}
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1922465729
GameObject:
m_ObjectHideFlags: 0

9
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders.meta


fileFormatVersion: 2
guid: fafbb144d7f66074785b7727293d89c5
folderAsset: yes
timeCreated: 1474297943
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

92
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/unlitTwoSided.mat


%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: unlitTwoSided
m_Shader: {fileID: 4800000, guid: c4edd00ff2db5b24391a4fcb1762e459, type: 3}
m_ShaderKeywords: _ALPHACUTOFFENABLE_OFF _DISTORTIONDEPTHTEST_OFF _DISTORTIONONLY_OFF
_EMISSION
m_LightmapFlags: 1
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissiveColorMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- _AlphaCutoff: 0.5
- _AlphaCutoffEnable: 0
- _BlendMode: 0
- _BumpScale: 1
- _CullMode: 0
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DistortionDepthTest: 0
- _DistortionOnly: 0
- _DoubleSidedMode: 1
- _DstBlend: 0
- _EmissiveIntensity: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SurfaceType: 0
- _UVSec: 0
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _EmissiveColor: {r: 0, g: 0, b: 0, a: 1}

8
Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/unlitTwoSided.mat.meta


fileFormatVersion: 2
guid: 492d83e00e5c35841bcdbcea025f2c50
timeCreated: 1476887873
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

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


fileFormatVersion: 2
guid: b7bc5becc2cf7f14292d68bcd5fdeba6
folderAsset: yes
timeCreated: 1474297943
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:

1001
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.DisneyDiffuse.cs
文件差异内容过多而无法显示
查看文件

12
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.DisneyDiffuse.cs.meta


fileFormatVersion: 2
guid: d458ebf3b1774b542b7cd3ac02527b48
timeCreated: 1478884575
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.GGX.cs
文件差异内容过多而无法显示
查看文件

12
Assets/ScriptableRenderLoop/HDRenderLoop/Shaders/Material/Lit/LtcData.GGX.cs.meta


fileFormatVersion: 2
guid: ab75e3aa960574647b057773bc16ca05
timeCreated: 1478884575
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存