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
We should create a new colour_hdri.tonemapping_operator_piecewise_power_curves global tonemapping operator in the colour.tonemapping.global_operators.operators module.
It would be great to update the Jupyter Notebook example if possible.
The implementation should be straightforward given the code from John Habble:
voidFilmicToneCurve::CalcDirectParamsFromUser(CurveParamsDirect&dstParams, constCurveParamsUser&srcParams)
{
dstParams=CurveParamsDirect();
floattoeStrength=srcParams.m_toeStrength;
floattoeLength=srcParams.m_toeLength;
floatshoulderStrength=srcParams.m_shoulderStrength;
floatshoulderLength=srcParams.m_shoulderLength;
floatshoulderAngle=srcParams.m_shoulderAngle;
floatgamma=srcParams.m_gamma;
// This is not actually the display gamma. It's just a UI space to avoid having to // enter small numbers for the input.floatperceptualGamma=2.2f;
// constraints
{
toeLength=Saturate(toeLength);
toeStrength=Saturate(toeStrength);
shoulderAngle=Saturate(shoulderAngle);
shoulderLength=Saturate(shoulderLength);
shoulderStrength=MaxFloat(0.0f,shoulderStrength);
}
// apply base params
{
// toe goes from 0 to 0.5floatx0=toeLength*.5f;
floaty0= (1.0f-toeStrength) *x0; // lerp from 0 to x0floatremainingY=1.0f-y0;
floatinitialW=x0+remainingY;
floaty1_offset= (1.0f-shoulderLength) *remainingY;
floatx1=x0+y1_offset;
floaty1=y0+y1_offset;
// filmic shoulder strength is in F stopsfloatextraW=exp2f(shoulderStrength)-1.0f;
floatW=initialW+extraW;
// to adjust the perceptual gamma space, apply powerdstParams.m_x0=powf(x0,perceptualGamma);
dstParams.m_y0=powf(y0,perceptualGamma);
dstParams.m_x1=powf(x1,perceptualGamma);
dstParams.m_y1=powf(y1,perceptualGamma);
dstParams.m_W=W;
// bake the linear to gamma space conversiondstParams.m_gamma=gamma;
}
dstParams.m_overshootX= (dstParams.m_W*2.0f) *shoulderAngle*shoulderStrength;
dstParams.m_overshootY=0.5f*shoulderAngle*shoulderStrength;
}
KelSolaar
changed the title
Implement support for "Piecewise Power Curves" tonemapping operator.
Implement support for "Piece-wise Power Curves" tonemapping operator.
Jun 2, 2020
References
The text was updated successfully, but these errors were encountered: