Пример #1
0
        public warp_RenderPipeline(warp_Scene scene, int w, int h)
        {
            this.scene = scene;

            screen     = new warp_Screen(w, h);
            zBuffer    = new int[screen.width * screen.height];
            rasterizer = new warp_Rasterizer(this);
        }
Пример #2
0
        public warp_FXLensFlare(String name, warp_Scene scene, bool zBufferSensitive) : base(scene)
        {
            this.zBufferSensitive = zBufferSensitive;

            flareObject = new warp_Object();
            flareObject.addVertex(new warp_Vertex(1f, 1f, 1f));
            flareObject.rebuild();

            scene.addObject(name, flareObject);
        }
Пример #3
0
        public warp_Lightmap(warp_Scene scene)
        {
            scene.rebuild();

            light   = scene.light;
            lights  = scene.lights;
            ambient = scene.environment.ambient;

            buildSphereMap();
            rebuildLightmap();
        }
Пример #4
0
        public void destroy()
        {
            name         = null;
            material     = null;
            matrix       = null;
            normalmatrix = null;
            parent       = null;

            fastvertex   = null;
            fasttriangle = null;
            vertexData.Clear();
            triangleData.Clear();
            vertexData   = null;
            triangleData = null;
        }
Пример #5
0
        public bool CreateScene(int width, int height)
        {
            try
            {
                _scene = new warp_Scene(width, height);
                _plugins.Clear();
                _models.Clear();
            }
            catch (Exception)
            {
                Reset();
                return(false);
            }

            return(true);
        }
Пример #6
0
        public void DisplayDefaultScene()
        {
            _scene = new warp_Scene(512, 512);

            warp_Material crystal = new warp_Material(warp_TextureFactory.MARBLE(128, 128, .15f));

            _scene.addMaterial("crystal", crystal);

            warp_Material c = (warp_Material)_scene.materialData["crystal"];

            c.setReflectivity(255);
            c.setTransparency(100);

            _scene.environment.setBackground(warp_TextureFactory.CHECKERBOARD(128, 128, 3, 0x000000, 0x999999));

            _scene.addLight("light1", new warp_Light(new warp_Vector(0.2f, 0.2f, 1f), 0xFFFFFF, 320, 80));
            _scene.addLight("light2", new warp_Light(new warp_Vector(-1f, -1f, 1f), 0xffffff, 100, 40));

            warp_Vector[] path = new warp_Vector[15];

            path[0]  = new warp_Vector(0.0f, 0.2f, 0);
            path[1]  = new warp_Vector(0.13f, 0.25f, 0);
            path[2]  = new warp_Vector(0.33f, 0.3f, 0);
            path[3]  = new warp_Vector(0.43f, 0.6f, 0);
            path[4]  = new warp_Vector(0.48f, 0.9f, 0);
            path[5]  = new warp_Vector(0.5f, 0.9f, 0);
            path[6]  = new warp_Vector(0.45f, 0.6f, 0);
            path[7]  = new warp_Vector(0.35f, 0.3f, 0);
            path[8]  = new warp_Vector(0.25f, 0.2f, 0);
            path[9]  = new warp_Vector(0.1f, 0.15f, 0);
            path[10] = new warp_Vector(0.1f, 0.0f, 0);
            path[11] = new warp_Vector(0.1f, -0.5f, 0);
            path[12] = new warp_Vector(0.35f, -0.55f, 0);
            path[13] = new warp_Vector(0.4f, -0.6f, 0);
            path[14] = new warp_Vector(0.0f, -0.6f, 0);

            _scene.addObject("wineglass", warp_ObjectFactory.ROTATIONOBJECT(path, 32));
            _scene.sceneobject("wineglass").setMaterial(_scene.material("crystal"));

            _scene.sceneobject("wineglass").scale(0.8f, 0.8f, 0.8f);
            _scene.sceneobject("wineglass").rotate(0.5f, 0f, 0f);

            _scene.render();

            //Refresh();
        }
Пример #7
0
 public void Reset()
 {
     _scene = null;
     _plugins.Clear();
     _models.Clear();
 }
Пример #8
0
 public void Reset()
 {
     _scene = null;
     System.GC.Collect();
 }
Пример #9
0
 public warp_FXPlugin(warp_Scene scene)
 {
     this.scene = scene;
     screen     = scene.renderPipeline.screen;
 }
Пример #10
0
 private warp_FXLensFlare(warp_Scene scene) : base(scene)
 {
 }