// set render texture or colors if render texture is used (stills handled in AMTake) private void setRenderTexture(ITarget itarget, CameraFade cf, float frame, int firstTargetType, int secondTargetType, bool isReversed, CameraSwitcherKey action) { Camera firstCamera = (isReversed ? action.GetCameraEnd(itarget) : action.GetCamera(itarget)); Camera secondCamera = (isReversed ? action.GetCamera(itarget) : action.GetCameraEnd(itarget)); if (isReversed && frame == action.frame) { if (firstTargetType == 0) { Utility.SetTopCamera(firstCamera, GetCachedCameras(itarget)); } } else { if (secondTargetType == 0) { Utility.SetTopCamera(secondCamera, GetCachedCameras(itarget)); } } if (action.still || (firstTargetType != 0 && secondTargetType != 0)) { return; } bool isPro = Take.isProLicense; // first target is camera, set render texture if (firstTargetType == 0) { // if should update render texture if (/*!cf.tex ||*/ cf.shouldUpdateRenderTexture || (isPro && (!firstCamera.targetTexture || !cf.isRenderTextureSetupFor(firstCamera) /*|| firstCamera.targetTexture != cf.tex*/))) { if (isPro) { cf.setupRenderTexture(firstCamera); } else { cf.useRenderTexture = false; // show place-holder if non-pro cf.colorTex = Color.white; cf.hasColorTex = false; cf.clearScreenTex(); cf.placeholder = true; } } } }
void CameraGenerateFadeTargets(bool isReversed, Camera cam, Camera camEnd, Camera[] allCams, float[] parameters) { CameraFade cf = CameraFade.getCameraFade(); cf.incrementKeepAlives(true); if (cf.keepAliveColor) { cf.keepAliveColor = false; } cf.isReset = false; Camera firstCamera = null; Camera secondCamera = null; Color? firstColor = null; Color? secondColor = null; if (isReversed) { if (camEnd) { firstCamera = camEnd; } else if (typeEnd == 1) { firstColor = colorEnd; } if (cam) { secondCamera = cam; } else if (type == 1) { secondColor = color; } } else { if (cam) { firstCamera = cam; } else if (type == 1) { firstColor = color; } if (camEnd) { secondCamera = camEnd; } else if (typeEnd == 1) { secondColor = colorEnd; } } // setup first target if (firstCamera) { // camera if (!still) { cf.setupRenderTexture(firstCamera); } else { Utility.SetTopCamera(firstCamera, allCams); firstCamera.Render(); cf.refreshScreenTex(); cf.useRenderTexture = false; cf.hasColorTex = false; } } else { // color cf.colorTex = (Color)firstColor; cf.hasColorTex = true; } // setup second target if (secondCamera) { // camera Utility.SetTopCamera(secondCamera, allCams); cf.hasColorBG = false; } else { // color cf.colorBG = (Color)secondColor; cf.hasColorBG = true; } // iris shape if (irisShape) { cf.irisShape = irisShape; //cf.setupMaterials(); } cf.mode = cameraFadeType; // setup camera fade cf.setupMaterials(); cf.r = parameters; cf.value = 1f; cf.percent = 0f; }