Cycles: new Microfacet-based Hair BSDF with elliptical cross-section support #105600

Merged
Weizhen Huang merged 114 commits from weizhen/blender:microfacet_hair into main 2023-08-18 12:46:20 +02:00
2 changed files with 30 additions and 29 deletions
Showing only changes of commit 68605cd1c7 - Show all commits

View File

@ -3687,14 +3687,14 @@ NODE_DEFINE(MicrofacetHairBsdfNode)
SOCKET_IN_FLOAT(roughness, "Hair Roughness", 0.3f);
SOCKET_IN_FLOAT(ior, "IOR", 1.55f);
SOCKET_IN_FLOAT(R, "R lobe", 1.0f);
SOCKET_IN_FLOAT(TT, "TT lobe", 1.0f);
SOCKET_IN_FLOAT(TRT, "TRT lobe", 1.0f);
SOCKET_IN_FLOAT(random_roughness, "Random Roughness", 0.0f);
SOCKET_IN_FLOAT(random_color, "Random Color", 0.0f);
SOCKET_IN_FLOAT(random, "Random", 0.0f);
SOCKET_IN_FLOAT(R, "R lobe", 1.0f);
SOCKET_IN_FLOAT(TT, "TT lobe", 1.0f);
SOCKET_IN_FLOAT(TRT, "TRT lobe", 1.0f);
SOCKET_IN_NORMAL(normal, "Normal", zero_float3(), SocketType::LINK_NORMAL);
SOCKET_IN_FLOAT(surface_mix_weight, "SurfaceMixWeight", 0.0f, SocketType::SVM_INTERNAL);

View File

@ -50,31 +50,6 @@ static void node_declare(NodeDeclarationBuilder &b)
.max(1.0f)
.subtype(PROP_FACTOR)
.description("Microfacet roughness");
b.add_input<decl::Float>(N_("Reflection"), "R lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"The first light bounce off the hair surface. The color of this component is always "
"white");
b.add_input<decl::Float>(N_("Transmission"), "TT lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"The component that is transmitted through the hair. Picks up the color of the pigment "
"inside the hair");
b.add_input<decl::Float>(N_("Secondary Reflection"), "TRT lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"The component that is transmitted into the hair, reflected off the backside of the "
"hair and then transmitted out of the hair, oriented approximately around the incoming "
"direction. Picks up the color of the pigment inside the hair");
b.add_input<decl::Float>(N_("IOR")).default_value(1.55f).min(0.0f).max(1000.0f).description(
"Index of refraction determines how much the ray is bent. At 1.0 rays pass straight through "
"like in a transparent material; higher values cause larger deflection in angle. Default "
@ -101,6 +76,32 @@ static void node_declare(NodeDeclarationBuilder &b)
.description("Vary roughness values for each strand");
b.add_input<decl::Float>(N_("Random")).hide_value();
b.add_input<decl::Float>(N_("Weight")).unavailable();
b.add_input<decl::Float>(N_("Reflection"), "R lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"Optional factor for modulating the first light bounce off the hair surface. The color "
"of this component is always white. Keep this 1.0 for physical correctness");
b.add_input<decl::Float>(N_("Transmission"), "TT lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"Optional factor for modulating the transmission component. Picks up the color of the "
"pigment inside the hair. Keep this 1.0 for physical correctness");
b.add_input<decl::Float>(N_("Secondary Reflection"), "TRT lobe")
.default_value(1.0f)
.min(0.0f)
.max(1.0f)
.subtype(PROP_FACTOR)
.description(
"Optional factor for modulating the component which is transmitted into the hair, "
"reflected off the backside of the hair and then transmitted out of the hair. This "
"component is oriented approximately around the incoming direction, and picks up the "
"color of the pigment inside the hair. Keep this 1.0 for physical correctness");
b.add_output<decl::Shader>(N_("BSDF"));
}