Example #1
0
        public static void PathTracerBoxCool(Camera camera, Scene scene)
        {
            AddSkybox(scene);
            AddFloor(scene);
            camera.Update(new Vector3(-0.01214953f, 1.140012f, 2.391021f), new Vector3(-0.007645808f, 1.0049f, 1.400201f));

            var debugLight = new PointLight(new Vector3(0, 1f, -0.5f), Color4.White, 2);
            scene.Add(debugLight);
            scene.Add(new PointLight(new Vector3(5,5,5), Color4.White, 30));

            scene.Add(new SphereLight(new Vector3(0f, 1.95f, 0), 0.4f, Color4.White, 4));

            //var lightWidth = 1.75f;
            //var hw = lightWidth/2;
            //scene.Add(new SurfaceLight(
            //    new Vector3(-hw, 1.99f, hw),
            //    new Vector3(-hw, 1.99f,-hw),
            //    new Vector3(hw, 1.99f, -hw),
            //    new Vector3(hw, 1.99f,  hw),
            //    Color4.White
            //    ));

            var diffuse = new Material(MaterialType.Diffuse);
            scene.Add(Sphere.CreateOnGround(new Vector3(-0.5f, 0, 0), 0.3f, diffuse.WithColor(Color4.Green)));
            //_scene.Add(Sphere.CreateOnGround(new Vector3(-0.5f, 0, 0), 0.3f, new Material(MaterialType.Light)));
            scene.Add(Sphere.CreateOnGround(new Vector3(0.4f, 0, 0.6f), 0.2f, Material.Metal));
            scene.Add(Sphere.CreateOnGround(new Vector3(0.5f, 0, -0.4f), 0.4f, Material.Glass));

            var wallMat = new Material(MaterialType.Diffuse) { Color = new Color3(0.7f, 0.7f, 0.7f)};
            //top
            scene.Add(new Quad(
                new Vector3(-1, 2, -4),
                new Vector3(1, 2, -4),
                new Vector3(1, 2,  4),
                new Vector3(-1, 2, 4),
                 wallMat
                ));

            //bottom
            scene.Add(new Quad(
                new Vector3(-1, 0, -4),
                new Vector3(-1, 0, 4),
                new Vector3(1, 0, 4),
                new Vector3(1, 0, -4),
                 wallMat
                ));

            //left
            scene.Add(new Quad(
                new Vector3(-1, 0, -4),
                new Vector3(-1, 2, -4),
                new Vector3(-1, 2, 4),
                new Vector3(-1, 0, 4),
                 wallMat
                ));

            //right
            scene.Add(new Quad(
                new Vector3(1, 0, -4),
                new Vector3(1, 0, 4),
                new Vector3(1, 2, 4),
                new Vector3(1, 2, -4),
                 wallMat
                ));

            //back
            //scene.Add(new Quad(
            //    new Vector3(-1, 0, -1),
            //    new Vector3(1, 0, -1),
            //    new Vector3(1, 2, -1),
            //    new Vector3(-1, 2, -1),
            //     wallMat
            //    ));

            ////front
            //scene.Add(new Quad(
            //    new Vector3(-1, 0, 4),
            //    new Vector3(-1, 2, 4),
            //    new Vector3(1, 2, 4),
            //    new Vector3(1, 0, 4),
            //     wallMat
            //    ));
        }
Example #2
0
 public DebugSphere(PointLight light, float radius, Material material)
     : base(light.Position, radius, material)
 {
     _light = light;
 }
Example #3
0
File: Scene.cs Project: tincann/AGR
 public void Add(PointLight pointLight)
 {
     PointLights.Add(pointLight);
 }