Esempio n. 1
0
        public SystemRenderer(ICamera camera, GameDataManager data, ResourceManager rescache, Game game)
        {
            this.camera      = camera;
            AsteroidFields   = new List <AsteroidFieldRenderer>();
            Nebulae          = new List <NebulaRenderer>();
            StarSphereModels = new IDrawable[0];
            Polyline         = new PolylineRender(commands);
            cache            = rescache;
            rstate           = cache.Game.RenderState;
            this.game        = game;
            gconfig          = game.GetService <GameConfig>();
            billboards       = game.GetService <Billboards>();
            resman           = game.GetService <ResourceManager>();
            nebulae          = game.GetService <NebulaVertices>();
            dot           = (Texture2D)rescache.FindTexture(ResourceManager.WhiteTextureName);
            DebugRenderer = new PhysicsDebugRenderer();

            if (GLExtensions.Features430)
            {
                pointLightBuffer = new ShaderStorageBuffer(MAX_POINTS * (16 * sizeof(float)));
                if (pointLightCull == null)
                {
                    pointLightCull = new ComputeShader(Resources.LoadString("LibreLancer.Shaders.lightingcull.glcompute"));
                }
            }
        }
Esempio n. 2
0
        public SystemRenderer(ICamera camera, LegacyGameData data, ResourceManager rescache, FreelancerGame game)
        {
            this.camera      = camera;
            World            = Matrix4.Identity;
            Objects          = new List <ObjectRenderer>();
            AsteroidFields   = new List <AsteroidFieldRenderer>();
            Nebulae          = new List <NebulaRenderer>();
            StarSphereModels = new IDrawable[0];
            Polyline         = new PolylineRender(commands);
            cache            = rescache;
            rstate           = cache.Game.RenderState;
            this.game        = game;
            dot           = (Texture2D)rescache.FindTexture(ResourceManager.WhiteTextureName);
            DebugRenderer = new PhysicsDebugRenderer();

            if (GLExtensions.Features430)
            {
                pointLightBuffer = new ShaderStorageBuffer(MAX_POINTS * (16 * sizeof(float)));
                if (pointLightCull != null)
                {
                    pointLightCull = new ComputeShader(Resources.LoadString("LibreLancer.Shaders.lightingcull.glcompute"));
                }
            }
        }