Exemplo n.º 1
0
        public void CreateBuffers(StarVertDescriptor[] stars)
        {
            if (renderIntoDownscaledTarget)
            {
                isFirst = RenderTexturesBucket.CreateIfNeeded(galaxy.gameObject);
            }

            _downRezId = new RenderTargetIdentifier(RenderTexturesBucket.Instance.downRez);
            _medRezId  = new RenderTargetIdentifier(RenderTexturesBucket.Instance.downRezMed);
            _highRezId = new RenderTargetIdentifier(RenderTexturesBucket.Instance.downRezHigh);

            starsData = new ComputeBuffer(stars.Length, StarVertDescriptor.StructSize);
            starsData.SetData(stars);
            starCount = stars.Length;
        }
Exemplo n.º 2
0
        public void CreateBuffers(StarVertDescriptor[] stars)
        {
            if (renderIntoDownscaledTarget)
            {
                isFirst = RenderTexturesBucket.CreateIfNeeded(galaxy.gameObject);
            }

            starsData = new ComputeBuffer(stars.Length, StarVertDescriptor.StructSize);
            starsData.SetData(stars);

            var cubeProxyParent = GameObject.CreatePrimitive(PrimitiveType.Cube);

            cubeProxyParent.name             = "Cube Proxy";
            cubeProxyParent.transform.parent = transform;
            cubeProxyParent.SetActive(false);

            cubeMeshProxy = cubeProxyParent.GetComponent <MeshFilter>().mesh;

            starCount = stars.Length;
        }