Пример #1
0
 public Renderer(int width, int height)
 {
     _width            = width;
     _height           = height;
     _faceDrawer       = new FaceDrawer(width, height);
     _firstPhaseScreen = new WritableTexture(new Bitmap(width, height, PixelFormat.Format32bppRgb), true);
 }
Пример #2
0
        private static void Draw(WritableTexture screen, Func <Shader> shaderFactory, FaceDrawer faceDrawer, int startY, int endY, World world)
        {
            var shaderState = new ShaderState(30, world);
            var shader      = shaderFactory();

            shader.World(world);

            for (var i = 0; i < world.WorldObject.Model.Geometry.Faces.Count; i++)
            {
                faceDrawer.Draw(i, screen, shader, shaderState, startY, endY);
            }
        }