From 023a7fada8b1c675d02a50bcc665c5e5b9d71b28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 19 Aug 2019 20:33:17 +0200 Subject: Eevee: Use manual derivatives for better quality bump. We basically duplicate the height map branch plugged into the bump node, and tag each node in each branch as dx/dy/ref using `branch_tag`. Then we add a one pixel offset on the texture coordinates if the node is tagged as dx or dy. The dx/dy branches are plugged into (new) hidden sockets on the bump node. This match cycles bump better but have a performance impact. Also, complex nodetrees can now become instruction limited and not compile anymore. Reviewers: brecht Differential Revision: https://developer.blender.org/D5531 --- source/blender/makesdna/DNA_node_types.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_node_types.h b/source/blender/makesdna/DNA_node_types.h index ee5e9a13f66..6d2b278472f 100644 --- a/source/blender/makesdna/DNA_node_types.h +++ b/source/blender/makesdna/DNA_node_types.h @@ -276,7 +276,8 @@ typedef struct bNode { short preview_xsize, preview_ysize; /** Used at runtime when going through the tree. Initialize before use. */ short tmp_flag; - char _pad2[2]; + /** Used at runtime to tag derivatives branches. EEVEE only. */ + short branch_tag; /** Runtime during drawing. */ struct uiBlock *block; -- cgit v1.2.3