void setCameraPostProcessSettings() { state.cameras.ToList().ForEach( obj_state => { // Get object ObjectState_t internal_object_state = internal_state.getWrapperObject(obj_state.ID, camera_template); GameObject obj = internal_object_state.gameObj; // Copy and save postProcessingProfile into internal_object_state. var postBehaviour = obj.GetComponent <PostProcessingBehaviour>(); internal_object_state.postProcessingProfile = Instantiate(postBehaviour.profile); postBehaviour.profile = internal_object_state.postProcessingProfile; // Enable depth if needed. if (obj_state.isDepth) { var debugSettings = internal_object_state.postProcessingProfile.debugViews.settings; debugSettings.mode = BuiltinDebugViewsModel.Mode.Depth; debugSettings.depth.scale = state.camDepthScale; // Save the settings. internal_object_state.postProcessingProfile.debugViews.settings = debugSettings; } else { // Set CTAA settings CTAA_PC AA = obj.GetComponent <CTAA_PC>(); // Check if AA object exists. if (AA != null) { AA.TemporalStability = state.temporalStability; AA.HdrResponse = state.hdrResponse; AA.Sharpness = state.sharpness; AA.AdaptiveEnhance = state.adaptiveEnhance; AA.TemporalJitterScale = state.temporalJitterScale; AA.MicroShimmerReduction = state.microShimmerReduction; AA.StaticStabilityPower = state.staticStabilityPower; AA.enabled = true; } else { // If CTAA is not installed on camera, fallback to PostProcessing FXAA. AntialiasingModel.Settings AASettings = internal_object_state.postProcessingProfile.antialiasing.settings; AASettings.method = AntialiasingModel.Method.Fxaa; AASettings.fxaaSettings.preset = AntialiasingModel.FxaaPreset.ExtremeQuality; // Save the settings. internal_object_state.postProcessingProfile.antialiasing.settings = AASettings; } } }); // }
void setCameraPostProcessSettings() { state.cameras.ForEach( obj_state => { // Get object ObjectState_t internal_object_state = internal_state.getWrapperObject(obj_state.ID, camera_template); GameObject obj = internal_object_state.gameObj; // Copy and save postProcessingProfile into internal_object_state. /* * var postBehaviour = obj.GetComponent<PostProcessingBehaviour>(); * internal_object_state.postProcessingProfile = Instantiate(postBehaviour.profile); * postBehaviour.profile = internal_object_state.postProcessingProfile; */ /* * // Enable depth if needed. * if (obj_state.isDepth) * { * * var debugSettings = internal_object_state.postProcessingProfile.debugViews.settings; * * debugSettings.mode = BuiltinDebugViewsModel.Mode.Depth; * debugSettings.depth.scale = state.camDepthScale; * // Save the settings. * internal_object_state.postProcessingProfile.debugViews.settings = debugSettings; * * // Disable AA * CTAA_PC AA = obj.GetComponent<CTAA_PC>(); * // Check if AA object exists. * if (AA != null) * { * AA.enabled = false; * } else * { * // If CTAA is not installed on camera, fallback to PostProcessing FXAA. * internal_object_state.postProcessingProfile.antialiasing.enabled = false; * } * * } else */ /* * { * // Set CTAA settings * CTAA_PC AA = obj.GetComponent<CTAA_PC>(); * // Check if AA object exists. * if (AA != null) * { * AA.TemporalStability = state.temporalStability; * AA.HdrResponse = state.hdrResponse; * AA.Sharpness = state.sharpness; * AA.AdaptiveEnhance = state.adaptiveEnhance; * AA.TemporalJitterScale = state.temporalJitterScale; * AA.MicroShimmerReduction = state.microShimmerReduction; * AA.StaticStabilityPower = state.staticStabilityPower; * AA.enabled = true; * } else * { * // If CTAA is not installed on camera, fallback to PostProcessing FXAA. * AntialiasingModel.Settings AASettings = internal_object_state.postProcessingProfile.antialiasing.settings; * * AASettings.method = AntialiasingModel.Method.Fxaa; * AASettings.fxaaSettings.preset = AntialiasingModel.FxaaPreset.ExtremeQuality; * * // Save the settings. * internal_object_state.postProcessingProfile.antialiasing.settings = AASettings; * internal_object_state.postProcessingProfile.antialiasing.enabled = true; * * } * * // Ensure that Camera's RGB/Grayscale mode reflects the number of channels it has. * ColorGradingModel.Settings colorGradingSettings = internal_object_state.postProcessingProfile.colorGrading.settings; * float saturation = (obj_state.channels == 3) ? 1.0f : 0.0f; * * colorGradingSettings.basic.saturation = saturation; * // Save the settings. * internal_object_state.postProcessingProfile.colorGrading.settings = colorGradingSettings; * * }*/ }); // }