Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/render/film.cpp
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | case PASS_BACKGROUND: | ||||
| pass.components = 4; | pass.components = 4; | ||||
| pass.exposure = true; | pass.exposure = true; | ||||
| break; | break; | ||||
| case PASS_AO: | case PASS_AO: | ||||
| pass.components = 4; | pass.components = 4; | ||||
| break; | break; | ||||
| case PASS_SHADOW: | case PASS_SHADOW: | ||||
| pass.components = 4; | pass.components = 4; | ||||
| pass.exposure = false; | pass.exposure = false; | ||||
brecht: Was this change intentional? | |||||
Done Inline ActionsIt is a NOP operation as exposure is always false. Will revert it as we don't support shadow passes in the viewport. jbakker: It is a NOP operation as exposure is always false. Will revert it as we don't support shadow… | |||||
| break; | break; | ||||
| case PASS_LIGHT: | case PASS_LIGHT: | ||||
| /* This isn't a real pass, used by baking to see whether | /* This isn't a real pass, used by baking to see whether | ||||
| * light data is needed or not. | * light data is needed or not. | ||||
| * | * | ||||
| * Set components to 0 so pass sort below happens in a | * Set components to 0 so pass sort below happens in a | ||||
| * determined way. | * determined way. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | |||||
| /* Film */ | /* Film */ | ||||
| NODE_DEFINE(Film) | NODE_DEFINE(Film) | ||||
| { | { | ||||
| NodeType *type = NodeType::add("film", create); | NodeType *type = NodeType::add("film", create); | ||||
| SOCKET_FLOAT(exposure, "Exposure", 0.8f); | SOCKET_FLOAT(exposure, "Exposure", 0.8f); | ||||
| SOCKET_FLOAT(pass_alpha_threshold, "Pass Alpha Threshold", 0.5f); | SOCKET_FLOAT(pass_alpha_threshold, "Pass Alpha Threshold", 0.5f); | ||||
Done Inline ActionsMaybe changing this to 0.0 will make normals and UVs work? brecht: Maybe changing this to `0.0` will make normals and UVs work? | |||||
| static NodeEnum filter_enum; | static NodeEnum filter_enum; | ||||
| filter_enum.insert("box", FILTER_BOX); | filter_enum.insert("box", FILTER_BOX); | ||||
| filter_enum.insert("gaussian", FILTER_GAUSSIAN); | filter_enum.insert("gaussian", FILTER_GAUSSIAN); | ||||
| filter_enum.insert("blackman_harris", FILTER_BLACKMAN_HARRIS); | filter_enum.insert("blackman_harris", FILTER_BLACKMAN_HARRIS); | ||||
| SOCKET_ENUM(filter_type, "Filter Type", filter_enum, FILTER_BOX); | SOCKET_ENUM(filter_type, "Filter Type", filter_enum, FILTER_BOX); | ||||
| SOCKET_FLOAT(filter_width, "Filter Width", 1.0f); | SOCKET_FLOAT(filter_width, "Filter Width", 1.0f); | ||||
| Show All 34 Lines | void Film::device_update(Device *device, DeviceScene *dscene, Scene *scene) | ||||
| device_free(device, dscene, scene); | device_free(device, dscene, scene); | ||||
| KernelFilm *kfilm = &dscene->data.film; | KernelFilm *kfilm = &dscene->data.film; | ||||
| /* update __data */ | /* update __data */ | ||||
| kfilm->exposure = exposure; | kfilm->exposure = exposure; | ||||
| kfilm->pass_flag = 0; | kfilm->pass_flag = 0; | ||||
| kfilm->display_pass = display_pass; | |||||
| kfilm->light_pass_flag = 0; | kfilm->light_pass_flag = 0; | ||||
| kfilm->pass_stride = 0; | kfilm->pass_stride = 0; | ||||
| kfilm->use_light_pass = use_light_visibility || use_sample_clamp; | kfilm->use_light_pass = use_light_visibility || use_sample_clamp; | ||||
| bool have_cryptomatte = false; | bool have_cryptomatte = false; | ||||
| for (size_t i = 0; i < passes.size(); i++) { | for (size_t i = 0; i < passes.size(); i++) { | ||||
| Pass &pass = passes[i]; | Pass &pass = passes[i]; | ||||
| ▲ Show 20 Lines • Show All 156 Lines • ▼ Show 20 Lines | #endif | ||||
| } | } | ||||
| 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); | ||||
Done Inline ActionsI think it's better to just change the default value in film.cpp. Doing it just in the kernel data structures risk things going out of sync. brecht: I think it's better to just change the default value in `film.cpp`.
Doing it just in the… | |||||
| kfilm->filter_table_offset = (int)filter_table_offset; | kfilm->filter_table_offset = (int)filter_table_offset; | ||||
Done Inline ActionsNote that this just disables light passes accumulation, not lighting calculations. Which is ok and we can optimize this later, but just to correct the comment. brecht: Note that this just disables light passes accumulation, not lighting calculations.
Which is ok… | |||||
| /* 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; | ||||
| kfilm->cryptomatte_passes = cryptomatte_passes; | kfilm->cryptomatte_passes = cryptomatte_passes; | ||||
| kfilm->cryptomatte_depth = cryptomatte_depth; | kfilm->cryptomatte_depth = cryptomatte_depth; | ||||
| Show All 38 Lines | |||||
Was this change intentional?