Ejemplo n.º 1
0
        public Material()
        {
            canHaveRefs = false;

            specularPower        = 1;
            specularIntensity    = 1;
            reflectivity         = 0;
            reflectionSmoothness = 0.5f;
            emissive             = 0;
            materialIndex        = -1;

            smoothness = 0.5f;
            metalness  = 0.5f;

            roughness             = 0.5f;
            ref_at_norm_incidence = 1.0f;

            anisotropicRoughnessX = 0.5f;
            anisotropicRoughnessY = 0.5f;

            lModel = LightingModel.BlinnPhong;

            cubeMapTextureName = null;
            cubeMapSRV         = null;

            detailMapTextureName = null;
            detailMapSRV         = null;
        }
Ejemplo n.º 2
0
        public async Task <IViewComponentResult> InvokeAsync()
        {
            var lightingModel = new LightingModel
            {
                LightControllers = _db.GetCollection <LightControllerEntity>().Query().Select(_ => new LightControllerModel {
                    Hostname = _.Hostname
                }).ToList()
            };

            return(View("Default", lightingModel));
        }
Ejemplo n.º 3
0
        public void calculate(Region region)
        {
            width = region.getWidth();
            height = region.getHeight();
            values = new int[width,height];
            calc = new double[width,height];
            lights = new List<Light>();
            lightingModel = region.getLightingModel();

            //Blank out the entire region with base light
            for(int x=0; x < width; x++)
            {
                for(int y=0; y < height; y++)
                {
                    if(TerrainManager.hasParameter(region.getTerrain(x, y), TerrainParameter.FIRE))
                    {
                        calc[x,y] = ((MAX_LIGHT / 2) * RandomNumber.RandomDouble()) + (MAX_LIGHT / 2);
                        lights.Add(new Light(x,y,calc[x,y]));
                    }
                    else
                    {
                        calc[x,y] = baseLight();
                    }
                }
            }

            //Add lights for appropriate monsters
            calculateMonsterLights();

            //Add lights for appropriate building features
            calculateBuildingFeatureLight();

            //Add lights for items
            calculateItemLights();

            //Propogate light from point sources
            foreach(Light tempLight in lights)
            {
                spreadLight(tempLight.x, tempLight.y, tempLight.intensity, baseLight());
            }

            //Cover buildings if roofs prevent lighting
            calculateBuildingCoverLight();

            //Converate raw values to graded values
            calcToValue();
        }
Ejemplo n.º 4
0
        private int width; //Width of region in tiles

        #endregion Fields

        #region Constructors

        public Region(int width , int height)
        {
            this.width = width;
            this.height = height;
            terrainField = new Terrain[width,height];
            monsters = new List<Monster>();
            items = new List<Item>();
            buildings = new List<Building>();
            lightingModel = LightingModel.ABOVE_GROUND;

            for(int x=0; x < width; x++)
            {
                for(int y=0; y < height; y++)
                {
                    terrainField[x,y] = new Terrain();
                }
            }
        }
Ejemplo n.º 5
0
 /**
  * @param lightingModel the lightingModel to set
  */
 public void setLightingModel(LightingModel lightingModel)
 {
     this.lightingModel = lightingModel;
 }
Ejemplo n.º 6
0
        public void LoadObject(StreamReader inStream)
        {
            this.width = Int32.Parse(inStream.ReadLine());
            this.height = Int32.Parse(inStream.ReadLine());
            terrainField = new Terrain[getWidth(),getHeight()];
            for(int x=0; x < getWidth(); x++)
            {
                for(int y=0; y < getHeight(); y++)
                {
                    Terrain newTerrain = new Terrain();
                    newTerrain.LoadObject(inStream);
                    terrainField[x,y] = newTerrain;
                }
            }
            getMonsters().Clear();
            int monstersSize = Int32.Parse(inStream.ReadLine());
            for(int i=0; i < monstersSize; i++)
            {
                Monster newMonster = new Monster();
                newMonster.LoadObject(inStream);

                //do not load any monster with the player ID
                if(!newMonster.ID.Equals(MonsterActionManager.PLAYER_ID))
                {
                    getMonsters().Add(newMonster);
                }
            }
            getItems().Clear();
            int itemsSize = Int32.Parse(inStream.ReadLine());
            for(int i=0; i < itemsSize; i++)
            {
                Item newItem = new Item();
                newItem.LoadObject(inStream);
                getItems().Add(newItem);
            }
            getBuildings().Clear();
            int buildSize = Int32.Parse(inStream.ReadLine());
            for(int i=0; i < buildSize; i++)
            {
                Building newBuild = new Building();
                newBuild.LoadObject(inStream);
                getBuildings().Add(newBuild);
            }
            this.lightingModel = (LightingModel)Enum.Parse(typeof(LightingModel), inStream.ReadLine());
        }
Ejemplo n.º 7
0
 // constructors
 /// <summary>Creates a new instance of this class.</summary>
 /// <param name="position">The default position of the camera.</param>
 /// <param name="orientation">The default orientation of the camera.</param>
 /// <param name="lightingModel">The lighting model used by this route.</param>
 public RouteData(Math.Vector3 position, Math.Orientation3 orientation, LightingModel lightingModel)
 {
     this.Position = position;
     this.Orientation = orientation;
     this.LightingModel = lightingModel;
 }