Exemple #1
0
        private void SpawnBVHMapReflection()
        {
            //Directional light
            Light light = new Light(LightType.Point, new Vector3(0.7f, 0.7f, 0.7f), 20.0f, new Vector3(0.0f, 0.5f, 5.0f), 0.5f);

            //Light light = new Light(LightType.Directional, new Vector3(1.0f, 1.0f, 1.0f), 2.4f, null, null, new Vector3(1.0f, 0.8f, 1.0f));
            lights.Add(light);

            Material material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));
            Vector3  position = new Vector3(-2.5f, 0.5f, 5.0f);
            float    scale    = 0.75f;

            AddSphereFigure(5, material, position, scale);

            Material material2 = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));
            Vector3  position2 = new Vector3(2.5f, 0.5f, 5.0f);
            float    scale2    = 0.75f;

            AddSphereFigure(5, material2, position2, scale2);

            Material material3 = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));
            Vector3  position3 = new Vector3(0.0f, -1.675f, 5.0f);
            float    scale3    = 0.5f;

            AddSphereFigure(4, material3, position3, scale3);

            //new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));
        }
Exemple #2
0
        private void SpawnMap4()
        {
            //Skybox
            skybox = new Skybox(scene);

            //Directional light
            Light light = new Light(LightType.Directional, new Vector3(1.0f, 1.0f, 1.0f), 2.4f, null, null, new Vector3(1.0f, 0.8f, 1.0f));

            lights.Add(light);

            Mesh plane = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, -2.5f, 8.0f), new Vector3(10.0f), "Floor");

            meshes.Add(plane);
            Material planeMaterial = new ReflectionMaterial(TextureType.Checkerboard, 0.9f, new Vector3(0, 1, 0));

            materials.Add(planeMaterial);
            skybox = null;

            Mesh sphere1 = new Sphere(new Vector3(-4.0f, 1.5f, 6.0f), 1.0f, "Sphere1");

            meshes.Add(sphere1);
            Material sphere1Material = new RefractionMaterial(TextureType.Color, 1.02f, 0.98f);

            materials.Add(sphere1Material);

            Mesh sphere2 = new Sphere(new Vector3(1.0f, -2.0f, 9.0f), 2.0f, "Sphere2");

            meshes.Add(sphere2);
            Material sphere2Material = new TransparentMaterial(TextureType.Color, 0.8f, new Vector3(0.8f, 0.2f, 0.2f));

            materials.Add(sphere2Material);

            Mesh sphere3 = new Sphere(new Vector3(-2.0f, 1.0f, 11.0f), 1.5f, "Sphere3");

            meshes.Add(sphere3);
            Material sphere3Material = new ReflectionMaterial(TextureType.Color, 0.98f);

            materials.Add(sphere3Material);

            Mesh sphere4 = new Sphere(new Vector3(3.0f, 1.2f, 6.0f), 1.5f, "Sphere4");

            meshes.Add(sphere4);
            Material sphere4Material = new DiffuseMaterial(TextureType.Color, new Vector3(0.25f, 0.25f, 0.75f));

            materials.Add(sphere4Material);

            Mesh sphere5 = new Sphere(new Vector3(1.0f, 1.5f, 11.0f), 1.0f, "Sphere5");

            meshes.Add(sphere5);
            Material sphere5Material = new DiffuseMaterial(TextureType.Texture, "../../Assets/Textures/test.png");

            materials.Add(sphere5Material);

            Mesh sphere6 = new Sphere(new Vector3(-1.0f, 2.0f, 5.0f), 0.5f, "Sphere6");

            meshes.Add(sphere6);
            Material sphere6Material = new ReflectionRefractionMaterial(TextureType.Color, 1.5f, 0.98f);

            materials.Add(sphere6Material);
        }
Exemple #3
0
        private void SpawnMap1()
        {
            //Skybox
            skybox = new Skybox(scene);

            //Directional light
            Light light = new Light(LightType.Directional, new Vector3(1.0f, 1.0f, 1.0f), 2.4f, null, null, new Vector3(1.0f, 0.8f, 1.0f));

            lights.Add(light);

            Mesh sphere1 = new Sphere(new Vector3(-4.0f, 1.5f, 6.0f), 1.0f, "Sphere1");

            meshes.Add(sphere1);
            Material sphere1Material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));

            materials.Add(sphere1Material);

            Mesh sphere2 = new Sphere(new Vector3(1.0f, -2.0f, 9.0f), 2.0f, "Sphere2");

            meshes.Add(sphere2);
            Material sphere2Material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));

            materials.Add(sphere2Material);

            Mesh sphere3 = new Sphere(new Vector3(-2.0f, 1.0f, 11.0f), 1.5f, "Sphere3");

            meshes.Add(sphere3);
            Material sphere3Material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));

            materials.Add(sphere3Material);

            Mesh sphere5 = new Sphere(new Vector3(-3.0f, 1.0f, 20.0f), 1.0f, "Sphere5");

            meshes.Add(sphere5);
            Material sphere5Material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));

            materials.Add(sphere5Material);

            Mesh sphere4 = new Sphere(new Vector3(3.0f, 1.2f, 6.0f), 1.5f, "Sphere4");

            meshes.Add(sphere4);
            Material sphere4Material = new ReflectionMaterial(TextureType.Color, 0.8f, new Vector3(0.8f));

            materials.Add(sphere4Material);
        }
Exemple #4
0
        private void SpawnMap2()
        {
            skybox = null;

            //Spot light
            Light light = new Light(LightType.Spot, new Vector3(0.9f, 0.8f, 0.3f), 1.5f, new Vector3(5.0f, -5.0f, 7.0f), 6.0f, null, new Vector3(2.0f, -1.0f, 8.0f));

            lights.Add(light);

            //Floor
            Mesh plane = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Floor");

            meshes.Add(plane);
            Material planeMaterial = new DiffuseMaterial(TextureType.Checkerboard);             //new Vector3(0.75f, 0.25f, 0.25f));

            materials.Add(planeMaterial);

            Mesh sphere1 = new Sphere(new Vector3(-4.0f, 1.0f, 6.0f), 1.0f, "Sphere1");

            meshes.Add(sphere1);
            Material sphere1Material = new ReflectionMaterial(TextureType.Color, 0.75f, new Vector3(0.1f, 1.0f, 0.1f));

            materials.Add(sphere1Material);

            Mesh sphere2 = new Sphere(new Vector3(-2.0f, 0.5f, 11.0f), 1.5f, "Sphere2");

            meshes.Add(sphere2);
            Material sphere2Material = new ReflectionMaterial(TextureType.Color, 0.75f, new Vector3(0.1f, 0.1f, 1.0f));

            materials.Add(sphere2Material);

            Mesh sphere3 = new Sphere(new Vector3(3.0f, 0.5f, 6.0f), 1.5f, "Sphere3");

            meshes.Add(sphere3);
            Material sphere3Material = new ReflectionMaterial(TextureType.Color, 0.75f, new Vector3(1.0f, 0.1f, 0.1f));

            materials.Add(sphere3Material);
        }
Exemple #5
0
        private void SpawnMap6()
        {
            skybox = null;

            //Point light
            Light light = new Light(LightType.Point, new Vector3(0.7f, 0.7f, 0.7f), 20.0f, new Vector3(0.0f, -1.45f, 2.0f), 0.5f);             //new Vector3(0.0f, -0.1f, 2.0f) //-1.45f

            lights.Add(light);

            //Floor
            Mesh floor = new Plane(new Vector3(0.0f, -1.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Floor");

            meshes.Add(floor);
            Material planeMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(planeMaterial);

            //Roof
            Mesh roof = new Plane(new Vector3(0.0f, 1.0f, 0.0f), new Vector3(0.0f, -1.5f, 0.0f), null, "Roof");

            meshes.Add(roof);
            Material roofMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(roofMaterial);

            //Left wall
            Mesh leftWall = new Plane(new Vector3(1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Left Wall");

            meshes.Add(leftWall);
            Material leftWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.25f, 0.25f));

            materials.Add(leftWallMaterial);

            //Right wall
            Mesh rightWall = new Plane(new Vector3(-1.0f, 0.0f, 0.0f), new Vector3(0.0f, -2.0f, 0.0f), null, "Right Wall");

            meshes.Add(rightWall);
            Material rightWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.25f, 0.25f, 0.75f));

            materials.Add(rightWallMaterial);

            //Front wall
            Mesh frontWall = new Plane(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(0.0f, -4.2f, 0.0f), null, "Front Wall");

            meshes.Add(frontWall);
            Material frontWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(frontWallMaterial);

            //Back wall
            Mesh backWall = new Plane(new Vector3(0.0f, 0.0f, 1.0f), new Vector3(0.0f, -5.0f, 0.0f), null, "Back Wall");

            meshes.Add(backWall);
            Material backWallMaterial = new DiffuseMaterial(TextureType.Color, new Vector3(0.75f, 0.75f, 0.75f));

            materials.Add(backWallMaterial);

            //Mirror ball
            Mesh sphere1 = new Sphere(new Vector3(-0.9f, 1.35f, 3.0f), 0.65f, "Mirror Ball");

            meshes.Add(sphere1);
            Material sphere1Material = new ReflectionMaterial(TextureType.Color, 1.0f);

            materials.Add(sphere1Material);

            //Glass ball
            Mesh sphere2 = new Sphere(new Vector3(1.0f, 1.35f, 2.25f), 0.65f, "Glass Ball");

            meshes.Add(sphere2);
            Material sphere2Material = new ReflectionRefractionMaterial(TextureType.Color, 1.5f);

            materials.Add(sphere2Material);
        }