-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The refactor is caused by the following observation: the current system doesn't manage inter-node arguments, for example display array bucket can't pass its member pointer to mesh slots directly, the mesh slot has to get the pointer itself. This restriction is very blocking with the futur work on blender2.8 were the mesh slot will need to know the current shader used to bind the modelview matrix. To do so each node should be allowed to send a structure to its children node in addition to the global data structure. This will add a argument to every node bind/unbind functions, but instead of having all the arguments passed to mesh slot bind/unbind function (global, material, dab), a tuple structure is used, it contains all the arguments which will be passed to a node. This tuple structure is unique per node type and sub node use a tuple based on parent node tuple but with a pointer to node data. For example mesh slot tuple constructor is: RAS_MeshSlotNodeTuple(const RAS_DisplayArrayNodeTuple& displayArrayTuple, RAS_DisplayArrayNodeData *displayArrayData) It uses the DAB tuple of its parent node (which contains only data from materials node) and the parent node data. The type of the tuple, the data passed and the previous template arguments are now put in a info structure containing only aliases. The node data used to construct the tuple is gave to the node construct under a pointer to allow share same node data for different node, for example the instancing and non-instancing nodes in DAB sharing the same data. The building of the tuple is made for the downward and upward tree, the downward tree is the easiest. In this tree each node call its children node and before calling they initialize a tuple of the child tuple type with the tuple passed to the RAS_DownwardNode::Execute functions and the internal node data. On the other hand upward tree required to refactor the iterator used. Firstly the iterator bind the first node at its construction and unbind the last node at its destruction, it makes the tuple passed to node always valid in the iterator. Secondly the iterator use a conditional type as parent iterator, if the parent of parent node type is not RAS_DummyNode then we use RAS_UpwardNodeIterator<ParentNode> else RAS_DummyUpwardNodeIterator<ParentNode>. The last type is a iterator without any member to parent iterator, by this method we avoid using a pointer to avoid iterator recursion. The inter-node data are already used for mesh slot and display array bucket, mainly to get material data and vertex storage (VBO).
- Loading branch information
1 parent
e7ef47b
commit 0aad135
Showing
19 changed files
with
483 additions
and
300 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.