You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the code below I was expecting folding #if 1 to fold the entire thing or for #else to fold the second half but what it does it folds the part of the code until next #if statement. It's a real pain to work with.
Code_-_Insiders_w9FPANr0ph.mp4
#if1// shadow sample distribution// Non-linear shadow sample distribution, hardcoded to x^2float PreviousNormT = 0.0f;
for (float ShadowT = InvShadowStepCount; ShadowT <= 1.00001f; ShadowT += InvShadowStepCount)
{
DebugGroundShadowMaterialSampleCount++;
float CurrentNormT = ShadowT * ShadowT; // CurrentNormT is the end of the considered segment to integrate, PreviousNormT is its beginning.constfloat DetlaNormT = CurrentNormT - PreviousNormT;
constfloat ShadowSampleDistance = ShadowLengthTest * (CurrentNormT - 0.5 * DetlaNormT);
UpdateMaterialCloudParam(MaterialParameters, LWCAdd(SampleWorldPosition, LWCPromote(float3(0.0f, 0.0f, -1.0f) * ShadowSampleDistance)),
ResolvedView, CloudLayerParams, ShadowSampleDistance);
PreviousNormT = CurrentNormT;
#if MATERIAL_VOLUMETRIC_ADVANCED_CONSERVATIVE_DENSITY
if (MaterialParameters.VolumeSampleConservativeDensity.x <= 0.0f)
{
continue; // Conservative density is 0 so skip and go to the next sample
}
#endifCalcPixelMaterialInputs(MaterialParameters, PixelMaterialInputs);
OpticalDepth += SampleExtinctionCoefficients(PixelMaterialInputs) * ShadowLengthTest * CENTIMETER_TO_METER * DetlaNormT;
}
#else// shadow sample distribution// Linear shadow sample distribution.constfloat ShadowDtMeter = ShadowLengthTest * CENTIMETER_TO_METER / ShadowStepCount;
constfloat ShadowJitteringSeed = float(ResolvedView.StateFrameIndexMod8) + PseudoRandom(SvPosition.xy) + i * 17;
constfloat ShadowJitterNorm = InterleavedGradientNoise(SvPosition.xy, ShadowJitteringSeed) - 0.5f;
for (float ShadowT = 0.5; ShadowT < ShadowStepCount; ShadowT += 1.0f)
{
constfloat ShadowSampleDistance = ShadowLengthTest * (ShadowT * InvShadowStepCount);
UpdateMaterialCloudParam(MaterialParameters, LWCAdd(SampleWorldPosition, LWCPromote(float3(0.0f, 0.0f, -1.0f) * ShadowSampleDistance)),
ResolvedView, CloudLayerParams, ShadowSampleDistance);
#if MATERIAL_VOLUMETRIC_ADVANCED_CONSERVATIVE_DENSITY
if (MaterialParameters.VolumeSampleConservativeDensity.x <= 0.0f)
{
continue; // Conservative density is 0 so skip and go to the next sample
}
#endif// MATERIAL_VOLUMETRIC_ADVANCED_CONSERVATIVE_DENSITYCalcPixelMaterialInputs(MaterialParameters, PixelMaterialInputs);
OpticalDepth += SampleExtinctionCoefficients(PixelMaterialInputs) * ShadowDtMeter;
}
#endif// shadow sample distribution
The text was updated successfully, but these errors were encountered:
For the code below I was expecting folding
#if 1
to fold the entire thing or for#else
to fold the second half but what it does it folds the part of the code until next#if
statement. It's a real pain to work with.Code_-_Insiders_w9FPANr0ph.mp4
The text was updated successfully, but these errors were encountered: