Beispiel #1
0
        /// <summary>
        /// 烘培,仅在Unity线程调用;
        /// </summary>
        public LandformBakeResult Bake(LandformBakeRequest request)
        {
            BakeTextureInfo landformDiffuseInfo = Quality.LandformDiffuseMap;
            RenderTexture   diffuseRT           = RenderTexture.GetTemporary(landformDiffuseInfo.BakeWidth, landformDiffuseInfo.BakeHeight);

            BakeTextureInfo landformHeightInfo = Quality.LandformHeightMap;
            RenderTexture   heightRT           = RenderTexture.GetTemporary(landformHeightInfo.BakeWidth, landformHeightInfo.BakeHeight);

            PrepareBakeScene(request.ChunkCoord, request.BakePoints);
            CameraRender(request.ChunkCoord, diffuseRT);
            BoardsDisplayHeight(request.BakePoints);
            CameraRender(request.ChunkCoord, heightRT);

            LandformBakeResult result = new LandformBakeResult()
            {
                DiffuseMap = GetDiffuseMap(diffuseRT),
                HeightMap  = GetHeightMap(heightRT),
            };

            RenderTexture.ReleaseTemporary(diffuseRT);
            RenderTexture.ReleaseTemporary(heightRT);
            return(result);
        }
Beispiel #2
0
 public Task <LandformBakeResult> BakeAsync(LandformBakeRequest request)
 {
     throw new NotImplementedException();
 }