Skip to content

Possible problem in pl_shader_delinearize #343

@DmitryV231-corp

Description

@DmitryV231-corp

Maybe there is a problem in PL_COLOR_TRC_HLG "delinearization":

// OOTF^-1
GLSL("color.rgb *= 1.0 / "$"; \n"
"color.rgb *= 12.0 * max(1e-6, pow(dot("$", color.rgb), "$")); \n",
SH_FLOAT(csp_max), sh_luma_coeffs(sh, csp), SH_FLOAT((1 - y) / y));

if color.rgb == vec3(0) the result of pow(0, ) is undefined.
I see a garbage in results.

Also, it looks strange:
(1 - y) / y
Should it be simply (1-y)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions