Cycles Refactor: Replace fixed Tangent input with custom input #119042
|
@ -2391,6 +2391,9 @@ void GlossyBsdfNode::compile(SVMCompiler &compiler)
|
|||
{
|
||||
closure = distribution;
|
||||
|
||||
ShaderInput *tangent = input("Tangent");
|
||||
tangent = tangent->link || tangent->constant_folded_in ? tangent : NULL;
|
||||
|
||||
|
||||
/* TODO: Just use weight for legacy MultiGGX? Would also simplify OSL. */
|
||||
if (closure == CLOSURE_BSDF_MICROFACET_MULTI_GGX_ID) {
|
||||
BsdfNode::compile(compiler,
|
||||
|
@ -2398,15 +2401,11 @@ void GlossyBsdfNode::compile(SVMCompiler &compiler)
|
|||
input("Anisotropy"),
|
||||
input("Rotation"),
|
||||
input("Color"),
|
||||
input("Tangent"));
|
||||
tangent);
|
||||
}
|
||||
else {
|
||||
BsdfNode::compile(compiler,
|
||||
input("Roughness"),
|
||||
input("Anisotropy"),
|
||||
input("Rotation"),
|
||||
NULL,
|
||||
input("Tangent"));
|
||||
BsdfNode::compile(
|
||||
compiler, input("Roughness"), input("Anisotropy"), input("Rotation"), NULL, tangent);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
I'd prefer to add a
SVMCompiler::is_linked
to check these conditions, seems a bit cleaner than repeating them here.If not, I'd suggest at least wrapping the condition in parentheses.
Also, nitpick, but I think this should be
nullptr
in new code.