Unity插件--UniSky

http://www.sixtimesnothing.com/unisky

      UniSky is a jaw-droppingly powerful procedural sky, weather, and atmospheric visual effects system for Unity 3. Create gorgeous, AAA-quality living skies in just moments with this popular and powerful tool. UniSky was developed by Six Times Nothing's Lead Technical Artist, Chris Morris.

     

UniSky 1.2.7 Features

  • 24 hour day/night cycle with sun, moon and stars
  • Atmospheric scattering for realistic sky colors at any time of day
  • Dynamic directional light color and positioning for the sun and moon
  • Procedural 2D cloud animation with dynamic 3D lighting and shading
  • Parameterized cloud cover, precipitation level, atmospheric scattering, glow, wind direction/speed and colors
  • Highly optimised and runs almost entirely on the GPU
  • Completely scriptable with an extensive API giving you control over every parameter

 

使用步骤:

(1)将主摄像机的"Clear Flags" 设置为 "Solid Color",背景颜色调成黑色,"Far Clipping Plane"调到100000;

(2)将插件自带的"UniSkyAPI" prefab拖入场景;

(3)将主摄像机赋给UniSkyAPI GUI的"General" 的Scene Camera;如下图:

(4)新建一个脚本,通过脚本初始化UniSky的API,并控制各参数;

脚本很简单:

public class ExampleScript : MonoBehaviour {
    
    // create an instance of the API
    private UniSkyAPI uniSky;
    
    void Awake() {
        // define the instance
        uniSky = GameObject.Find("UniSkyAPI").GetComponent("UniSkyAPI") as UniSkyAPI;
        
        // instantiate 
        uniSky.InstantiateUniSky();
    }
    
    void Update() {
        // set up a 24-hour cycle with a framerate dependent speed of 1.0
        uniSky.SetTime(uniSky.GetTime() + Time.deltaTime * 1.0f);
    }
}
void Awake() {
		
		// Define instance
		uniSky = GameObject.Find("UniSkyAPI").GetComponent("UniSkyAPI") as UniSkyAPI;
		
		// Initiate and create default UniSky 
		uniSky.InstantiateUniSky();
		
		// Set some initial states 
		uniSky.SetTime(12.0f);
		uniSky.SetAmbientLighting(new Color(0.1f, 0.1f, 0.1f, 0.1f));
		uniSky.SetStormCenter(new Vector3(0,0,0));
		uniSky.SetSunShadows(LightShadows.Soft);
		
		// Functions to interpolate parameters over time
		
		/*uniSky.LerpCloudCover(0.5f, 5000.0f);
		uniSky.LerpPrecipitationLevel(0.6f, 5000.0f);
		uniSky.LerpStormCloudCover(-1.0f, 10000.0f);
		uniSky.LerpRainLevel(100, 0.2f, 10000.0f);
		uniSky.LerpStormLevel(150, 0.4f, 20000.0f);
		uniSky.LerpSunIntensity(0.2f, 10000.0f);
		uniSky.LerpFogLevel(0.02f, 20000.0f);
		uniSky.LerpAmbientLighting(new Color(0.0f, 0.0f, 0.0f, 0.0f), 5000);
		uniSky.ClearDropletBuffer();
		uniSky.LerpDropletLevel(10, 20000.0f);*/
		
	}

 (5)运行就可以看到效果了;想要效果跟想象的一样好,就需要不断的调节UniSkyAPI GUI界面参数了~,编写程序代码也可以实现。

下载地址:UniSky

http://blog.csdn.net/tanmengwen/article/details/8236873

你可能感兴趣的:(Unity,3D)