Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/film.cpp
| Show First 20 Lines • Show All 273 Lines • ▼ Show 20 Lines | NODE_DEFINE(Film) | ||||
| SOCKET_FLOAT(filter_width, "Filter Width", 1.0f); | SOCKET_FLOAT(filter_width, "Filter Width", 1.0f); | ||||
| SOCKET_FLOAT(mist_start, "Mist Start", 0.0f); | SOCKET_FLOAT(mist_start, "Mist Start", 0.0f); | ||||
| SOCKET_FLOAT(mist_depth, "Mist Depth", 100.0f); | SOCKET_FLOAT(mist_depth, "Mist Depth", 100.0f); | ||||
| SOCKET_FLOAT(mist_falloff, "Mist Falloff", 1.0f); | SOCKET_FLOAT(mist_falloff, "Mist Falloff", 1.0f); | ||||
| SOCKET_BOOLEAN(use_sample_clamp, "Use Sample Clamp", false); | SOCKET_BOOLEAN(use_sample_clamp, "Use Sample Clamp", false); | ||||
| SOCKET_BOOLEAN(denoising_data_pass, "Generate Denoising Data Pass", false); | |||||
| SOCKET_BOOLEAN(denoising_clean_pass, "Generate Denoising Clean Pass", false); | |||||
| SOCKET_INT(denoising_flags, "Denoising Flags", 0); | |||||
| return type; | return type; | ||||
| } | } | ||||
| Film::Film() | Film::Film() | ||||
| : Node(node_type) | : Node(node_type) | ||||
| { | { | ||||
| Pass::add(PASS_COMBINED, passes); | Pass::add(PASS_COMBINED, passes); | ||||
| ▲ Show 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | #endif | ||||
| case PASS_NONE: | case PASS_NONE: | ||||
| break; | break; | ||||
| } | } | ||||
| kfilm->pass_stride += pass.components; | kfilm->pass_stride += pass.components; | ||||
| } | } | ||||
| kfilm->pass_denoising_data = 0; | |||||
| kfilm->pass_denoising_clean = 0; | |||||
| kfilm->denoising_flags = 0; | |||||
| if(denoising_data_pass) { | |||||
| kfilm->pass_denoising_data = kfilm->pass_stride; | |||||
| kfilm->pass_stride += DENOISING_PASS_SIZE_BASE; | |||||
| kfilm->denoising_flags = denoising_flags; | |||||
| if(denoising_clean_pass) { | |||||
| kfilm->pass_denoising_clean = kfilm->pass_stride; | |||||
| kfilm->pass_stride += DENOISING_PASS_SIZE_CLEAN; | |||||
| kfilm->use_light_pass = 1; | |||||
| } | |||||
| } | |||||
| kfilm->pass_stride = align_up(kfilm->pass_stride, 4); | kfilm->pass_stride = align_up(kfilm->pass_stride, 4); | ||||
| kfilm->pass_alpha_threshold = pass_alpha_threshold; | kfilm->pass_alpha_threshold = pass_alpha_threshold; | ||||
| /* update filter table */ | /* update filter table */ | ||||
| vector<float> table = filter_table(filter_type, filter_width); | vector<float> table = filter_table(filter_type, filter_width); | ||||
| scene->lookup_tables->remove_table(&filter_table_offset); | scene->lookup_tables->remove_table(&filter_table_offset); | ||||
| filter_table_offset = scene->lookup_tables->add_table(dscene, table); | filter_table_offset = scene->lookup_tables->add_table(dscene, table); | ||||
| kfilm->filter_table_offset = (int)filter_table_offset; | kfilm->filter_table_offset = (int)filter_table_offset; | ||||
| /* mist pass parameters */ | /* mist pass parameters */ | ||||
| kfilm->mist_start = mist_start; | kfilm->mist_start = mist_start; | ||||
| kfilm->mist_inv_depth = (mist_depth > 0.0f)? 1.0f/mist_depth: 0.0f; | kfilm->mist_inv_depth = (mist_depth > 0.0f)? 1.0f/mist_depth: 0.0f; | ||||
| kfilm->mist_falloff = mist_falloff; | kfilm->mist_falloff = mist_falloff; | ||||
| pass_stride = kfilm->pass_stride; | |||||
| denoising_data_offset = kfilm->pass_denoising_data; | |||||
| denoising_clean_offset = kfilm->pass_denoising_clean; | |||||
| need_update = false; | need_update = false; | ||||
| } | } | ||||
| void Film::device_free(Device * /*device*/, | void Film::device_free(Device * /*device*/, | ||||
| DeviceScene * /*dscene*/, | DeviceScene * /*dscene*/, | ||||
| Scene *scene) | Scene *scene) | ||||
| { | { | ||||
| scene->lookup_tables->remove_table(&filter_table_offset); | scene->lookup_tables->remove_table(&filter_table_offset); | ||||
| Show All 28 Lines | |||||