Browsing Tag

store

Tonemapping

Give your games a professional look with tonemapping algorithms (HDR to LDR transformation) used in the film industry (ACES, Filmic, …) and AAA videogames (Uncharted 2, Watch Dogs, …).

DEMO UNITY Continue Reading…

True Weather

True Weather‘ gives you information about the weather conditions and the geolocation of the users of your games.

DEMO UNITY ITCH.IO

Setting.

In order to start using ‘True Weather‘ the first thing you should do is create a new object in your scene and add the component ‘TrueWeather‘. There should be only one instance of that component.

Once added, you will see something like this in the editor:

In ‘Units‘ (1) you can change the metric system in which the units will be.

If ‘Try GPS first‘ (2) is activated, the geolocation service will first attempt to use the GPS hardware of the device. This is usually only available on mobile devices and the application will need permissions to use it. If this option is used and to save battery, the configuration is used with less precision (~ 500 meters) and is only active during detection.

If this option is not activated, or is not available, the web service provided by ipap.co. This service does not require registration for less than 1000 consultations per day. We recommend you register and look his payment service when your game is public. When you register, they will give you a key that you must put in ‘API Key‘ (3).

To obtain the meteorological data, the web service provided by openweathermap.com will be used. This service does require you to register, even for your free service. You must register for the ‘Current weather data‘ service in the API section:

With the free service you can make up to 60 queries every hour. When you register, they will give you a key that you must put in ‘API Key‘ (4).

Are you interested in using another similar service? Do not hesitate to contact us.

Use.

All code is inside the namespace ‘Ibuprogames.TrueWeatherAsset‘ and main component is ‘TrueWeather‘. So if you want to use it you must first import its namespace:

using Ibuprogames.TrueWeatherAsset;

If you already created an object with the ‘TrueWeather‘ component, to access it:

TrueWeather trueWeather = FindObjectOfType<TrueWeather>();

To detect the current time you will first have to call the function ‘Detect()‘. As this information may take some time to be available, you can pass an Action as a parameter to know when it is ready. For example, if you want that when the information is available, your ‘ShowWeatherInfo()‘ function is called:

trueWeather.Detect((success, errorMsg) =>
{
  if (success == true)
    ShowWeatherInfo();
  else
    Debug.LogError($"Error: {errorMsg}");
});

Once the ‘Detect()‘ function returns you successfully, you can check the information using the properties ‘Location‘ (geolocation) and ‘Weather‘ (meteorological information):

float latitude = trueWeather.Location.Latitude;
float longitude = trueWeather.Location.Longitude;

string description = trueWeather.Weather.Description;
float temperature = trueWeather.Weather.Temperature;
float pressure = trueWeather.Weather.Presure;
float humifity = trueWeather.Weather.Humidity;
DateTime sunrise = trueWeather.Weather.Sunrise;
DateTime sunset = trueWeather.Weather.Sunset;

All this information will be available until the next time you call ‘Detect()‘.

Optionally, and if you have used the ipap.co service (not the device GPS), you can access the extra information provided by this service:

if (trueWeather.Location is IPAPILocation)
{
  IPAPILocation ipAPILocation = (IPAPILocation)trueWeather.Location;

  string ip = ipAPILocation.IPAdress;
  string country = ipAPILocation.Country;
  string region = ipAPILocation.Region;
  string city = ipAPILocation.City;
}

All the code are well commented, I recommend reading the code if you want more information.

Any questions or suggestions you have, we will be happy to answer you in our mail:

Rain

Rain‘ simulates the raindrops on the screen. You can also simulate liquids such as blood, oil, etc.

DEMO UNITY ITCH.IO

Editor.

Once installed, select the camera of the scene and add the component ‘Rain‘.

When you add it you will see something like:

With ‘Strength‘ (1) you can select the strength of the effect.

Within ‘Droplets’ you can configure some parameters of the drops on the screen:

2. Rain amount [0, 1]. Default 0.5.
3. Droplet size [0.1, 2]. Default 1.
4. Droplet speed [0.0, …]. Default 0.25.
5. Droplet distortion [0, 1]. Default 0.5.

In ‘Layers’ you can configure the three layers that have the effect:


6. Intensity of the layer of drops that do not move [0, 1]. Default 1.
7. Intensity of the first layer of drops move [0, 1]. Default 1.
8. Intensity of the second layer of drops move faster [0, 1]. Default 1.

Activate ‘Color’ (9) to modify the following color parameters:


10. Screen ambient color. Alpha controls the intensity.
11. Droplets color blend operation. Default ‘Solid’.
12. Droplet color.
13. Enable droplet trails.

Finally by clicking on ‘[doc]’ (14) opens the online documentation, and clicking on ‘Reset’ (15) reset to defaults values.

Code.

All code is inside the namespace ‘Ibuprogames.RainAsset‘ and main component is ‘Rain‘. So if you want to use it you must first import its namespace:

using Ibuprogames.RainAsset;

If ‘myCamera‘ is a valid camera and you want to add the effect, you should do something like:

Rain rain = mycamera.gameObject.AddComponent<Rain>();

All the code are well commented, I recommend reading the code if you want more information.

Any questions or suggestions you have, we will be happy to answer you in our mail:

Tilt Shift

Tilt Shift makes the scene seem much smaller than it actually is, simulating the shallow depth of field normally encountered in close-up photography. The effect is especially noticeable in relatively flat scenes.

DEMO  UNITY ITCH.IO

Continue Reading…