示例#1
0
        public SLaserManager(SSScene beamScene3d, SSScene occDiskScene, SSScene flareScene2d,
            int sprite2dCapacity = 1000, int laserBurnParticlesCapacity = 2000)
        {
            _beamScene3d = beamScene3d;
            _occDiskScene = occDiskScene;
            _flareScene2d = flareScene2d;

            _2dEffectInstanceData = new SInstancedSpriteData (sprite2dCapacity);
            _2dEffectRenderer = new SSInstancedSpriteRenderer (_beamScene3d, _2dEffectInstanceData);
            _2dEffectRenderer.Name = "laser manager's 2d screen effect renderer";

            _2dEffectRenderer.renderState.alphaBlendingOn = true;
            _2dEffectRenderer.renderState.blendFactorSrc = BlendingFactorSrc.SrcAlpha;
            _2dEffectRenderer.renderState.blendFactorDest = BlendingFactorDest.One;
            //_2dEffectRenderer.renderMode = SSInstancedMeshRenderer.RenderMode.GpuInstancing;
            _flareScene2d.AddObject(_2dEffectRenderer);

            _laserBurnParticles = new SLaserBurnParticlesObject (
                laserBurnParticlesCapacity, SLaserParameters.laserBurnParticlesDefaultTexture());
            _laserBurnParticles.Name = "laser manager's laser burn particle system renderer";
            //_laserBurnParticles.renderMode = SSInstancedMeshRenderer.RenderMode.GpuInstancing;
            _beamScene3d.AddObject(_laserBurnParticles);

            _beamScene3d.preRenderHooks += this._update;
        }
示例#2
0
        //public SLaserBurnParticlesObject laserBurnParticlesObject {
        //    get { return _laserBurnParticles; }
        //}
        public SLaserManager(SSScene beamScene3d, SSScene occDiskScene, SSScene flareScene2d,
            int sprite2dCapacity = 1000, int laserBurnParticlesCapacity = 500)
        {
            _beamScene3d = beamScene3d;
            _occDiskScene = occDiskScene;
            _flareScene2d = flareScene2d;

            _2dEffectInstanceData = new SInstancedSpriteData (sprite2dCapacity);
            _2dEffectRenderer = new SSInstancedSpriteRenderer (_beamScene3d, _2dEffectInstanceData);
            _2dEffectRenderer.Name = "laser manager's 2d screen effect renderer";

            _2dEffectRenderer.renderState.alphaBlendingOn = true;
            _2dEffectRenderer.renderState.blendFactorSrcRGB
                = _2dEffectRenderer.renderState.blendFactorSrcAlpha = BlendingFactorSrc.SrcAlpha;
            _2dEffectRenderer.renderState.blendFactorDestRGB
             	= _2dEffectRenderer.renderState.blendFactorDestAlpha = BlendingFactorDest.One;
            //_2dEffectRenderer.renderMode = SSInstancedMeshRenderer.RenderMode.GpuInstancing;
            _flareScene2d.AddObject(_2dEffectRenderer);

            _beamScene3d.preRenderHooks += this._update;

            _maxBurnParticlesPerObject = laserBurnParticlesCapacity;
        }
示例#3
0
 public LaserRuntimeInfo(SLaser laser, SSScene beamScene, SSScene occDiskScene, 
                         SSInstancedSpriteRenderer sprite2dRenderer)
 {
     _laser = laser;
     var numBeams = laser.parameters.numBeams;
     _beams = new BeamRuntimeInfo[numBeams];
     for (int i = 0; i < numBeams; ++i) {
         _beams[i] = new BeamRuntimeInfo(laser, i, beamScene, occDiskScene, sprite2dRenderer);
     }
 }
示例#4
0
 public BeamRuntimeInfo(SLaser laser, int beamId, 
                        SSScene beamScene, SSScene occDiskScene,
                        SSInstancedSpriteRenderer sprite2dRenderer)
 {
     _laser = laser;
     _beamId = beamId;
     _beamScene = beamScene;
     _occDiskScene = occDiskScene;
     _sprite2dRenderer = sprite2dRenderer;
 }