Fix T84658: Anisotropic BSDF - most modes not using Screen Space

Reflection

Anisotropic is not really supported in Eevee, but since code looks like
it is just intended to make it behave like glossy, it should function
like it too.

Seems like the internal calling from `node_bsdf_glossy` from
`node_bsdf_anisotropic` has swapped arguments.
Also: ssr_id is available for SH_NODE_BSDF_ANISOTROPIC as well (see
`ntree_tag_bsdf_cb`), so why not use it?

Maniphest Tasks: T84658

Differential Revision: https://developer.blender.org/D10547
This commit is contained in:
Philipp Oeser 2021-02-26 16:49:06 +01:00
parent bfc70a6a95
commit 71ed6f32d2
Notes: blender-bot 2023-02-14 09:17:57 +01:00
Referenced by issue #84658, Anisotropic BSDF - most modes not using Screen Space Reflection
2 changed files with 11 additions and 5 deletions

View File

@ -5,12 +5,13 @@ void node_bsdf_anisotropic(vec4 color,
float rotation,
vec3 N,
vec3 T,
float use_multiscatter,
const float use_multiscatter,
const float ssr_id,
out Closure result)
{
node_bsdf_glossy(color, roughness, N, -1, use_multiscatter, result);
node_bsdf_glossy(color, roughness, N, use_multiscatter, ssr_id, 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)
# define node_bsdf_anisotropic(a, b, c, d, e, f, g, h, result) (result = CLOSURE_DEFAULT)
#endif

View File

@ -55,8 +55,13 @@ static int node_shader_gpu_bsdf_anisotropic(GPUMaterial *mat,
float use_multi_scatter = (node->custom1 == SHD_GLOSSY_MULTI_GGX) ? 1.0f : 0.0f;
return GPU_stack_link(
mat, node, "node_bsdf_anisotropic", in, out, GPU_constant(&use_multi_scatter));
return GPU_stack_link(mat,
node,
"node_bsdf_anisotropic",
in,
out,
GPU_constant(&use_multi_scatter),
GPU_constant(&node->ssr_id));
}
/* node type definition */