浏览代码

Rename RoughnessToAnisotropy to ConvertRoughnessToAnisotropy

/main
sebastienlagarde 7 年前
当前提交
96365a48
共有 3 个文件被更改,包括 5 次插入20 次删除
  1. 9
      ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs
  3. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl

9
ScriptableRenderPipeline/Core/CoreRP/ShaderLibrary/CommonMaterial.hlsl


roughnessB = roughness * (1 - anisotropy);
}
real RoughnessToAnisotropy(real roughnessT, real roughnessB)
void ConvertRoughnessToAnisotropy(real roughnessT, real roughnessB, out real anisotropy)
{
return ((roughnessT - roughnessB) / (roughnessT + roughnessB + 0.0001));
}

roughnessT = ClampRoughnessForAnalyticalLights(roughnessT);
roughnessB = ClampRoughnessForAnalyticalLights(roughnessB);
}
// Same as ConvertAnisotropyToClampRoughness, but without anisotropy.
void ConvertPerceptualRoughnessToClampRoughness(real perceptualRoughness, out real roughness)
{
roughness = PerceptualRoughnessToRoughness(perceptualRoughness);
roughness = ClampRoughnessForAnalyticalLights(roughness);
}
// Use with stack BRDF (clear coat / coat)

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/HDRenderPipeline.cs


// HD use specific GraphicsSettings
GraphicsSettings.lightsUseLinearIntensity = true;
GraphicsSettings.lightsUseColorTemperature = true;
// HD should always use the new batcher
//GraphicsSettings.useScriptableRenderPipelineBatching = true;
SupportedRenderingFeatures.active = new SupportedRenderingFeatures()
{

14
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/StackLit/StackLit.hlsl


return (HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_STACK_LIT_COAT));
}
float3 ComputeDiffuseColor(float3 baseColor, float metallic)
{
return baseColor * (1.0 - metallic);
}
float3 ComputeFresnel0(float3 baseColor, float metallic, float dielectricF0)
{
return lerp(dielectricF0.xxx, baseColor, metallic);
}
// Assume bsdfData.normalWS is init
void FillMaterialAnisotropy(float anisotropy, float3 tangentWS, float3 bitangentWS, inout BSDFData bsdfData)
{

_s_r0m = s_ti0 + j0i*(s_t0i + s_r12 + m_rr*(s_r12+s_ri0));
float roughnessB = LinearVarianceToRoughness(_s_r0m);
//preLightData.iblAnisotropy[0] = RoughnessToAnisotropy(roughnessT, roughnessB);
//ConvertRoughnessToAnisotropy(roughnessT, roughnessB, preLightData.iblAnisotropy[0]);
// TODOANISOTROPY
preLightData.iblAnisotropy[0] = bsdfData.anisotropy;
preLightData.iblPerceptualRoughness[BASE_LOBEA_IDX] = RoughnessToPerceptualRoughness((roughnessT + roughnessB)/2.0);

_s_r0m = s_ti0 + j0i*(s_t0i + s_r12 + m_rr*(s_r12+s_ri0));
roughnessB = LinearVarianceToRoughness(_s_r0m);
//preLightData.iblAnisotropy[1] = RoughnessToAnisotropy(roughnessT, roughnessB);
// ConvertRoughnessToAnisotropy(roughnessT, roughnessB, preLightData.iblAnisotropy[1]);
// TODOANISOTROPY
preLightData.iblAnisotropy[1] = bsdfData.anisotropy;
preLightData.iblPerceptualRoughness[BASE_LOBEB_IDX] = RoughnessToPerceptualRoughness((roughnessT + roughnessB)/2.0);

正在加载...
取消
保存