public static VRageRender.MyBillboard AddBillboardParticle(MyAnimatedParticle particle, VRageRender.MyBillboard effectBillboard, bool sort)
        {
            //MyBillboard billboard = m_preallocatedParticleBillboards.Allocate();
            //VRageRender.MyBillboard billboard = new VRageRender.MyBillboard();
            VRageRender.MyBillboard billboard = VRageRender.MyRenderProxy.BillboardsPoolWrite.Allocate();
            if (billboard != null)
            {
                MyTransparentGeometry.StartParticleProfilingBlock("item.Value.Draw");
                if (particle.Draw(billboard) == true)
                {
                    if (!sort)
                    {
                        effectBillboard.ContainedBillboards.Add(billboard);
                    }

                    billboard.CustomViewProjection = -1;

                    MyPerformanceCounter.PerCameraDrawWrite.NewParticlesCount++;
                }
                else
                {
                    billboard = null;
                }

                MyTransparentGeometry.EndParticleProfilingBlock();
            }

            return(billboard);
        }
Esempio n. 2
0
        public static VRageRender.MyBillboard AddBillboardParticle(MyAnimatedParticle particle)
        {
            //MyBillboard billboard = m_preallocatedParticleBillboards.Allocate();
            //VRageRender.MyBillboard billboard = new VRageRender.MyBillboard();
            VRageRender.MyBillboard billboard = VRageRender.MyRenderProxy.BillboardsPoolWrite.Allocate();
            if (billboard != null)
            {
                MyTransparentGeometry.StartParticleProfilingBlock("item.Value.Draw");
                billboard.BlendType = MyBillboard.BlenType.Standard;

                if (particle.Draw(billboard) == true)
                {
                    billboard.CustomViewProjection = -1;
                }
                else
                {
                    billboard = null;
                }

                MyTransparentGeometry.EndParticleProfilingBlock();
            }

            return(billboard);
        }
        public static VRageRender.MyBillboard AddBillboardParticle(MyAnimatedParticle particle, VRageRender.MyBillboard effectBillboard, bool sort)
        {
            //MyBillboard billboard = m_preallocatedParticleBillboards.Allocate();
            //VRageRender.MyBillboard billboard = new VRageRender.MyBillboard();
            VRageRender.MyBillboard billboard = VRageRender.MyRenderProxy.BillboardsPoolWrite.Allocate();
            if (billboard != null)
            {
                MyTransparentGeometry.StartParticleProfilingBlock("item.Value.Draw");
                if (particle.Draw(billboard) == true)
                {
                    if (!sort)
                        effectBillboard.ContainedBillboards.Add(billboard);

                    billboard.CustomViewProjection = -1;
                }
                else
                    billboard = null;

                MyTransparentGeometry.EndParticleProfilingBlock();
            }

            return billboard;
        }