Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/node_shader_tree.c
| Show First 20 Lines • Show All 469 Lines • ▼ Show 20 Lines | ntree_shader_link_builtin_normal(ntree, | ||||
| displacement_socket); | displacement_socket); | ||||
| /* TODO(sergey): Reconnect Geometry Info->Normal sockets to the new | /* TODO(sergey): Reconnect Geometry Info->Normal sockets to the new | ||||
| * bump node. | * bump node. | ||||
| */ | */ | ||||
| /* We modified the tree, it needs to be updated now. */ | /* We modified the tree, it needs to be updated now. */ | ||||
| ntreeUpdateTree(G.main, ntree); | ntreeUpdateTree(G.main, ntree); | ||||
| } | } | ||||
| void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat, short compatibility) | /** | ||||
| * Deprecated function, that operates on a local version of the nodetree. | |||||
| */ | |||||
| void ntreeGPUMaterialNodes_local(bNodeTree *ntree, GPUMaterial *mat, short compatibility) | |||||
| { | { | ||||
| /* localize tree to create links for reroute and mute */ | /* localize tree to create links for reroute and mute */ | ||||
| bNodeTree *localtree = ntreeLocalize(ntree); | bNodeTree *localtree = ntreeLocalize(ntree); | ||||
| bNodeTreeExec *exec; | bNodeTreeExec *exec; | ||||
| /* Perform all needed modifications on the tree in order to support | /* Perform all needed modifications on the tree in order to support | ||||
| * displacement/bump mapping. | * displacement/bump mapping. | ||||
| */ | */ | ||||
| ntree_shader_relink_displacement(localtree, compatibility); | ntree_shader_relink_displacement(localtree, compatibility); | ||||
| exec = ntreeShaderBeginExecTree(localtree); | exec = ntreeShaderBeginExecTree(localtree); | ||||
| ntreeExecGPUNodes(exec, mat, 1, compatibility); | ntreeExecGPUNodes(exec, mat, 1, compatibility); | ||||
| ntreeShaderEndExecTree(exec); | ntreeShaderEndExecTree(exec); | ||||
| ntreeFreeTree(localtree); | ntreeFreeTree(localtree); | ||||
| MEM_freeN(localtree); | MEM_freeN(localtree); | ||||
| } | } | ||||
| /** | |||||
| * We read the node tree to populate the data into GPUMaterial. | |||||
| * | |||||
| * This is not entirely cow safe since we are storing pointers to the bNodeTree data | |||||
| * directly in the Uniform buffer objects. | |||||
| * | |||||
| * XXX TODO(dfelinto): Still need to support displacement/bump mapping. | |||||
| */ | |||||
| void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat) | |||||
| { | |||||
| bNodeTreeExec *exec = ntreeShaderBeginExecTree(ntree); | |||||
| ntreeExecGPUNodes(exec, mat, 1, NODE_NEWER_SHADING); | |||||
| ntreeShaderEndExecTree(exec); | |||||
| } | |||||
brecht: This function name doesn't describe what it does differently than `ntreeGPUMaterialNodes`.
It… | |||||
| /* **************** call to switch lamploop for material node ************ */ | /* **************** call to switch lamploop for material node ************ */ | ||||
| void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *); | void (*node_shader_lamp_loop)(struct ShadeInput *, struct ShadeResult *); | ||||
| void set_node_shader_lamp_loop(void (*lamp_loop_func)(ShadeInput *, ShadeResult *)) | void set_node_shader_lamp_loop(void (*lamp_loop_func)(ShadeInput *, ShadeResult *)) | ||||
| { | { | ||||
| node_shader_lamp_loop = lamp_loop_func; | node_shader_lamp_loop = lamp_loop_func; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 121 Lines • Show Last 20 Lines | |||||
This function name doesn't describe what it does differently than ntreeGPUMaterialNodes.
It skips the localization, that is used to modify the nodetree to support reroute, mute and bump. So those are broken now or did I miss something?