This repository has been archived on 2023-10-09. You can view files and clone it, but cannot push or open issues or pull requests.
Files
blender-archive/source/blender/gpu/shaders/material/gpu_shader_material_anisotropic.glsl
Clément Foucault 6f3c279d9e EEVEE: Add support for GGX Multi-scatter
Based on http://jcgt.org/published/0008/01/03/

This is a simple trick that does *not* have a huge performance impact but
does work pretty well. It just modifies the Fresnel term to account for
the multibounce energy loss (coloration).

However this makes the shader variations count double. To avoid this we
use a uniform and pass the multiscatter use flag inside the sign of f90.
This is a bit hacky but avoids many code duplication.

This uses the simplification proposed by McAuley in
A Journey Through Implementing Multiscattering BRDFs and Area Lights

This does not handle area light differently than the IBL case but that's
already an issue in current implementation.

This is related to T68460.

Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8912
2020-09-19 00:09:51 +02:00

17 lines
605 B
GLSL

#ifndef VOLUMETRICS
void node_bsdf_anisotropic(vec4 color,
float roughness,
float anisotropy,
float rotation,
vec3 N,
vec3 T,
float use_multiscatter,
out Closure result)
{
node_bsdf_glossy(color, roughness, N, -1, use_multiscatter, result);
}
#else
/* Stub anisotropic because it is not compatible with volumetrics. */
# define node_bsdf_anisotropic(a, b, c, d, e, f, g, result) (result = CLOSURE_DEFAULT)
#endif