예제 #1
0
        private void OnBeginRender(Camera camera)
        {
            if (profile == null)
            {
                return;
            }

            // カメラ毎に Renderer を作る
            if (!renderers.ContainsKey(camera))
            {
                renderers[camera] = new MassiveGrassRenderer(camera, targetTerrain, alphaMaps, profile);
                Debug.Log(camera + " renderer created");
            }

            foreach (var massiveGrassRenderer in renderers.Values)
            {
                massiveGrassRenderer.OnBeginRender();
            }
        }
예제 #2
0
            public void OnBeginRender(
                Camera camera,
                MassiveGrassProfile profile,
                Terrain terrain,
                List <Texture2D> alphaMaps,
                int maxParallelJobCount)
            {
                if (profile == null)
                {
                    return;
                }
                if (!renderers.ContainsKey(profile))
                {
                    renderers[profile] = new MassiveGrassRenderer(
                        camera,
                        terrain,
                        alphaMaps,
                        profile,
                        maxParallelJobCount);
                    Debug.Log($" renderer for {profile} created on {camera}");
                }

                renderers[profile].OnBeginRender();
            }