浏览代码

Remove modification on convertSurfaceDataToBSDFData and EncodeToGBuffer

/main
Sebastien Lagarde 7 年前
当前提交
dae7599d
共有 13 个文件被更改,包括 56 次插入49 次删除
  1. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugViewMaterialGBuffer.shader
  2. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Deferred.shader
  3. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/Deferred.compute
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/LayeredLit/LayeredLitData.hlsl
  5. 64
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
  6. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl
  7. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitData.hlsl
  8. 14
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Material.hlsl
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.hlsl
  10. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl
  11. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForwardUnlit.hlsl
  12. 4
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassGBuffer.hlsl
  13. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassLightTransport.hlsl

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Debug/DebugViewMaterialGBuffer.shader


// input.positionCS is SV_Position
float depth = LOAD_TEXTURE2D(_MainDepthTexture, input.positionCS.xy).x;
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw, depth, UNITY_MATRIX_I_VP, UNITY_MATRIX_VP);
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS);
DECODE_FROM_GBUFFER(V, posInput.positionSS, UINT_MAX, bsdfData, bakeLightingData.bakeDiffuseLighting);
DECODE_FROM_GBUFFER(posInput.positionSS, UINT_MAX, bsdfData, bakeLightingData.bakeDiffuseLighting);
#ifdef SHADOWS_SHADOWMASK
DecodeShadowMask(LOAD_TEXTURE2D(_ShadowMaskTexture, posInput.positionSS), bakeLightingData.bakeShadowMask);
#endif

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Deferred.shader


BSDFData bsdfData;
BakeLightingData bakeLightingData;
DECODE_FROM_GBUFFER(V, posInput.positionSS, UINT_MAX, bsdfData, bakeLightingData.bakeDiffuseLighting);
DECODE_FROM_GBUFFER(posInput.positionSS, UINT_MAX, bsdfData, bakeLightingData.bakeDiffuseLighting);
#ifdef SHADOWS_SHADOWMASK
DecodeShadowMask(LOAD_TEXTURE2D(_ShadowMaskTexture, posInput.positionSS), bakeLightingData.bakeShadowMask);
#endif

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/Deferred.compute


BSDFData bsdfData;
BakeLightingData bakeLightingData;
DECODE_FROM_GBUFFER(V, posInput.positionSS, featureFlags, bsdfData, bakeLightingData.bakeDiffuseLighting);
DECODE_FROM_GBUFFER(posInput.positionSS, featureFlags, bsdfData, bakeLightingData.bakeDiffuseLighting);
#ifdef SHADOWS_SHADOWMASK
DecodeShadowMask(LOAD_TEXTURE2D(_ShadowMaskTexture, posInput.positionSS), bakeLightingData.bakeShadowMask);
#endif

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


}
#endif
GetBuiltinData(input, surfaceData, V, posInput, alpha, bentNormalWS, depthOffset, builtinData);
GetBuiltinData(input, surfaceData, alpha, bentNormalWS, depthOffset, builtinData);
}
#include "../Lit/LitDataMeshModification.hlsl"

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


// Evaluate the reflectance for a thin-film layer on top of a dielectric medum.
float3 EvalIridescence(float eta_1, float cosTheta1, BSDFData bsdfData)
{
eta_1 = 1.0; // air is 1.0 but for clear coat should be 1.5
// thicknessIridescence unit is micrometer for this equation here. Mean 0.5 is 500nm.
float Dinc = 2.0 * bsdfData.iorIridescence * bsdfData.thicknessIridescence;
// Force eta_2 -> eta_1 when Dinc -> 0.0

// Compound terms
float3 R123 = R12 * R23;
float3 r123 = sqrt(R123);
float3 Rs = Sq(T121) * R23 / (float3(1.0, 1.0, 1.0) - R123);
float3 Rs = Sq(T121) * R23 / (float3(1.0, 1.0, 1.0) - R123);
// Reflectance term for m = 0 (DC term amplitude)
float3 C0 = R12 + Rs;

}
// Convert back to RGB reflectance
//I = clamp(mul(I, XYZ_TO_RGB), float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0));
//I = clamp(mul(I, XYZ_TO_RGB), float3(0.0, 0.0, 0.0), float3(1.0, 1.0, 1.0));
//I = mul(XYZ_TO_RGB, I);
return I;

bsdfData.bitangentWS = bitangentWS;
}
void FillMaterialIridescence(float3 V, float coatMask, float ior, float thickness, inout BSDFData bsdfData)
void FillMaterialIridescence(float ior, float thickness, inout BSDFData bsdfData)
float topIor = lerp(1.0, CLEAR_COAT_IOR, coatMask);
// HACK: Use the reflected direction to specify the Fresnel coefficient for pre-convolved envmaps
// TODO: Take into account roughness for peak ?
// TODO: take into account clear coat...
float NdotV = sqrt(1.0 + Sq(1.0 / ior) * (Sq(dot(bsdfData.normalWS, V)) - 1.0));
bsdfData.fresnel0 = EvalIridescence(topIor, NdotV, bsdfData);
}
// Note: this modify the parameter perceptualRoughness and fresnel0, so they need to be setup

float coatRoughnessScale = Sq(ieta);
float sigma = RoughnessToVariance(PerceptualRoughnessToRoughness(bsdfData.perceptualRoughness));
bsdfData.perceptualRoughness = RoughnessToPerceptualRoughness(VarianceToRoughness(sigma * coatRoughnessScale));
// Fresnel0 is deduced from interface between air and material (Assume to be 1.5 in Unity, or a metal).
// but here we go from clear coat (1.5) to material, we need to update fresnel0
// Note: Schlick is a poor approximation of Fresnel when ieta is 1 (1.5 / 1.5), schlick target 1.4 to 2.2 IOR.
bsdfData.fresnel0 = lerp(bsdfData.fresnel0, ConvertF0ForAirInterfaceToF0ForClearCoat15(bsdfData.fresnel0), coatMask);
}
void FillMaterialTransparencyData(float3 baseColor, float metallic, float ior, float3 transmittanceColor, float atDistance, float thickness, float transmittanceMask, inout BSDFData bsdfData)

// conversion function for forward
//-----------------------------------------------------------------------------
BSDFData ConvertSurfaceDataToBSDFData(float3 V, uint2 positionSS, SurfaceData surfaceData)
BSDFData ConvertSurfaceDataToBSDFData(SurfaceData surfaceData)
{
BSDFData bsdfData;
ZERO_INITIALIZE(BSDFData, bsdfData);

if (HasFeatureFlag(surfaceData.materialFeatures, MATERIALFEATUREFLAGS_LIT_IRIDESCENCE))
{
// Modify fresnel0
FillMaterialIridescence(V, surfaceData.coatMask, surfaceData.iorIridescence, surfaceData.thicknessIridescence, bsdfData);
FillMaterialIridescence(surfaceData.iorIridescence, surfaceData.thicknessIridescence, bsdfData);
// Modify fresnel0 and perceptualRoughness
// Modify perceptualRoughness
FillMaterialClearCoatData(surfaceData.coatMask, bsdfData);
}

// Encode SurfaceData (BSDF parameters) into GBuffer
// Must be in sync with RT declared in HDRenderPipeline.cs ::Rebuild
void EncodeIntoGBuffer( float3 V, uint2 positionSS, SurfaceData surfaceData,
void EncodeIntoGBuffer( SurfaceData surfaceData,
uint2 positionSS,
out GBufferType0 outGBuffer0,
out GBufferType1 outGBuffer1,
out GBufferType2 outGBuffer2,

// If you're not using the feature classification system, pass UINT_MAX.
// Also, see comment in TileVariantToFeatureFlags. When we are the worse case (i.e last variant), we read the featureflags
// from the structured buffer use to generate the indirect draw call. It allow to not go through all branch and the branch is scalar (not VGPR)
uint DecodeFromGBuffer(float3 V, uint2 positionSS, uint tileFeatureFlags, out BSDFData bsdfData, out float3 bakeDiffuseLighting)
uint DecodeFromGBuffer(uint2 positionSS, uint tileFeatureFlags, out BSDFData bsdfData, out float3 bakeDiffuseLighting)
{
// Note: we have ZERO_INITIALIZE the struct, so bsdfData.diffusionProfile == DIFFUSION_PROFILE_NEUTRAL_ID,
// bsdfData.anisotropy == 0, bsdfData.subsurfaceMask == 0, etc...

if (HasFeatureFlag(pixelFeatureFlags, MATERIALFEATUREFLAGS_LIT_IRIDESCENCE))
{
// Range of IOR is 1..2.5
// Modify fresnel0
FillMaterialIridescence(V, coatMask, RemapIor01to25(inGBuffer2.r), inGBuffer2.g, bsdfData);
FillMaterialIridescence(RemapIor01to25(inGBuffer2.r), inGBuffer2.g, bsdfData);
// Modify fresnel0 and perceptualRoughness
// Modify perceptualRoughness
FillMaterialClearCoatData(coatMask, bsdfData);
}

float3 unused;
// Call the regular function, compiler will optimized out everything not used.
// Note that all material feature flag bellow are in the same GBuffer (inGBuffer2) and thus material classification only sample one Gbuffer
return DecodeFromGBuffer(float3(0.0, 0.0, 1.0), positionSS, UINT_MAX, bsdfData, unused);
return DecodeFromGBuffer(positionSS, UINT_MAX, bsdfData, unused);
}
//-----------------------------------------------------------------------------

float transparentSSMipLevel; // mip level of the screen space gaussian pyramid for rough refraction
};
PreLightData GetPreLightData(float3 V, PositionInputs posInput, BSDFData bsdfData)
PreLightData GetPreLightData(float3 V, PositionInputs posInput, inout BSDFData bsdfData)
{
PreLightData preLightData;
ZERO_INITIALIZE(PreLightData, preLightData);

float NdotV = ClampNdotV(preLightData.NdotV);
if (HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_IRIDESCENCE))
{
float viewAngle = NdotV;
float topIor = 1.0; // Default is air
if (HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_CLEAR_COAT))
{
topIor = lerp(1.0, CLEAR_COAT_IOR, bsdfData.coatMask);
// HACK: Use the reflected direction to specify the Fresnel coefficient for pre-convolved envmaps
viewAngle = sqrt(1.0 + Sq(1.0 / topIor) * (Sq(dot(bsdfData.normalWS, V)) - 1.0));
}
// TEMP
if (bsdfData.thicknessIridescence != 0.0)
{
bsdfData.fresnel0 = EvalIridescence(topIor, viewAngle, bsdfData);
}
}
// Fresnel0 is deduced from interface between air and material (Assume to be 1.5 in Unity, or a metal).
// but here we go from clear coat (1.5) to material, we need to update fresnel0
// Note: Schlick is a poor approximation of Fresnel when ieta is 1 (1.5 / 1.5), schlick target 1.4 to 2.2 IOR.
bsdfData.fresnel0 = lerp(bsdfData.fresnel0, ConvertF0ForAirInterfaceToF0ForClearCoat15(bsdfData.fresnel0), bsdfData.coatMask);
preLightData.coatPartLambdaV = GetSmithJointGGXPartLambdaV(NdotV, CLEAR_COAT_ROUGHNESS);
preLightData.coatIblR = reflect(-V, N);
preLightData.coatIblF = F_Schlick(CLEAR_COAT_F0, NdotV) * bsdfData.coatMask;

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitBuiltinData.hlsl


void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float3 V, PositionInputs posInput, float alpha, float3 bentNormalWS, float depthOffset, out BuiltinData builtinData)
void GetBuiltinData(FragInputs input, SurfaceData surfaceData, float alpha, float3 bentNormalWS, float depthOffset, out BuiltinData builtinData)
{
// Builtin Data
builtinData.opacity = alpha;

// It is safe to call this function here as surfaceData have been filled
// We want to know if we must enable transmission on GI for SSS material, if the material have no SSS, this code will be remove by the compiler.
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(V, posInput.positionSS, surfaceData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
if (HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_TRANSMISSION))
{
// For now simply recall the function with inverted normal, the compiler should be able to optimize the lightmap case to not resample the directional lightmap

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/LitData.hlsl


#endif
// Caution: surfaceData must be fully initialize before calling GetBuiltinData
GetBuiltinData(input, surfaceData, V, posInput, alpha, bentNormalWS, depthOffset, builtinData);
GetBuiltinData(input, surfaceData, alpha, bentNormalWS, depthOffset, builtinData);
}
#include "LitDataMeshModification.hlsl"

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


#include "Lit/Lit.hlsl"
#elif defined(UNITY_MATERIAL_UNLIT)
#include "Unlit/Unlit.hlsl"
#elif defined(UNITY_MATERIAL_IRIDESCENCE)
//#include "Iridescence/Iridescence.hlsl"
#endif
//-----------------------------------------------------------------------------

out GBufferType0 MERGE_NAME(NAME, 0) : SV_Target0, \
out GBufferType1 MERGE_NAME(NAME, 1) : SV_Target1
#define ENCODE_INTO_GBUFFER(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, NAME) EncodeIntoGBuffer(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1))
#define ENCODE_INTO_GBUFFER(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1))
#ifdef SHADOWS_SHADOWMASK
#define OUTPUT_GBUFFER_SHADOWMASK(NAME) ,out float4 NAME : SV_Target2

out GBufferType1 MERGE_NAME(NAME, 1) : SV_Target1, \
out GBufferType2 MERGE_NAME(NAME, 2) : SV_Target2
#define ENCODE_INTO_GBUFFER(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, NAME) EncodeIntoGBuffer(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2))
#define ENCODE_INTO_GBUFFER(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, MERGE_NAME(NAME,0), MERGE_NAME(NAME,1), MERGE_NAME(NAME,2))
#ifdef SHADOWS_SHADOWMASK
#define OUTPUT_GBUFFER_SHADOWMASK(NAME) ,out float4 NAME : SV_Target3

out GBufferType2 MERGE_NAME(NAME, 2) : SV_Target2, \
out GBufferType3 MERGE_NAME(NAME, 3) : SV_Target3
#define ENCODE_INTO_GBUFFER(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, NAME) EncodeIntoGBuffer(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3))
#define ENCODE_INTO_GBUFFER(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3))
#ifdef SHADOWS_SHADOWMASK
#define OUTPUT_GBUFFER_SHADOWMASK(NAME) ,out float4 NAME : SV_Target4

out GBufferType3 MERGE_NAME(NAME, 3) : SV_Target3, \
out GBufferType4 MERGE_NAME(NAME, 4) : SV_Target4
#define ENCODE_INTO_GBUFFER(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, NAME) EncodeIntoGBuffer(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3), MERGE_NAME(NAME, 4))
#define ENCODE_INTO_GBUFFER(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3), MERGE_NAME(NAME, 4))
#ifdef SHADOWS_SHADOWMASK
#define OUTPUT_GBUFFER_SHADOWMASK(NAME) ,out float4 NAME : SV_Target5

out GBufferType4 MERGE_NAME(NAME, 4) : SV_Target4, \
out GBufferType5 MERGE_NAME(NAME, 5) : SV_Target5
#define ENCODE_INTO_GBUFFER(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(V, UNPOSITIONSS, SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3), MERGE_NAME(NAME, 4), MERGE_NAME(NAME, 5))
#define ENCODE_INTO_GBUFFER(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, NAME) EncodeIntoGBuffer(SURFACE_DATA, BAKE_DIFFUSE_LIGHTING, UNPOSITIONSS, MERGE_NAME(NAME, 0), MERGE_NAME(NAME, 1), MERGE_NAME(NAME, 2), MERGE_NAME(NAME, 3), MERGE_NAME(NAME, 4), MERGE_NAME(NAME, 5))
#ifdef SHADOWS_SHADOWMASK
#define OUTPUT_GBUFFER_SHADOWMASK(NAME) ,out float4 NAME : SV_Target6

#define DECODE_FROM_GBUFFER(V, UNPOSITIONSS, FEATURE_FLAGS, BSDF_DATA, BAKE_DIFFUSE_LIGHTING) DecodeFromGBuffer(V, UNPOSITIONSS, FEATURE_FLAGS, BSDF_DATA, BAKE_DIFFUSE_LIGHTING)
#define DECODE_FROM_GBUFFER(UNPOSITIONSS, FEATURE_FLAGS, BSDF_DATA, BAKE_DIFFUSE_LIGHTING) DecodeFromGBuffer(UNPOSITIONSS, FEATURE_FLAGS, BSDF_DATA, BAKE_DIFFUSE_LIGHTING)
#define MATERIAL_FEATURE_FLAGS_FROM_GBUFFER(UNPOSITIONSS) MaterialFeatureFlagsFromGBuffer(UNPOSITIONSS)
#ifdef SHADOWS_SHADOWMASK

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Unlit/Unlit.hlsl


// conversion function for forward
//-----------------------------------------------------------------------------
BSDFData ConvertSurfaceDataToBSDFData(float3 V, uint2 positionSS, SurfaceData data)
BSDFData ConvertSurfaceDataToBSDFData(SurfaceData data)
{
BSDFData output;
output.color = data.color;

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl


ApplyDebugToSurfaceData(input.worldToTangent, surfaceData);
#endif
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(V, posInput.positionSS, surfaceData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData);

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForwardUnlit.hlsl


GetSurfaceAndBuiltinData(input, V, posInput, surfaceData, builtinData);
// Not lit here (but emissive is allowed)
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(V, posInput.positionSS, surfaceData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
// TODO: we must not access bsdfData here, it break the genericity of the code!
float4 outColor = ApplyBlendMode(bsdfData.color + builtinData.emissiveColor, builtinData.opacity);

4
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassGBuffer.hlsl


ApplyDebugToSurfaceData(input.worldToTangent, surfaceData);
#endif
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(V, posInput.positionSS, surfaceData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
ENCODE_INTO_GBUFFER(V, posInput.positionSS, surfaceData, bakeDiffuseLighting, outGBuffer);
ENCODE_INTO_GBUFFER(surfaceData, bakeDiffuseLighting, posInput.positionSS, outGBuffer);
ENCODE_SHADOWMASK_INTO_GBUFFER(float4(builtinData.shadowMask0, builtinData.shadowMask1, builtinData.shadowMask2, builtinData.shadowMask3), outShadowMaskBuffer);
#ifdef _DEPTHOFFSET_ON

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassLightTransport.hlsl


// no debug apply during light transport pass
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(V, posInput.positionSS, surfaceData);
BSDFData bsdfData = ConvertSurfaceDataToBSDFData(surfaceData);
LightTransportData lightTransportData = GetLightTransportData(surfaceData, builtinData, bsdfData);
// This shader is call two times. Once for getting emissiveColor, the other time to get diffuseColor

正在加载...
取消
保存