Shader editing
AssigneeConstructive Labs
InventorMichael Roberts
Life of this patent
Estimating the term…
Abstract
A method and system for editing a shader. The method comprises providing a graph (122) corresponding to the shader (e.g. a shader graph). The graph (122) comprises a plurality of entities (120), for example shader nodes, which are connected together by one or more edges (124). One or more of the entities each include a respective variable parameter. The method further comprises sending, from an editor entity (130-136), to an entity (120) within the graph (122), a message, the message specifying a change in a value of the variable parameter of that entity (120); responsive to the entity (120) receiving the message, changing the variable parameter of that entity (120), thereby providing a changed graph; and modifying the shader based on the changed graph.
Claims16
A method for editing a shader, the method comprising:
- providing a graph corresponding to the shader, the graph comprising a plurality of entities connected together by one or more edges, wherein one or more of the entities each include a respective variable parameter, and wherein the graph comprises a root entity;
- sending, from an editor entity, to an entity within the graph, a message, the message specifying a change in a value of the variable parameter of the entity within the graph;
- responsive to the entity receiving the message, changing the variable parameter of the entity, wherein changing the variable parameter of the entity causes a change in a code fragment of the entity;
- performing one or more times steps (i)-(ii) until a code fragment of the root entity is changed, thereby to provide a changed graph, wherein:
- step (i) comprises, responsive to changing a code fragment of the entity, sending, in a further message, the changed code fragment from the entity to an upstream entity within the graph that is connected to the entity within the graph via an edge, wherein the upstream entity is located on a path between the entity and the root entity in the graph;
- and
- step (ii) comprises, responsive to the upstream entity receiving the further message, changing a code fragment of the upstream entity based on the further message received by the upstream entity;
- and,
- thereafter, modifying the shader based on the changed graph.
A computer system for editing a shader, the computer system comprising:
- one or more processors;
- and
- one or more storage devices storing:
- a graph corresponding to the shader, the graph comprising a plurality of entities connected together by one or more edges, wherein one or more of the entities each include a respective variable parameter, and wherein the graph comprises a root entity;
- an editor entity;
- and
- instructions that when executed by the one or more processors cause the one or more processors to perform a method, the method comprising:
- sending, from the editor entity, to an entity within the graph, a message, the message specifying a change in a value of the variable parameter of the entity within the graph;
- performing one or more times steps (i)-(ii) until the root entity receives a changed code fragment, thereby to provide a changed graph, wherein:
- step (i) comprises, responsive to the entity receiving a message, changing a code fragment of the entity based on the message received by the entity;
- and
- step (ii) comprises, responsive to changing a code fragment of the entity, sending, in a further message, the changed code fragment from the entity to an upstream entity within the graph that is connected to the entity within the graph via an edge, wherein the upstream entity is located on a path between the entity and the root entity in the graph;
- and,
- thereafter, modifying the shader based on the changed graph.
A non-transitory computer-readable storage medium storing a program or at least one of a plurality of programs arranged such that when executed by a computer system or one or more processors it/they cause the computer system or the one or more processors to perform a method, the method comprising:
- providing a graph corresponding to the shader, the graph comprising a plurality of entities connected together by one or more edges, wherein one or more of the entities each include a respective variable parameter, and wherein the graph comprises a root entity;
- sending, from an editor entity, to an entity within the graph, a message, the message specifying a change in a value of the variable parameter of the entity within the graph;
- responsive to the entity receiving the message, changing the variable parameter of the entity, wherein changing the variable parameter of the entity causes a change in a code fragment of the entity;
- performing one or more times steps (i)-(ii) until a code fragment of the root entity is changed, thereby to provide a changed graph, wherein:
- step (i) comprises, responsive to changing a code fragment of the entity, sending, in a further message, the changed code fragment from the entity to an upstream entity within the graph that is connected to the entity within the graph via an edge, wherein the upstream entity is located on a path between the entity and the root entity in the graph;
- and
- step (ii) comprises, responsive to the upstream entity receiving the further message, changing a code fragment of the upstream entity based on the further message received by the upstream entity;
- and,
- thereafter, modifying the shader based on the changed graph.
Dependencies are inferred from the claim text.