2023-08-04 13:24:17 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2020-02-11 21:40:23 -07:00
|
|
|
#include "stdcycles.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
shader node_diffuse_bsdf(color Color = 0.8,
|
2011-11-14 17:31:47 +00:00
|
|
|
float Roughness = 0.0,
|
2011-04-27 11:58:34 +00:00
|
|
|
normal Normal = N,
|
2012-12-11 16:06:03 +00:00
|
|
|
output closure color BSDF = 0)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
2012-10-17 01:47:37 +00:00
|
|
|
if (Roughness == 0.0)
|
2011-11-14 17:31:47 +00:00
|
|
|
BSDF = Color * diffuse(Normal);
|
|
|
|
|
else
|
2024-06-21 18:54:15 +02:00
|
|
|
BSDF = Color * oren_nayar_diffuse_bsdf(Normal, clamp(Color, 0.0, 1.0), Roughness);
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|