Fix #111588: Cycles: Vector displacement with adaptive subdiv breaks normal

The compact form of the differential is not enough here, we need to store
and use the full vectors for bump evaluation.

Pull Request: https://projects.blender.org/blender/blender/pulls/112987
This commit is contained in:
Lukas Stockner
2023-10-02 02:19:51 +02:00
committed by Lukas Stockner
parent 4d35344010
commit b1a91c99bc
6 changed files with 40 additions and 17 deletions

View File

@@ -6726,16 +6726,17 @@ void BumpNode::compile(SVMCompiler &compiler)
ShaderOutput *normal_out = output("Normal");
/* pack all parameters in the node */
compiler.add_node(NODE_SET_BUMP,
compiler.encode_uchar4(compiler.stack_assign_if_linked(normal_in),
compiler.stack_assign(distance_in),
invert,
use_object_space),
compiler.encode_uchar4(compiler.stack_assign(center_in),
compiler.stack_assign(dx_in),
compiler.stack_assign(dy_in),
compiler.stack_assign(strength_in)),
compiler.stack_assign(normal_out));
compiler.add_node(
NODE_SET_BUMP,
compiler.encode_uchar4(compiler.stack_assign_if_linked(normal_in),
compiler.stack_assign(distance_in),
invert,
use_object_space),
compiler.encode_uchar4(compiler.stack_assign(center_in),
compiler.stack_assign(dx_in),
compiler.stack_assign(dy_in),
compiler.stack_assign(strength_in)),
compiler.encode_uchar4(compiler.stack_assign(normal_out), compiler.get_bump_state_offset()));
}
void BumpNode::compile(OSLCompiler &compiler)