Пример #1
0
    private void LateUpdate()
    {
        if (!worldLODs[0].Exists)
        {
            return;
        }

        if (renderMode == ERenderMode.ScreenBuffer)
        {
            renderManager.SwapBuffers();
        }
        else
        {
            renderManager.ClearRayBuffer(renderMode);
        }

        if (renderManager.SetResolution(resolutionX, resolutionY) || LODDistances == null)
        {
            // res changed or no lod distances set up
            LODDistances = SetupLods(worldLODs[0].MaxDimension, resolutionX, resolutionY);
        }

        try {
            fakeCamera.CopyFrom(GetComponent <Camera>());
            fakeCamera.pixelRect = new Rect(0, 0, resolutionX, resolutionY);
            LimitRotationHorizon(fakeCamera.transform);
            renderManager.DrawWorld(BlitMaterial, worldLODs, fakeCamera, GetComponent <Camera>(), LODDistances);
        } catch (System.Exception e) {
            benchmarkTime = -1f;
            Debug.LogException(e);
        }
    }