Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Environment Gator

Discussion in 'Assets and Asset Store' started by Karlbovsky, Jan 17, 2014.

  1. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,

    @MakeshiftWings
    Thanks to your suggestion i've found a simple but effective solution to have both. Now you can choose inside the inspector if you want ConstantDayLight or not. If you set it to false, the Sun/Day-Light will reach his max and stop till Sunset. I'm testing it right now and it seems to work fine. You were right, now the Sunset is much more "powerful"! I hope to put this inside the next update.Thx for the idea!!

    Since the EG was meant to be a UnityFree compatible asset, the way it generate the illumination is pretty simple but produces nice results in my opinion.
    DirectionalLights are used as main lights and the ambient light is used as a Rim light. Choosing the behaviours of these lights sources ( their intensity,FLARES,colors,position) during a DayNight cycle, most of the time, is enough to have a nice and dynamic global illumination. Lately i've casually inserted a pointLight at the clouds base level, so to have the classic lights-trinity, Key,Rim,Dim , and the result was awesome.
    There's also a component that is meant to reproduce GodRays , is not so powerful, sharp and AAA like the one in UnityPro, but it's a plus for UnityFree's users.
    Yes, it handles Linear or Exp fog according to ToD and weather.

    up up up ;)


    Regards,
     
  2. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Awesome, sounds great. Hadn't realised it could imitate God Rays! Even better that I thought
     
  3. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Great plugin!
    Congratulations and thank you for the low price!
     
  4. OneShotGG

    OneShotGG

    Joined:
    Nov 16, 2012
    Posts:
    225
    Liking most of the plug in so far but I am getting a few problems.

    1. flickering shadows. I can't figure out what is causing this, other atmosphere and Time of day plugins I have don't cause this problem.

    2. Sun is rising in the west and setting in the east (which is wrong). I have North in the right direction but it still goes backwards.

    3. No way to set a static time. I need to be able to set a static time and not have time progress.
     
  5. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,

    the version 1.26 has been submitted for review!
    ------------------------------------------------------------------------------------------------

    This is strange. I'll need more infos, like UnityVersion and his settings in order to start to give a look at the issue. Please send me an email with more details.

    Meanwhile try this:
    Go to the EnvironmentGator inside the Hierarchy panel.
    There’s a gameObject called Geo.

    Unfold it -->there are a couple of nested gameObject -->select the sphere from Ground and set his meshRenderer like this:

    Cast Shadow = NO
    receive shadows = NO

    Try it also on the Sky gameObject and check also other objects in your scene.

    Try to change his YRotation parameter.
    $APC - 2014.02.14 21.42 - 001.3d.jpg

    Actually this should be possible, but it's not so quick to do and to explain. I'll write a doc on how to do this during the next couple of days!

    thanks!

    Best Regards,
     
  6. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    I am quite enjoying this already. It is SO easy to use you have done tremendously well here.

    I'm using RTP ( Relief Terrain Pack ) as my terrain shaders. Together they are amazing.


    I've found that I have to refresh the RTP shaders to catch up with the fog. This in itself I think will be fine, except for the fact theres a few seconds delay.

    For my game in particular, 1 hour is one day, so to be effective, I would probably need to do this every 5 minutes. ( every 2 hours IN GAME ) or every 2.5 minutes to make it an hourly update. Do you think this would be too irritating for game play?


    I was wondering if anyone could offer any advice towards setting fog parameters to reduce the number of times it would be necessary to update the shader?
     
  7. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Hi

    Ok so my last problem finally solved. Very easy really.

    But now I have a new issue. My world is rather large, 28km x 28km. Im using the flat system instead of sphere. Skybox settings are

    $SkyBoxSettings.png

    for the ACF Atmos Clouds Front, the ACF is left with ACF_SW and SYS MODE set to full.

    My game character, a rather fetching looking box, starts at a position of x:-345 | y:403 ( on the ground ) | z: 7820.

    $Wheres My Cloud.jpg

    The cloud pan seems to be off in the distance? if I physical move the cloud pane, from certain positions you can see the edge of the pane. ( in this image you need to look closely )

    $cloud edge.jpg

    Any ideas how to solve this?
     
  8. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    What is your Far value of Clipping Plane on your Camera ?
     
  9. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Hi, my far clipping is set to 60000. I thought this would be best
     
  10. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
  11. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Hi Karlbovsky, could you explain what you use the colliders on the GDome and its segments for? I've noticed that in scenes with a lot of colliders, the GDome can cause a lot of slow down. One way to speed this up is to add kinematic RigidBodies to all the parts with moving colliders. (Otherwise it is considered "moving a static collider" as described here: https://docs.unity3d.com/Documentation/Manual/Physics.html ) You might want to do that in the next version.
    The other thing to do is for the user to change the physics layer settings in their project to set what layers the GDome needs to check collisions with. This is what I'm not sure about since I don't really know what the colliders are for.
     
  12. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,

    @Valrik
    Ok, this should not be hard to fix, but i can't see if:
    What you see is the lower-edge of the PerlinClouds dome?
    Or is just that your Pc spawns at an higher altitude than the PerlinClouds transform.scale.y?

    With a big terrain, maybe it's just a matter of scales and positions.

    @OneShotGG
    I'll send u a PM on how to set static scene, it's a quick workaround till next release ( 1.3 ) ( current 1.26 has been submitted but not yet published ).

    @MakeShiftsWin
    sure, the GDome has a big-sphere collider attached that is used by the EGClouds to start perform some actions like, altitude changes and respawn position sequence. The Rings/slices of the GDome use colliders for the EGShaft/Bloom ( attached to mainCamera) to be more effective at sunrise/sunset. But you're right, there's something strange in this setup. I think that, at least the colliders on R2 an R3 slices could be removed. I'm going to test it, I'll let you know asap.
     
    Last edited: Feb 17, 2014
  13. ValrikRobot

    ValrikRobot

    Joined:
    Jun 26, 2013
    Posts:
    206
    Hi

    I made sur the cloud layers are all about the highest point in the world. I'll keep tweaking things til its right
     
  14. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Cool. I disabled the Shafts since I'm using the Unity Pro builtin sunshafts. Does that mean I can remove the colliders on the dome slices? I think it would help in my case since some of my scenes have a lot of colliders.
     
  15. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Yes, there should be no problems. ;)
     
  16. HiredK

    HiredK

    Joined:
    Jan 31, 2014
    Posts:
    12
    Hello,

    I've been looking for a good way to implement a environment for a while and EG is the best one so far. Now the implementation was pretty straightforward, but I'm having trouble setting the fog right. The problem is that the value of the fog in the final demo is too weak and if I try to lower it, the skydome is directly affected. I would like to know if it's possible to have a stronger fog value. Is there a way to make all the elements in EG not affected by the fog at all?

    Exemple

    Thank you.
     
  17. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,

    @HiredK
    The fog used inside the EG is the standard Unity Fog and should be used as mid-distance fog. To have elements not affected by it, you'll need to change features inside the shaders but i do not reccommend it.
    Instead, i suggest you to use the EG fog as it's meant to be used and try another solution for the near-fog ( aKa shuriken ).
    Soon there will be a close-fog element inside the EG! ;)



    While we wait for the 1.26 to be published, i'd like to show you what's going on in devBranch:


    Thanks to user's suggestions!!

    Regards,
     
  18. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    The 1.26 minor-update is available!!

    1.25a Fixed: Custom Editor. Labels Width on resize issue.
    1.25a Removed: Lightning gameObject (LineRenderer).
    1.25a Added: EGTL_ONE ( new internal lightning gameObject ) + assets.
    1.25a Reworked: EGThunders.cs -->to-->EGTLSystem.cs. New features + editor.
    1.26 Added: ConstantDayLight option.
    1.26 Reworked: Perlin Clouds Textures
    1.26 Updated UserDoc and CrashCourseOne.

    The package is a bit larger than previous one, actually the package i've submitted was a bit smaller ( about 500Mb ). Anyway, i hope you'll like this update!


    @Jack LePage
    Please report any issue or question in this topic or at this address : EGSupport
    I can't reply to the user reviews[Edit: ops, i can answer to user reviews, sorry!]. Please note that in version 1.26, a new thunder system has been introduced.

    Best Regards,
     
    Last edited: Mar 6, 2014
  19. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    The new version is great; I'm glad you fixed the custom inspectors since they were bugging me. ;)

    I think the Satellites are a little weird. The sun rises in the south and sets in the north by default which is weird, but I think I can fix that by just rotating the whole environment gator object. One thing that's a little harder to fix is that the sun doesn't actually act like a satellite; it is just a directional light that sits at the top of the scene and rotates rather than being an object that actually circles around the world like the moon does. This means I can't attach things to the sun like the Unity sun shafts or a custom sphere/billboard graphic for the sun. Can you change it so the sun is an actual satellite like the moon? I think the easiest thing to do would be to have a set of "satellite axis" objects that sit at (0,0,0) in the EnvironmentGator, and then the user could place the satellite object as a child of the axis at some offset facing towards the center, and then the Satellite manager would just rotate the axes. That way the satellites are always automatically facing the center of the world with their directional lights and billboards as they move around without having to calculate anything in their Update functions.
     
  20. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,

    i'm happy you like the new version!! ( i must admit, i've spotted a little error in one texture, i'll fix it soon. Actually i've already fixed it, and i'll prepare a small unity.package to download the fixed texture from my website ,sorry about that! )

    Nop, that's not necessary. You can easily change the Y.rotation of TheSun using his inspector to change his position. EDIT ( in demo scene, go to TheSun, and inside his inspector ( Satellites component )
    $APC - 2014.02.14 21.42 - 001.3d.jpg
    - Find the YRotation field.
    - Put -120. The Sun should now rise from the East.

    The system already works like that, i mean, not properly, but you can arrange an easy fix. Try to put a gameObject ( your physical Sun-Sphere ) as a child of TheSun gameObject. See what happens. If this does not do the trick, i'll write you a quick workaround. ( it's just a very easy change in code ).

    Note that you can put several satellites around your scene, the only limitation is that just the pair named TheSun and TheMoon will be considered as, main and secondary Directional Light, during a cycle, by the EG.

    Have a look at how the current Moon has been build.

    I'll glad to explain how to do it if you need help, but it should be not a big deal.

    Regards,
     
    Last edited: Feb 21, 2014
  21. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    That doesn't work. The Sun just sits at (0,3000,0) and rotates in place, so if I attach a game object, it just sits at the same position. I see in the code that the sun is set to a hardcoded position of (0,3000,0) and rotates in place,the moon is set to rotate around SatsPivot, and planets don't move at all... i tried removing that if statement to get the sun to rotate around SatsPivot, but that messed up the direction of the sun's directional light and didn't match the position of the sun in the skybox so I'm not sure the best way to deal with it.
     
  22. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    even if one approach could be to use/set the sun like the moon, i was more thinking at a slight change inside the UnityPro sunshafts.js ( i can't remember, i think it's a java script?! ) instead of changing the way the EG works ( atmospheric scattering uses DirLight direction instead of position, also the Flares, etc.. ), it should be a matter of cheating a bit inside the shafts script and tell him to rely on direction instead of position of the transform. Maybe getting the inverted direction of the sun transform as WorldToView reference, but i need to test it before i said something wrong. Unfortunately i can't test it on Pro right now, 'cause i'm out of town and I've got only my laptop with me. Anyway, i'll start to find a solution to this, and i'll make some tests.
    It sounds complicated but it could be not!

    Regards,
     
  23. derkoi

    derkoi

    Joined:
    Jul 3, 2012
    Posts:
    2,246
    Hi, I'm having some issues with the cloud layer cutting off my trees even though the clouds are far behind the trees. The trees are placed with the Unity Terrain system and are billboards in the background, so i think that might be the issue?

    $EG_sky.jpg
     
  24. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    yes, you should change your Terrain Settings in order to find the right spot for billboard-objects.
    Select the Terrain > GoTo > Terrain.cs inspector > Settings > BillBoard Start value.

    @makeshiftwings

    Try this inside the Sunshafts.js ( UnityPro SunShafts.js )
    Code (csharp):
    1.  
    2. if(sunTransform)
    3. v = camera.WorldToViewportPoint ( -sunTransform.forward*50000); //this instead of
    4. // v = camera.WorldToViewportPoint ( sunTransform.position );
    5. ...
    6.  
    It's just a test, but, on paper, it should work.
    Please, let me know, since i can't try it till tomorrow.


    Regards,
     
  25. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    Yeah, that puts the sunshafts in the correct location. I still think it would be useful to have the sun actually revolve around the scene though, so I could add a custom billboard or sphere to it, but this is good for now. :)
     
  26. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi !
    Thank you for this great plugin!

    On one of my scene, I have a problem.
    I import EGDemoFinal_Prefab in my scene but the domes are too small.
    $125726eg1.jpg
    $449496eg2.jpg


    Also at night, I have a bright white light while I have no light in my scene :(
    $764485eg3.jpg


    Same problems with EGBlank_Prefab.
     
  27. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi Laurent,

    i'm glad you like it, thank you!

    Your issue with sizes should be just a matter of scaling things and everything is scalable inside the EG.
    Please, keep in mind, that the prefab to pick when you start a new scene is the EG_Blank prefab, and since, probably,
    your scene has a different size, things won't fit. That's why you can scale things up/down easily using the Inspector.

    Start considering the dimension of your Terrain and scale things accordingly.
    Remember that we are assuming that 1 Unity unit is equal to 1 meter.

    If you have a 4k x 4k Terrain, for example, you should set your world radius ( if you are using Spherical World ) at least at the same size of the terrain ( i suggest to set it at least at double of the terrain size ), the GDome radius should probably be set at 3.9 / 4.0 , depending on your scene limits, etc...

    $APC - 2014.03.02 12.47 - 001.3d.jpg $APC - 2014.03.02 13.04 - 001.3d.jpg

    The problem with the Light at night sounds strange too.
    Please, check your Ambient-Light, under EDIT > RENDER SETTINGS.

    Let's try, and if you still get stuck on them, just let me know, and we'll easily figure it out!

    Best Regards,
     
    Last edited: Mar 2, 2014
  28. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    I won starting with EG_Blank prefab ;)
    I change the scale of dome and the altitude
    $273147PRIMITIVE.jpg
    This plugin is just great!!
     
  29. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    I'm happy you've solved it!

    Yes, and you can also change the altitude-Offset for each individual Ring-group that's inside the GDome.

    Your pic looks great, maybe you need to make the GDome scale a bit bigger. Anyway, you got the point. It's easy to fix things, the EG is pretty flexible, especially thanks to the Unity's editor.

    I hope to see other pics from your project, looks cool!!

    I'm happy you like the component!!
    I'll come back soon with some greats news for the next major update (#1.3).

    Regards,
     
  30. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,

    the development towards the first major update is going on well.
    The 1.3 will be a very effective upgrade!!

    I’m going to show you just the major feature updates, but a lots of minor fixes and adjustments were made,
    and the system is more fluid and precise than ever.
    It’s also quicker to set up !!

    I’ve already told you about the two new options about Time and they are ready now:

    TimeFreeze
    We are now able to generate static scenes, we can start a static one or freeze it at runtime.
    TimeHookUp
    Jump back and forth in Time at runtime and every element that is controlled by the EG will hookup the new Time settings.

    $Time.jpg

    Curves
    In v#1.3 things are going to change for several components. Now we can use AnimationCurves to “animate” our values during a Day-Night cycle or to set them in a static scene. This allows much more precise and customizable settings with a real boost in terms of overall look and performances. Curves will work as Gradients do, there’s our DN cycle that goes from 0.0 to 1.0, and we will enter our values in between, pretty simple but very powerful. For example, now, when in SphericalWorld, we can program the HDR exposure and ESun for the entire lenght of a DNCycle. This means that we could have a very bright and colorful SunRise, then we can slowly fade to a much more deep blue sky during the day and so on.

    $GameWorldCurves.jpg

    Fog is another nice example of which kind of improvement the introduction of curves will give to the entire System.
    I'm going to add curves for each variable that may have a use, testing them on almost all the components.

    With curves also the scenes setup will be much quicker and easier and the inspector will look less creepy !! :)

    $FogCurves.jpg

    Smoothed Lerps and more precise internal values adjustments.
    Also the code it’s under rework. I’ve slighty adjusted all the Lerps functions and some calculation in order to have a smoother system and much more precise values.

    Minor Fixes:
    The GDome will be less DrawCall eater, now in High quality, he will hit 17dcs ( instead of 34 ), but i’m still work on it.
    The next plan for the Gdome is tomake him much more live and responsive. The final goal is to have something like the Arma III and DayZ:SA skies.

    PerlinClouds. I’ve reworked textures a bit, and they looks better than in 1.26.
    Now the Overcast texture is much more effective.
    $Unity 2014-03-06 13-22-44-83.png

    The new shader is not ready yet, it will take sometime.
    As stated above, the inspiration come from the Arma III and DayZ:SA skies, let’s see where this take us.

    $sunset.jpg
    Lots of other minor adjustments are going on under the hood but i don’t know if i can put all them in 1.3 release.

    Before the 1.3 release also the documentation will change a bit and, finally, new chapters-tutorials will be added.
    ( i’m waiting for the update since it changes a lot of things ).

    The current stable version is 1.28r5.0314. I think it will takes a couple of weeks before the upgrade, maybe something less.

    Best Regards,
     
  31. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Great update!
    Thank you very much, it really is a great plugin!
     
  32. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    The update looks awesome! I'm excited about getting to use curves.
     
  33. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,
    this is going to be the last Status-Update before the release of the new version (#1.3).

    I've started the rework of the ACFSystem (cloudsSys).

    Let's have a look:
    EGC shader has been reworked to properly apply the normal maps and to better interact with others, transparent, shaders. This allows to have clouds that blend at horizon, and fall beyond the GDome.

    $1.29a.jpg

    All the clouds shaders now have a _Darkness parameter to "fake" differents densities and we can control the overall strenght of it.
    Darkness will also change according to time of day, so that, finally, we will have darker clouds at night! ;)

    $1.29c.jpg

    Now that the PerlinClouds are much more reliable and give better results, i've divided them in Overcast-Layers Groups in order to control their behavior with more precision.

    $APC - 2014.03.18 13.40 - 001.3d.jpg

    This is just the beginning of the new CloudsSys, and it's a good start. imho.
    If we choose the right textures and the correct overcast layer setup, the results are pretty good.
    So, with the new system, good textures are mandatory. I will include a first set of new textures inside the 1.3. This is just a selection of some textures that I'm preparing, I will not fill the package with tons of MB of textures, if you don't like the included ones, i will provide new ones on my website to download ( 4free ) after release, or make your own to feed the EG!

    $1.29l.jpg $1.29f.jpg

    Now it will be easier to put our ACF in a scene, to scale it and to have more homogeneous scenes.
    A lot of other improvements have been made, i'll update the devlog soon.

    I've not yet a date for release, but it's close! When i can be more precise i'll tell you.

    I hope you liked this new status-update.


    Best Regards,
     
  34. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi !
    I have a problem.
    The dome appears above the trees bilboard :(

    $986921bilboardproblem.jpg
     
  35. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    you should tweak your Terrain billboard distance to avoid overlaps.
    Select your Terrain and go to the Settings Tab.

    Have a nice day.


    Regards,
     
  36. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Sure, but it will take more resources (
     
  37. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    yep, i know, this is a very discussed topic and i'm checking all the workarounds.
    The problem is that, handling with render queue et similia, could work for one project but maybe not for another one.
    Anyway, i'm tracking the problem and i'll let you know the results asap. ;)

    Regards,
     
  38. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,

    i'm happy to announce that the EG#1.3 is almost ready. I hope to be able to submit the package during the week.
    This is going to be the first major-upgrade of the component, and i'd admit that i'm pretty excited about that.

    I've also updated the WebSite a bit, the docs are been updated, there's also a new section in the support page, about the AtmosGator ACF system, since a lot has changed in the Weather and Cloud systems.

    There's also the new gallery with firsts, official, screenshots of the new version.
    I think you should go have a look..;)

    $Unity 2014-03-15 01-27-05-62.png

    So, that's it!
    Stay tuned and keep an eye on your Asset Store updates tab!

    Have a nice day.



    Best Regards,
     
  39. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    148
    Davvero un bel lavoro Stefano!

    Really a nice work! Waiting for the new version...
    What do you think to improve the rain and snow? I mean expecially the collisions with the terrain. The low resource solution that use unistorm looks good and i think it can be implemented in EG.
     
  40. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Hi !

    Just an idea for not to have a long farClipPlane value to the camera

    Add this script on a gameObject and set your farClipPlane on the camera at 500 for testing
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class TwoCamEnvGator : MonoBehaviour {
    6.  
    7.     public float farClipPlane = 14000;
    8.     private Transform backgroundCameraT;
    9.     // Use this for initialization
    10.     void Start () {
    11.         GameObject newGo = new GameObject ();
    12.         newGo.name = "Environment Gator Camera";
    13.  
    14.         newGo.AddComponent<Camera>();
    15.         Camera backgroundCameraG = newGo.GetComponent<Camera>();
    16.         backgroundCameraT = backgroundCameraG.transform;
    17.         backgroundCameraG.transform.parent = Camera.main.transform.parent;
    18.         backgroundCameraG.clearFlags = CameraClearFlags.SolidColor;
    19.         backgroundCameraG.depth = Camera.main.depth - 1;
    20.         backgroundCameraG.farClipPlane = farClipPlane;
    21.         backgroundCameraG.fieldOfView = Camera.main.fieldOfView;
    22.         backgroundCameraG.cullingMask = 1 << LayerMask.NameToLayer ("TransparentFX");
    23.         Camera.main.clearFlags = CameraClearFlags.Depth;
    24.     }
    25.    
    26.     // Update is called once per frame
    27.     void Update () {
    28.         backgroundCameraT.position = Camera.main.transform.position;
    29.         backgroundCameraT.rotation = Camera.main.transform.rotation;
    30.     }
    31. }
    32.  
     
    Last edited: Mar 23, 2014
  41. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Also, this method fixes the bilboard trees bug : D
     
  42. laurent-clave

    laurent-clave

    Joined:
    Jul 18, 2011
    Posts:
    280
    Update the script.
    Work very well on my project ;)
    Place this script on your main camera:
    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using System.Collections;
    4.  
    5. public class TwoCamEnvGator : MonoBehaviour {
    6.  
    7.     public float farClipPlane = 14000;
    8.     public string EvSkyLayer = "TransparentFX";
    9.     private Camera backgroundCamera;
    10.  
    11.     void Start () {
    12.         GameObject newGo = new GameObject ();
    13.         newGo.name = "Environment Gator Sky Camera";
    14.         newGo.AddComponent<Camera>();
    15.         backgroundCamera = newGo.GetComponent<Camera>();
    16.         Camera foregroundCamera = GetComponent<Camera> ();
    17.  
    18.         backgroundCamera.transform.parent = transform.parent;
    19.         backgroundCamera.clearFlags = CameraClearFlags.SolidColor;
    20.         backgroundCamera.depth = foregroundCamera.depth - 1;
    21.         backgroundCamera.farClipPlane = farClipPlane;
    22.         backgroundCamera.backgroundColor = foregroundCamera.backgroundColor;
    23.         backgroundCamera.cullingMask = 0;
    24.         backgroundCamera.cullingMask |= 1 << LayerMask.NameToLayer (EvSkyLayer);
    25.         foregroundCamera.cullingMask =  ~( 1 << LayerMask.NameToLayer (EvSkyLayer) );
    26.         Camera.main.clearFlags = CameraClearFlags.Depth;
    27.     }
    28.  
    29.     void Update () {
    30.         backgroundCamera.transform.position = transform.position;
    31.         backgroundCamera.transform.rotation = transform.rotation;
    32.         backgroundCamera.fieldOfView = GetComponent<Camera> ().fieldOfView;
    33.     }
    34. }
    35.  
     
    Last edited: Mar 24, 2014
  43. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Grazie mille!! Sono davvero contento che ti piaccia!! ;)

    The entire precipitation system will be reworked soon, i'm not sure yet about which tecnique to use, i'm studying different solutions right now.

    Very Interesting Script, Laurent!!

    Would be great to solve the Unity Tree's Billboard issue!
    Thank you for the effort, i'm going to test it asap..
     
  44. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi to all,
    just a quick update.

    The EG #1.3Major-Update has been submitted for review and there will be also the new
    demo online, soon after the #1.3 release.
    I'll be back as soon as the update will be released to talk about
    all the new features.

    Regards,
     
  45. treshold

    treshold

    Joined:
    Nov 9, 2013
    Posts:
    225
    Can't wait the new update :)

    I have had little problem with ACF, even though I put low values as Min Altitude for overcast, seam is visible between sky and ACF system. On runtime when ACF has been instantiated I can move ACF on Y-axis down to get it "right" but somehow from setup I don't know how to handle that :D
    and why is thunder constantly on if I use demo final prefab as basis and put extra elementsgator-prefab inside Environmentgator prefab as help suggests?
     
  46. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Hi,
    you can change the Altitude of the whole ACF here:

    $APC - 2014.03.21 13.16 - 001.3d.jpg
    This is the panel in vers1.3 so it's a bit different but you can change the overall altitude of the ACF here ( aKa all the EGClouds inside the ACF you'r going to spawn ).

    If you want to change the altitude offset for the EGCPerlin clouds ( the clouds that run inside the domes ), you can do this using the script attached to each EGC:

    $APC - 2014.03.21 14.39 - 001.3d.jpg
    Again this is going to be the look of the component in vers1.3, but you can see the Offset parameter.
    If you need to put your PerlinDome down, find the right spot during runtime and then put the value here.

    Things are going to be easier and even more organized with the next version. I suggest you to have a read at this doc. It may help also with the current version.


    Please, repeat the procedure and don't forget to click the Check&Set button in order to attach the ElementsGator to the MainCamera/Player gameobject. It needs this step just to have a reference of the position of the player/cam, as soon as the scene starts the ElementsGator detach from the Player/Camera go.

    Be sure that you don't have 2s ElementsGator gameobjects inside your scene.

    Let me know if that solved your issues, otherwise i'll glad to hekp you further.

    P.S.
    The website sometimes doesn't refresh the browser cache if there's a new version of that page, so please, refresh your browser manually in order to be sure to see the latest version of the website,docs,etc..
    ( i'll fix this, i hope, after the 1.3release )


    Regards,
     
  47. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,350
    A word of advice on laurent's code though... using multiple cameras messes with Image Effects, especially in Deferred Lighting mode. Unity doesn't handle composting the different camera layers correctly and loses the z buffer, which messes up things like Ambient Occlusion, Bloom, etc. So while it can solve some problems it causes others. I prefer to use one camera with a large clip distance but use LOD's to minimize far away objects.
     
  48. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    148
    Stefano, what happen if i upgrade the plugin on a current scene i made? Is it compatible?

    Thanks!
     
  49. Karlbovsky

    Karlbovsky

    Joined:
    Jul 11, 2012
    Posts:
    231
    Yep, the update 1.3 is online!!! And.. the new demo is online too!
    ( do know why it says Trial, since i've build it in UnityFree, but anyways.).

    Sorry, but it went online during the night so now i need to organize things..i'll be back soon..

    Hi,
    Even if nothing should break dramatically, I always recommend to make a backup before update.
    The EG prefab, assets and scripts are changed, so what will change for sure, are the EG's settings when you install a new prefab.
     
  50. Goldrake

    Goldrake

    Joined:
    Feb 6, 2010
    Posts:
    148
    Yes it's not working well updating on top. So i'm trying to reset the environment without success.
    I made many things without success so i removed the version and reinstalled it.
    After the first step of crash courses from page 29 to 32, when i click play the sky it's black.
    the camera set is good the position too. i can't undestand.
    your demo inside the package works well, but not the crash course (thje blank prefab)
    also i can't undesrsstand ohw the curves works (hdr etc..)

    grazie