This adds support for Translucent BSDF. This also fixes a bug to allow correct shadowing. The input normal had to be set back to non-inverted in the node function to allow for correct interpretation of the Normal by Screen Space Reflections. This add the necessary optimization and code deduplication to hybrid deferred and forward pipeline. Pull Request: https://projects.blender.org/blender/blender/pulls/116070
17 lines
432 B
GLSL
17 lines
432 B
GLSL
/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
|
|
void node_bsdf_translucent(vec4 color, vec3 N, float weight, out Closure result)
|
|
{
|
|
color = max(color, vec4(0.0));
|
|
N = safe_normalize(N);
|
|
|
|
ClosureTranslucent translucent_data;
|
|
translucent_data.weight = weight;
|
|
translucent_data.color = color.rgb;
|
|
translucent_data.N = N;
|
|
|
|
result = closure_eval(translucent_data);
|
|
}
|