/////////////////////////////////////////////////////////////////////////////////////////////// /// OnPostRender Callback //////////////////////////////////////////////////////////////////////////////////////////////// private void OnPostRender_ProjectorCallback(int _id, CSProjectorController _projectorController) { Camera projectorCamera = _projectorController.GetCamera(); // Render projector here if (ProjectorRenderingMode == ProjectorRenderMode.View_Dependent_Projection) { RenderViewPersepective(_id, projectorCamera); return; } if (ProjectorRenderingMode == ProjectorRenderMode.Static_Material_Projection) { // Blit Material to RenderTexture RenderTexture rt = _projectorController.GetActiveRT(); // Update active static material ActiveStaticRenderMaterial.UpdateInternal(); // Set Variables Shader.SetGlobalFloat("_ProjectorAspectRatio", _projectorController.GetAspectRatio()); Shader.SetGlobalColor("_BackgroundColor", ActiveStaticRenderMaterial.color); Graphics.Blit(ActiveStaticRenderMaterial.texture, rt, ActiveStaticRenderMaterial.material); return; } // Default render path { projectorCamera.depth = 1; projectorCamera.backgroundColor = DefualtBackground; projectorCamera.clearFlags = CameraClearFlags.SolidColor; projectorCamera.cullingMask = VirtualTextureMask | m_ProjectorOnlyMask; projectorCamera.Render(); } }