浏览代码

Use the isotropic phase function as an optimization

/main
Evgenii Golubev 7 年前
当前提交
f9a33825
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 12
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute

12
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Volumetrics/Resources/VolumetricLighting.compute


#define SHADERPASS SHADERPASS_VOLUMETRIC_LIGHTING
#define GROUP_SIZE_1D 16
#define GROUP_SIZE_2D (GROUP_SIZE_1D * GROUP_SIZE_1D)
// #define USE_HENYEY_GREENSTEIN_PHASE_FUNCTION
//--------------------------------------------------------------------------------------------------
// Included headers

{
float3 scattering = _GlobalFog_Scattering;
float extinction = _GlobalFog_Extinction;
#ifdef USE_HENYEY_GREENSTEIN_PHASE_FUNCTION
#endif
LightLoopContext context;
// ZERO_INITIALIZE(LightLoopContext, context);

float intensity = 1;
float3 color = lightData.color;
#ifdef USE_HENYEY_GREENSTEIN_PHASE_FUNCTION
#endif
[branch] if (lightData.shadowIndex >= 0)
{

float intensity = GetPunctualShapeAttenuation(lightData, L, distSq);
float3 color = lightData.color;
#ifdef USE_HENYEY_GREENSTEIN_PHASE_FUNCTION
#endif
intensity *= Transmittance(OpticalDepthHomogeneous(extinction, dist));
[branch] if (lightData.shadowIndex >= 0)

radiance += sampleRadiance * (Transmittance(OpticalDepthHomogeneous(extinction, t)) * dt);
}
#ifdef USE_HENYEY_GREENSTEIN_PHASE_FUNCTION
#else
float3 phaseConstant = scattering * IsotropicPhaseFunction();
#endif
return radiance * phaseConstant;
}

正在加载...
取消
保存