Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/graph.h
| Show All 35 Lines | |||||
| class Shader; | class Shader; | ||||
| class ShaderInput; | class ShaderInput; | ||||
| class ShaderOutput; | class ShaderOutput; | ||||
| class ShaderNode; | class ShaderNode; | ||||
| class ShaderGraph; | class ShaderGraph; | ||||
| class SVMCompiler; | class SVMCompiler; | ||||
| class OSLCompiler; | class OSLCompiler; | ||||
| class OutputNode; | class OutputNode; | ||||
| class ConstantFolder; | |||||
| /* Bump | /* Bump | ||||
| * | * | ||||
| * For bump mapping, a node may be evaluated multiple times, using different | * For bump mapping, a node may be evaluated multiple times, using different | ||||
| * samples to reconstruct the normal, this indicates the sample position */ | * samples to reconstruct the normal, this indicates the sample position */ | ||||
| enum ShaderBump { | enum ShaderBump { | ||||
| SHADER_BUMP_NONE, | SHADER_BUMP_NONE, | ||||
| ▲ Show 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | public: | ||||
| virtual ShaderNode *clone() const = 0; | virtual ShaderNode *clone() const = 0; | ||||
| virtual void attributes(Shader *shader, AttributeRequestSet *attributes); | virtual void attributes(Shader *shader, AttributeRequestSet *attributes); | ||||
| virtual void compile(SVMCompiler& compiler) = 0; | virtual void compile(SVMCompiler& compiler) = 0; | ||||
| virtual void compile(OSLCompiler& compiler) = 0; | virtual void compile(OSLCompiler& compiler) = 0; | ||||
| /* ** Node optimization ** */ | /* ** Node optimization ** */ | ||||
| /* Check whether the node can be replaced with single constant. */ | /* Check whether the node can be replaced with single constant. */ | ||||
| virtual bool constant_fold(ShaderGraph * /*graph*/, ShaderOutput * /*socket*/, ShaderInput * /*optimized*/) { return false; } | virtual bool constant_fold(ConstantFolder */*folder*/) { return false; } | ||||
| bool all_inputs_constant() const; | bool all_inputs_constant() const; | ||||
| /* Simplify settings used by artists to the ones which are simpler to | /* Simplify settings used by artists to the ones which are simpler to | ||||
| * evaluate in the kernel but keep the final result unchanged. | * evaluate in the kernel but keep the final result unchanged. | ||||
| */ | */ | ||||
| virtual void simplify_settings(Scene * /*scene*/) {}; | virtual void simplify_settings(Scene * /*scene*/) {}; | ||||
| ▲ Show 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | public: | ||||
| ~ShaderGraph(); | ~ShaderGraph(); | ||||
| ShaderGraph *copy(); | ShaderGraph *copy(); | ||||
| ShaderNode *add(ShaderNode *node); | ShaderNode *add(ShaderNode *node); | ||||
| OutputNode *output(); | OutputNode *output(); | ||||
| void connect(ShaderOutput *from, ShaderInput *to); | void connect(ShaderOutput *from, ShaderInput *to); | ||||
| void disconnect(ShaderOutput *from); | |||||
| void disconnect(ShaderInput *to); | void disconnect(ShaderInput *to); | ||||
| void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); | void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to); | ||||
| void remove_proxy_nodes(); | void remove_proxy_nodes(); | ||||
| void finalize(Scene *scene, | void finalize(Scene *scene, | ||||
| bool do_bump = false, | bool do_bump = false, | ||||
| bool do_osl = false, | bool do_osl = false, | ||||
| bool do_simplify = false); | bool do_simplify = false); | ||||
| Show All 29 Lines | |||||