public static void AddPass(SDKPass pass) { passes.Add(pass); }
private void CreateAssets() { bool cameraReferenceEnabled = cameraReference.enabled; if (cameraReferenceEnabled) { cameraReference.enabled = false; } bool cameraReferenceActive = cameraReference.gameObject.activeSelf; if (cameraReferenceActive) { cameraReference.gameObject.SetActive(false); } GameObject cloneGO = (GameObject)Object.Instantiate(cameraReference.gameObject, _liv.stage); _cameraInstance = (Camera)cloneGO.GetComponent("Camera"); SDKUtils.CleanCameraBehaviours(_cameraInstance, _liv.excludeBehaviours); if (cameraReferenceActive != cameraReference.gameObject.activeSelf) { cameraReference.gameObject.SetActive(cameraReferenceActive); } if (cameraReferenceEnabled != cameraReference.enabled) { cameraReference.enabled = cameraReferenceEnabled; } _cameraInstance.name = "LIV Camera"; if (_cameraInstance.tag == "MainCamera") { _cameraInstance.tag = "Untagged"; } _cameraInstance.transform.localScale = Vector3.one; _cameraInstance.rect = new Rect(0, 0, 1, 1); _cameraInstance.depth = 0; #if UNITY_5_4_OR_NEWER _cameraInstance.stereoTargetEye = StereoTargetEyeMask.None; #endif #if UNITY_5_6_OR_NEWER _cameraInstance.allowMSAA = false; #endif _cameraInstance.enabled = false; _cameraInstance.gameObject.SetActive(true); _universalAdditionalCameraData = _cameraInstance.GetComponent <UniversalAdditionalCameraData>(); _clipPlaneMesh = new Mesh(); SDKUtils.CreateClipPlane(_clipPlaneMesh, 10, 10, true, 1000f); _clipPlaneSimpleMaterial = new Material(Shader.Find(SDKShaders.LIV_CLIP_PLANE_SIMPLE_SHADER)); _clipPlaneSimpleDebugMaterial = new Material(Shader.Find(SDKShaders.LIV_CLIP_PLANE_SIMPLE_DEBUG_SHADER)); _clipPlaneComplexMaterial = new Material(Shader.Find(SDKShaders.LIV_CLIP_PLANE_COMPLEX_SHADER)); _clipPlaneComplexDebugMaterial = new Material(Shader.Find(SDKShaders.LIV_CLIP_PLANE_COMPLEX_DEBUG_SHADER)); _writeOpaqueToAlphaMaterial = new Material(Shader.Find(SDKShaders.LIV_WRITE_OPAQUE_TO_ALPHA_SHADER)); _combineAlphaMaterial = new Material(Shader.Find(SDKShaders.LIV_COMBINE_ALPHA_SHADER)); _writeMaterial = new Material(Shader.Find(SDKShaders.LIV_WRITE_SHADER)); _forceForwardRenderingMaterial = new Material(Shader.Find(SDKShaders.LIV_FORCE_FORWARD_RENDERING_SHADER)); _clipPlanePass = new SDKPass(); _clipPlanePass.renderPassEvent = _clipPlaneRenderPassEvent; _clipPlanePass.commandBuffer = new CommandBuffer(); _combineAlphaPass = new SDKPass(); _combineAlphaPass.renderPassEvent = _addAlphaRenderPassEvent; _combineAlphaPass.commandBuffer = new CommandBuffer(); _captureTexturePass = new SDKPass(); _captureTexturePass.renderPassEvent = _captureTextureRenderPassEvent; _captureTexturePass.commandBuffer = new CommandBuffer(); _applyTexturePass = new SDKPass(); _applyTexturePass.renderPassEvent = _applyTextureRenderPassEvent; _applyTexturePass.commandBuffer = new CommandBuffer(); _optimizedRenderingPass = new SDKPass(); _optimizedRenderingPass.renderPassEvent = _optimizedRenderingPassEvent; _optimizedRenderingPass.commandBuffer = new CommandBuffer(); _universalAdditionalCameraData.antialiasing = AntialiasingMode.None; _universalAdditionalCameraData.antialiasingQuality = AntialiasingQuality.Low; _universalAdditionalCameraData.dithering = false; #if UNITY_EDITOR _clipPlaneMesh.name = "LIV.clipPlane"; _clipPlaneSimpleMaterial.name = "LIV.clipPlaneSimple"; _clipPlaneSimpleDebugMaterial.name = "LIV.clipPlaneSimpleDebug"; _clipPlaneComplexMaterial.name = "LIV.clipPlaneComplex"; _clipPlaneComplexDebugMaterial.name = "LIV.clipPlaneComplexDebug"; _writeOpaqueToAlphaMaterial.name = "LIV.writeOpaqueToAlpha"; _combineAlphaMaterial.name = "LIV.combineAlpha"; _writeMaterial.name = "LIV.write"; _forceForwardRenderingMaterial.name = "LIV.forceForwardRendering"; _clipPlanePass.commandBuffer.name = "LIV.renderClipPlanes"; _combineAlphaPass.commandBuffer.name = "LIV.foregroundCombineAlpha"; _captureTexturePass.commandBuffer.name = "LIV.captureTexture"; _applyTexturePass.commandBuffer.name = "LIV.applyTexture"; _optimizedRenderingPass.commandBuffer.name = "LIV.optimizedRendering"; #endif }