Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/graph.h
| /* | /* | ||||
| * Copyright 2011-2013 Blender Foundation | * Copyright 2011-2016 Blender Foundation | ||||
| * | * | ||||
| * Licensed under the Apache License, Version 2.0 (the "License"); | * Licensed under the Apache License, Version 2.0 (the "License"); | ||||
| * you may not use this file except in compliance with the License. | * you may not use this file except in compliance with the License. | ||||
| * You may obtain a copy of the License at | * You may obtain a copy of the License at | ||||
| * | * | ||||
| * http://www.apache.org/licenses/LICENSE-2.0 | * http://www.apache.org/licenses/LICENSE-2.0 | ||||
| * | * | ||||
| * Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | ||||
| Show All 25 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 void constant_fold(const ConstantFolder& /*folder*/) {} | ||||
| 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*/) {}; | ||||
| virtual bool has_surface_emission() { return false; } | virtual bool has_surface_emission() { return false; } | ||||
| virtual bool has_surface_transparent() { return false; } | virtual bool has_surface_transparent() { return false; } | ||||
| ▲ Show 20 Lines • Show All 92 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 | |||||