Ejemplo n.º 1
0
        public void Startup(FearEngineImpl engine)
        {
            rotatingLight = engine.GameObjectFactory.CreateGameObject("RotatingLightFixture");
            rotatingLight.AddUpdatable(engine.UpdateableFactory.CreateContinuousRandomSlerp(rotatingLight.Transform, 0.25f));

            Light             light    = engine.LightFactory.CreateDirectionalLight();
            TransformAttacher attacher = (TransformAttacher)light;

            attacher.AttactToTransform(rotatingLight.Transform);

            cam   = engine.GameObjectFactory.CreateGameObject("Camera");
            scene = engine.SceneFactory.CreateSceneWithSingleLight(engine.CameraFactory.CreateDebugCamera(cam), light);

            GameObject  teapot         = engine.GameObjectFactory.CreateGameObject("Teapot");
            Mesh        mesh           = engine.Resources.GetMesh("TEAPOT");
            Material    material       = engine.Resources.GetMaterial("ShadowedPBR");
            SceneObject shadowedTeapot = new SceneObject(teapot, mesh, material);

            scene.AddSceneObject(shadowedTeapot);

            GameObject planeObj = engine.GameObjectFactory.CreateGameObject("Plane");

            planeObj.Transform.SetScale(3.0f);
            Mesh        plane         = engine.Resources.GetMesh("PLANE");
            SceneObject shadowedPlane = new SceneObject(planeObj, plane, material);

            scene.AddSceneObject(shadowedPlane);

            scene.EnableShadows();
        }
Ejemplo n.º 2
0
        public void Startup(FearEngineImpl engine)
        {
            Light light = engine.LightFactory.CreateDirectionalLight();

            cam   = engine.GameObjectFactory.CreateGameObject("Camera");
            scene = engine.SceneFactory.CreateSceneWithSingleLight(engine.CameraFactory.CreateDebugCamera(cam), light);

            Material material = engine.Resources.GetMaterial("IBLTest");

            int   numOfSpheres                 = 10;
            float radiusOfSphere               = 1.0f;
            float bufferBetweenSpheres         = 0.2f;
            float distanceBetweenSphereCenters = (radiusOfSphere * 2.0f) + bufferBetweenSpheres;
            float sphereXCoord                 = -((float)numOfSpheres / 2.0f) * distanceBetweenSphereCenters;
            float sphereYCoord                 = radiusOfSphere + bufferBetweenSpheres;

            for (int i = 0; i < numOfSpheres; i++)
            {
                GameObject sphere = engine.GameObjectFactory.CreateGameObject("Sphere" + i);
                Mesh       mesh   = engine.Resources.GetMesh("Sphere");

                sphere.Transform.MoveTo(new Vector3(sphereXCoord, sphereYCoord, 0.0f));
                sphereXCoord += distanceBetweenSphereCenters;

                SceneObject sphereSceneObject = new SceneObject(sphere, mesh, material);
                scene.AddSceneObject(sphereSceneObject);
            }

            scene.EnableShadows();
        }
Ejemplo n.º 3
0
        public void Startup(FearEngineImpl engine)
        {
            cam = engine.GameObjectFactory.CreateGameObject("Camera");

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                engine.LightFactory.CreateDirectionalLight());

            float seperation = 6.0f;

            teapotPhong = new BaseGameObject("TeapotPhong");
            teapotPhong.Transform.MoveTo(teapotPhong.Transform.Position + (teapotPhong.Transform.Right * seperation));
            teapotPhong.AddUpdatable(new ContinuousRotationAroundY(teapotPhong.Transform));

            teapotPBR = new BaseGameObject("TeapotPBR");
            teapotPBR.Transform.MoveTo(teapotPhong.Transform.Position + (-teapotPhong.Transform.Right * seperation));
            teapotPBR.AddUpdatable(new ContinuousRotationAroundY(teapotPBR.Transform));

            Mesh mesh = engine.Resources.GetMesh("TEAPOT");

            Material phong = engine.Resources.GetMaterial("NormalLit");
            Material pbr   = engine.Resources.GetMaterial("PBR_GGX");

            SceneObject phongTeapot = new SceneObject(teapotPhong, mesh, phong);
            SceneObject pbrTeapot   = new SceneObject(teapotPBR, mesh, pbr);

            scene.AddSceneObject(phongTeapot);
            scene.AddSceneObject(pbrTeapot);
        }
Ejemplo n.º 4
0
        public void Startup(FearEngineImpl engine)
        {
            cam    = engine.GameObjectFactory.CreateGameObject("Camera");
            device = engine.Device;

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                engine.LightFactory.CreateDirectionalLight());

            GameObject cube     = new BaseGameObject("Cube");
            Mesh       mesh     = engine.Resources.GetMesh("BOX");
            Material   material = engine.Resources.GetMaterial("NormalLit");

            SceneObject litCube = new SceneObject(cube, mesh, material);

            scene.AddSceneObject(litCube);
        }
Ejemplo n.º 5
0
        public void Startup(FearEngineImpl engine)
        {
            cam = engine.GameObjectFactory.CreateGameObject("Camera");

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                new DirectionalLight());

            teapot = new BaseGameObject("Teapot");
            teapot.AddUpdatable(new ContinuousRotationAroundY(teapot.Transform));

            Mesh     mesh     = engine.Resources.GetMesh("TEAPOT");
            Material material = engine.Resources.GetMaterial("NormalLit");

            SceneObject litTeapot = new SceneObject(teapot, mesh, material);

            scene.AddSceneObject(litTeapot);
        }
Ejemplo n.º 6
0
        public void Startup(FearEngineImpl engine)
        {
            cam = engine.GameObjectFactory.CreateGameObject("Camera");

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                engine.LightFactory.CreateDirectionalLight());

            GameObject cube     = new BaseGameObject("Cube");
            Mesh       mesh     = engine.Resources.GetMesh("BOX");
            Material   material = engine.Resources.GetMaterial("Textured");

            material.SetParameterResource("gAlbedo", engine.Resources.GetTexture("GammaGradient"));

            SceneObject litCube = new SceneObject(cube, mesh, material);

            scene.AddSceneObject(litCube);
        }
Ejemplo n.º 7
0
        public void Startup(FearEngineImpl engine)
        {
            cam = engine.GameObjectFactory.CreateGameObject("Camera");

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                engine.LightFactory.CreateDirectionalLight());

            GameObject teapot   = new BaseGameObject("FloorPlane");
            Mesh       mesh     = engine.Resources.GetMesh("PLANE");
            Material   material = engine.Resources.GetMaterial("NormalMapped");

            material.SetParameterResource("gAlbedo", engine.Resources.GetTexture("GravelCobble"));
            material.SetParameterResource("gNormal", engine.Resources.GetTexture("GravelCobbleNormal"));

            //drawNormalsMaterial = fearEngine.Resources.GetMaterial("DrawNormals");

            SceneObject litCube = new SceneObject(teapot, mesh, material);

            scene.AddSceneObject(litCube);
        }
Ejemplo n.º 8
0
        public void Startup(FearEngineImpl engine)
        {
            cam    = engine.GameObjectFactory.CreateGameObject("Camera");
            device = engine.Device;

            scene = engine.SceneFactory.CreateSceneWithSingleLight(
                engine.CameraFactory.CreateDebugCamera(cam),
                engine.LightFactory.CreateDirectionalLight());

            GameObject cube     = new BaseGameObject("Cube");
            Mesh       mesh     = engine.Resources.GetMesh("BOX");
            Material   material = engine.Resources.GetMaterial("NormalLit");

            SceneObject litCube = new SceneObject(cube, mesh, material);

            scene.AddSceneObject(litCube);

            FearGraphicsDevice dev2          = new SharpDXGraphicsDevice(engine.Device);
            Material           computeShader = LoadComputeShader(dev2);

            irrCubeGen = new IrradianceCubeMapGenerator(dev2, computeShader);
            source     = LoadOriginalCubemap(dev2);
        }
Ejemplo n.º 9
0
 public void Startup(FearEngine.FearEngineImpl engine)
 {
     fearEngine = engine;
 }