Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Cook-Torrance] Investigate UE4's Fresnel Shlick optimization #16

@Razakhel

Description

@Razakhel

Instead of the common Fresnel calculation, Brian Karis suggests using a spherical gaussian approximation, which he deems more efficient with unnoticeable differences.

As such, the current Fresnel calculation:

Standard formula

vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(1.0 - cosTheta, 5.0);

would become:

Optimization formula

vec3 fresnel = baseReflectivity + (1.0 - baseReflectivity) * pow(2.0, (-5.55473 * cosTheta - 6.98316) * cosTheta);

In RaZ's case, this actually fixes black artifacts when the light's position is strictly equivalent to the camera's (which should not happen in real life cases):

Fresnel artifacts
Fresnel optimization

This optimization should probably be investigated, as the artifacts may come from a small blunder in the implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementNew feature or improvementRenderingIssues related to rendering

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions