Skip to content

Discourage using || on is_specular #33

@trevordblack

Description

@trevordblack

"Note that due to WGSL's short-circuiting rules, the call to schlick_fresnel won't evaluate if cannot_refract is true, skipping the computation at angles of total internal reflection. "

This is perfectly fine and will work forever

But this line is doing a lot

    is_specular = cannot_refract || schlick_fresnel(ref_ratio, cos_theta) > rand_f32();

consider splitting into multiple if statements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions