Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/film.h
| Show All 11 Lines | |||||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||||
| * See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | ||||
| * limitations under the License. | * limitations under the License. | ||||
| */ | */ | ||||
| #ifndef __FILM_H__ | #ifndef __FILM_H__ | ||||
| #define __FILM_H__ | #define __FILM_H__ | ||||
| #include "render/pass.h" | |||||
| #include "util/util_string.h" | #include "util/util_string.h" | ||||
| #include "util/util_vector.h" | #include "util/util_vector.h" | ||||
| #include "kernel/kernel_types.h" | #include "kernel/kernel_types.h" | ||||
| #include "graph/node.h" | #include "graph/node.h" | ||||
| CCL_NAMESPACE_BEGIN | CCL_NAMESPACE_BEGIN | ||||
| class Device; | class Device; | ||||
| class DeviceScene; | class DeviceScene; | ||||
| class Scene; | class Scene; | ||||
| typedef enum FilterType { | typedef enum FilterType { | ||||
| FILTER_BOX, | FILTER_BOX, | ||||
| FILTER_GAUSSIAN, | FILTER_GAUSSIAN, | ||||
| FILTER_BLACKMAN_HARRIS, | FILTER_BLACKMAN_HARRIS, | ||||
| FILTER_NUM_TYPES, | FILTER_NUM_TYPES, | ||||
| } FilterType; | } FilterType; | ||||
| class Pass : public Node { | |||||
| public: | |||||
| NODE_DECLARE | |||||
| Pass(); | |||||
| PassType type; | |||||
| int components; | |||||
| bool filter; | |||||
| bool exposure; | |||||
| PassType divide_type; | |||||
| ustring name; | |||||
| static void add(PassType type, vector<Pass> &passes, const char *name = NULL); | |||||
| static bool equals(const vector<Pass> &A, const vector<Pass> &B); | |||||
| static bool contains(const vector<Pass> &passes, PassType); | |||||
| }; | |||||
| class Film : public Node { | class Film : public Node { | ||||
| public: | public: | ||||
| NODE_DECLARE | NODE_DECLARE | ||||
| NODE_SOCKET_API(float, exposure) | NODE_SOCKET_API(float, exposure) | ||||
| NODE_SOCKET_API(bool, denoising_data_pass) | |||||
| NODE_SOCKET_API(bool, denoising_clean_pass) | |||||
| NODE_SOCKET_API(bool, denoising_prefiltered_pass) | |||||
| NODE_SOCKET_API(int, denoising_flags) | |||||
| NODE_SOCKET_API(float, pass_alpha_threshold) | NODE_SOCKET_API(float, pass_alpha_threshold) | ||||
| NODE_SOCKET_API(PassType, display_pass) | NODE_SOCKET_API(PassType, display_pass) | ||||
| NODE_SOCKET_API(bool, show_active_pixels) | |||||
| NODE_SOCKET_API(FilterType, filter_type) | NODE_SOCKET_API(FilterType, filter_type) | ||||
| NODE_SOCKET_API(float, filter_width) | NODE_SOCKET_API(float, filter_width) | ||||
| NODE_SOCKET_API(float, mist_start) | NODE_SOCKET_API(float, mist_start) | ||||
| NODE_SOCKET_API(float, mist_depth) | NODE_SOCKET_API(float, mist_depth) | ||||
| NODE_SOCKET_API(float, mist_falloff) | NODE_SOCKET_API(float, mist_falloff) | ||||
| NODE_SOCKET_API(bool, use_light_visibility) | |||||
| NODE_SOCKET_API(CryptomatteType, cryptomatte_passes) | NODE_SOCKET_API(CryptomatteType, cryptomatte_passes) | ||||
| NODE_SOCKET_API(int, cryptomatte_depth) | NODE_SOCKET_API(int, cryptomatte_depth) | ||||
| NODE_SOCKET_API(bool, use_adaptive_sampling) | /* Approximate shadow catcher pass into its matte pass, so that both artificial objects and | ||||
| * shadows can be alpha-overed onto a backdrop. */ | |||||
| NODE_SOCKET_API(bool, use_approximate_shadow_catcher) | |||||
| private: | private: | ||||
| int pass_stride; | size_t filter_table_offset_; | ||||
| int denoising_data_offset; | bool prev_have_uv_pass = false; | ||||
| int denoising_clean_offset; | bool prev_have_motion_pass = false; | ||||
| size_t filter_table_offset; | bool prev_have_ao_pass = false; | ||||
| public: | public: | ||||
| Film(); | Film(); | ||||
| ~Film(); | ~Film(); | ||||
| /* add default passes to scene */ | /* add default passes to scene */ | ||||
| static void add_default(Scene *scene); | static void add_default(Scene *scene); | ||||
| void device_update(Device *device, DeviceScene *dscene, Scene *scene); | void device_update(Device *device, DeviceScene *dscene, Scene *scene); | ||||
| void device_free(Device *device, DeviceScene *dscene, Scene *scene); | void device_free(Device *device, DeviceScene *dscene, Scene *scene); | ||||
| void tag_passes_update(Scene *scene, const vector<Pass> &passes_, bool update_passes = true); | |||||
| int get_aov_offset(Scene *scene, string name, bool &is_color); | int get_aov_offset(Scene *scene, string name, bool &is_color); | ||||
| int get_pass_stride() const; | /* Get display pass from its name. | ||||
| int get_denoising_data_offset() const; | * Will do special logic to replace combined pass with shadow catcher matte. */ | ||||
| int get_denoising_clean_offset() const; | const Pass *get_actual_display_pass(Scene *scene, | ||||
| size_t get_filter_table_offset() const; | PassType pass_type, | ||||
| PassMode pass_mode = PassMode::NOISY); | |||||
| const Pass *get_actual_display_pass(Scene *scene, const Pass *pass); | |||||
| /* Update passes so that they contain all passes required for the configured functionality. */ | |||||
| void update_passes(Scene *scene); | |||||
| uint get_kernel_features(const Scene *scene) const; | |||||
| private: | |||||
| void add_auto_pass(Scene *scene, PassType type, const char *name = nullptr); | |||||
| void add_auto_pass(Scene *scene, PassType type, PassMode mode, const char *name = nullptr); | |||||
| void remove_auto_passes(Scene *scene); | |||||
| void finalize_passes(Scene *scene, const bool use_denoise); | |||||
| }; | }; | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||
| #endif /* __FILM_H__ */ | #endif /* __FILM_H__ */ | ||||