internal override void Render(RenderingCameraInformation renderingCameraInformation)
#endif
        {
            var materialModule = _materialModule as WaterMaterialModule;

            bool renderRefraction = materialModule.IsRefractionEnabled;
            bool renderReflection = materialModule.IsReflectionEnabled;

            var mainModule = _mainModule as WaterMainModule;

            var  largeWaterAreaManager       = mainModule.LargeWaterAreaManager;
            bool isConnectedToLargeWaterArea = largeWaterAreaManager != null;

            ComputeVisibleAreas(!isConnectedToLargeWaterArea ? _meshModule.Bounds : largeWaterAreaManager.GetWaterObjectsBoundsRelativeToSpecifiedWaterObject(mainModule));

#if !GAME_2D_WATER_KIT_LWRP && !GAME_2D_WATER_KIT_URP
            int pixelLightCount = QualitySettings.pixelLightCount;
            if (!_renderPixelLights)
            {
                QualitySettings.pixelLightCount = 0;
            }
#endif

            _meshModule.SetRendererActive(false);

            Color backgroundColor = renderingCameraInformation.CurrentCamera.backgroundColor;
            backgroundColor.a = 1f;

            bool isUsingOpaqueRenderQueue = _materialModule.RenderQueue == 2000;

            if (renderRefraction && !isUsingOpaqueRenderQueue)
            {
                SetupRefractionMask();
            }

#if GAME_2D_WATER_KIT_LWRP || GAME_2D_WATER_KIT_URP
            _renderingContext = context;
#endif

            if (!materialModule.IsFakePerspectiveEnabled)
            {
                if (renderRefraction)
                {
                    if (!isUsingOpaqueRenderQueue)
                    {
                        SetRefractionMaskLayer(Refraction.GetValidRefractionMaskLayer());
                    }

                    ExecuteRendering(Refraction, _g2dwCamera, _wholeWaterVisibleArea, backgroundColor, _allowHDR, _allowMSAA);
                    materialModule.SetRefractionRenderTexture(Refraction.RenderTexture);
                }

                if (renderReflection)
                {
                    _refractionMask.SetActive(false);

                    ExecuteRendering(Reflection, _g2dwCamera, _wholeWaterVisibleArea, _clearColor, _allowHDR, _allowMSAA);
                    materialModule.SetReflectionRenderTexture(Reflection.RenderTexture);
                }
            }
            else
            {
                if (renderRefraction)
                {
                    int extraLayersToIgnoreMask = RefractionPartiallySubmergedObjects.CullingMask;

                    if (!isUsingOpaqueRenderQueue)
                    {
                        SetRefractionMaskLayer(Refraction.GetValidRefractionMaskLayer(extraLayersToIgnoreMask));
                    }

                    ExecuteRendering(Refraction, _g2dwCamera, _wholeWaterVisibleArea, backgroundColor, _allowHDR, _allowMSAA, extraLayersToIgnoreMask);
                    materialModule.SetRefractionRenderTexture(Refraction.RenderTexture);

                    if (!isUsingOpaqueRenderQueue)
                    {
                        SetRefractionMaskLayer(RefractionPartiallySubmergedObjects.GetValidRefractionMaskLayer());
                    }

                    ExecuteRendering(RefractionPartiallySubmergedObjects, _g2dwCamera, _wholeWaterVisibleArea, _clearColor, _allowHDR, _allowMSAA);
                    materialModule.SetRefractionPartiallySubmergedObjectsRenderTexture(RefractionPartiallySubmergedObjects.RenderTexture);
                }
                if (renderReflection)
                {
                    _refractionMask.SetActive(false);

                    ExecuteRendering(Reflection, _g2dwCamera, _surfaceVisibleArea, _clearColor, _allowHDR, _allowMSAA, ReflectionPartiallySubmergedObjects.CullingMask);
                    materialModule.SetReflectionRenderTexture(Reflection.RenderTexture);

                    ExecuteRendering(ReflectionPartiallySubmergedObjects, _g2dwCamera, _surfaceBelowSubmergeLevelVisibleArea, _clearColor, _allowHDR, _allowMSAA);
                    materialModule.SetReflectionPartiallySubmergedObjectsRenderTexture(ReflectionPartiallySubmergedObjects.RenderTexture);
                }
            }

            _refractionMask.SetActive(false);

#if !GAME_2D_WATER_KIT_LWRP && !GAME_2D_WATER_KIT_URP
            QualitySettings.pixelLightCount = pixelLightCount;
#endif

            _meshModule.SetRendererActive(true);

            var worldToVisibleAreaMatrix = Matrix4x4.TRS(_wholeWaterVisibleArea.RefractionProperties.Position, _wholeWaterVisibleArea.RefractionProperties.Rotation, new Vector3(1f, 1f, -1f)).inverse;
            var projectionMatrix         = _wholeWaterVisibleArea.RefractionProperties.ProjectionMatrix;
            materialModule.SetWaterMatrix(projectionMatrix * worldToVisibleAreaMatrix * _mainModule.LocalToWorldMatrix);
            materialModule.SetReflectionLowerLimit(_mainModule.Height * 0.5f);
            materialModule.ValidateMaterialPropertyBlock();

            if (isConnectedToLargeWaterArea)
            {
                SetCurrentFrameRenderInformationToLargeWaterAreaManager(largeWaterAreaManager, renderRefraction, renderReflection, projectionMatrix, worldToVisibleAreaMatrix, renderingCameraInformation.CurrentCamera);
            }
        }