Search Unity

[RELEASED] trueSKY Alpha for Unity Pro - Volumetric Skies, Clouds, and Time-of-Day

Discussion in 'Assets and Asset Store' started by rvkennedy, Aug 15, 2014.

  1. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    It will be a while before the mobile platforms can handle this kind of approach, I think you'll see more and more volume rendering in games in the future.

    The cloud shadows should just add onto any shadowing that's there already. But I'll investigate this and get back to you!
     
    hippocoder likes this.
  2. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Call it 'TrueSky Omega', no confusion, same theme and the other Greek letter for awesome. The final letter in their alphabet and metaphor for 'the end'. You can thank me for the input with Jove 2 communication aha. At least if Alpha is reconsidered. Or in cold hard cash.

    Oh and yeah, I just meant OpenCL as in Unity's only Compute language is DirectCompute, would prefer there to be a more open standard, it is nice that newer mobiles are actually supporting OpenCL though (The newer Qualcomm chipset the S5 Prime will be sporting is chummy with both OpenCL and DirectX 11 for example), will be a while before it's sensible for this kind of thing though. I'm a big advocate for gpu computation, and it's going to be huge, have a few assets from the store using compute for volumetric effects already and typically particle based effects like clouds and gases/fire just cannot compare, at all
     
    Last edited: Sep 2, 2014
    rvkennedy likes this.
  3. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Sun does not appear to be working correctly, scale may be to small. If you change the time of day to track sun thru sky, you can see the sun is a very small yellow circle, that becomes impossible to see against the expanding and contracting sun atmosphere bloom effects as the sun rises in the sky.
    Would it be possible to add a scale option like the moon to size the sun up and also have it stand out more against the bloom effect. Also sun flare effect does not appear to be working.

    Need to be able to see the sun disc for an ingame sextant. Like this example:



    Also managed to get a screenshot of the lightning issue I mailed you about.
    Hope this helps:

     
    Last edited: Sep 2, 2014
    rvkennedy likes this.
  4. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Was just messing around with the demo scene settings and I noticed what I believe is a rainbow from the lighting calculation. Based on the current cloud canopy it did appear change in intensity and which parts were visible. Very cool! Am I mistaken?

     
    rvkennedy and John-G like this.
  5. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Very nice, I did see a rainbow texture in the files alright.
     
  6. ForceX

    ForceX

    Joined:
    Jun 22, 2010
    Posts:
    1,102
    Ahh So there is :)

    I was really impressed when I saw it and how it worked as the sky changed and the sun moved. Nice touch and nice surprise. :)
     
    rvkennedy and John-G like this.
  7. Thiago-Crawford

    Thiago-Crawford

    Joined:
    Jan 7, 2013
    Posts:
    92
    Hi, I'm using your asset, and I noticed that if I set the speed to 1 (instead of 10), using your "ExampleSequence", the rain becomes really slow too. Is this as designed?

    Is this something that can be changed, so I can adjust the speed of the clouds and other effects (like rain) separately?
    Or am I suppose to set this up in some other way?
     
  8. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Speed set to 10 is 10x normal speed. Useful for testing transitions between the different cloud sequences.
    You can change the speed if clouds is realtime speed of 1 by changing the wind strength.
     
  9. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Gosh - it's not supposed to slow down; but a separate speed control for rain would be very simple for us to implement, so I'm putting it on my list!
     
  10. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Hey John, thanks for the report; the sun/moon sizes by default are about 1/2 degree diameter - that's how they look from the Earth's surface. The thing is that looks very small to the eye when displayed on a monitor screen with a standard (e.g. 60-90 degree) field of view. The moon size can be controlled in Sky settings, but not the sun - yet. If it helps, we can add a sun size control. Did you try the sidereal display on the trueSKY debug overlays at all?

    EDIT: also - what about dynamic exposure - does Unity support this?
    EDIT 2: We're writing hi-dynamic range in trueSKY, so a low exposure should work - I'll add an exposure control.

    Are you rendering a single view for the sextant or is it two views on one screen?
     
    Last edited: Sep 4, 2014
  11. lazygunn

    lazygunn

    Joined:
    Jul 24, 2011
    Posts:
    2,749
    Was anything said, as it was mentioned earlier I think, about supporting the Oculus and similar displays? It boils down to two cameras being able to render the scene at the same time, slightly apart from each other, without anything looking funky. Definitely a huge positive in terms of features for me, and this type of feature is set to rise in popularity
     
  12. Thiago-Crawford

    Thiago-Crawford

    Joined:
    Jan 7, 2013
    Posts:
    92
    Cool that would be great.
    But the thing I think would make your product more popular would be if you can get that multiplatform aspect going, I know you mentioned to someone else about openGL already.

    Since I am not a graphics developer, this may be a n00b question, but what makes truSky DX11 only? what feature of DX11 does it use that DX9 does not have?

    And yeah, not to make the list longer, but oculus support would be cool too if you have time :)

    Thanks
     
  13. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Cheque's in the post ;)

    We like open standards! Our approach at Simul is to write common shader includes that the different shader languages can understand. So the GLSL or HLSL shader is a thin wrapper around an included .sl file. And I think if we supported OpenCL we'd go the same route - all of these languages are variations on C, so a few #defines here and there does the trick.

    Yes, it's in the plan, on the list and all set for October.
     
  14. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Mainly it's the number of permissible operations in a pixel shader. DX9 tops out at 255 as I recall, and won't permit the single-draw-call raytrace that we use to draw the clouds.
    In the old days of DX9 we had a workaround that was geometry-heavy, but it's too high maintenance to keep that going when MS are phasing out support. GL however is a different matter, and GL4.2 can support the same type of shaders we use in DX11. So when we find the right person to implement it, we'll get that going for OSX.
     
  15. Thiago-Crawford

    Thiago-Crawford

    Joined:
    Jan 7, 2013
    Posts:
    92
    Cool, thanks for the insight, is this the same limitation that stops it being used on mobile/OpenGL ES 2+? Or mobiles just dont have the power yet?
     
  16. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    It's both - there are strict limits on shader capabilities in ES2, plus there's limited power in the hardware.
     
  17. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    A separate scaling control for the sun would be great. I have the moon set at a scale of 3 instead of default 0.5 just to make it look more natural in size.

    For the sextant, I had it working using 3 separate cameras, 2 cameras for each split lens on to a render texture and a third camera for the eye piece for zoom/focus.
    Haven't tried it yet with TrueSky, will check tonight how it works.
    Will see you it fairs in regard to actual moon, sun and star positions with almac data for lat/long corrdinates.
     
  18. blueivy

    blueivy

    Joined:
    Mar 4, 2013
    Posts:
    633
    Is there weather in this asset? Like rain, lightning etc
     
    Last edited: Sep 5, 2014
  19. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Just tried how it works with regard to multiple cameras and Render to Texture and I'm impressed practically no performance hit on FPS. (Next to try it for accuracy to real data - will have to make a new project current one won't let me change anything in the sequencer all values and sliders are greyed out???).



    @Roderick with regards to adding the feature to have a scale value for the sun as well as the moon, can you have the sun standout against the atmospheric effects something like the photoshopped sun above. Maybe you could have this as a user toggable effect?
    The reason I need this is to use a Sextant you have to accurately place the sun touching the horizon line to get the difference between horizon and sun in degrees to work out navigational position. So need to see a physical representation of the sun - of course the sextant used filters to block out background light so if you did make the sun image toggleable i could have the sun with bloom as default and enable the sun image when filters were used on the sextant.

    Also didn't see is documentation what the 2 circles represent in the diagnostics, I imagine one is the actual location of the celestial object but what is the trailing one for? Just curious. ;)
     
  20. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Sorry for double post, just got finished testing the accuracy of the sun position using default sequence settings and date.
    Still haven't figured out why all the options are greyed out on me.

    Click to Enlarge:


    Once I figured out that Unity does not model North to any Axis and that TrueSky was using the X-Axis for North.
    I used an Navigational app to locate the sun using the sequencer time and location to get suns compass heading and Arc angle.
    Well what do you know, Bang there is the sun :cool: - right where it's meant to be. (Highlighted the sun disc in the image as hard to see at pic resolution. This is using Truesky realistic Sun Angular Diameter of approx 0.5 degrees.

    For anyone wanting realistic simulated celestial environments, this first test sure looks promising.
    Next test is Moon, the common stars used in Celestial Navigation. If these show the same results, then I'm totally blown away by this package. Fantastic clouds and true celestial observation at a bargain price. :D



    EDIT:

    After further testing during different times of the day, it appears that the East to West axis is inverted :( (Example worked above as sun was at 180deg ie south).
    @Roderick is there any way to flip this axis ?
     
    Last edited: Sep 5, 2014
    rvkennedy likes this.
  21. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264
    I just purchased TrueSky Alpha and loving it. Can I email the publishers with my purchase info to get the latest version?
     
  22. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi rvkennedy,

    Any feedback please? Are you able to reproduce?
     
  23. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    Hi,
    I installed the latest version (v4) in a new Project and have a couple of issues:
    To see my scene correctly I have to make different settings on the SKY Camera for Forward/Deferred :
    Forward: Flipped View on, Flipped Depth off.
    Deferred: Flipped View off, Flipped Depth on.
    (The attached screenshots show how the rendering is with all settings off.)
    Is this normal?


    On top of that it is impossible to make any settings in the Sequencer. Only scrubbing in time and select a keyframe works but I can't set any values.They seemed to be inactive (greyed out)
     

    Attached Files:

  24. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Same as above:
     
  25. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264

    Looks like the latest version is on the App store. :)
     
  26. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Yes - just send your invoice number to contact@simul.co
     
  27. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    It's normal that you need to change the Flipped settings, because Unity arbitrarily flips its view and depth depending on whether you have Forward or Deferred rendering, which we can detect, and whether you have postprocessors on the camera, which we can't (easily) detect. So this is the solution for now.

    But you should be able to modify the Sequencer values. Email us at contact@simul.co and I'll make sure it works for you.
     
  28. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    I'll send you a new update - perhaps there's an issue with this version - I'm testing this now.
    By convention for trueSKY, +y is North and +x is East. But perhaps some of the fiddling we did to get things to work with Unity's matrices have messed that up - I'll get back to you ASAP.
     
  29. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Will double check my orientation and see if the original versus the latest yield the same results.
    Still seem to be getting the Sun mirrored along the X-Axis, for example when it should be at 210deg its at 150deg, at 178deg its at 182deg etc.

    Would it not be +z for North and +x for East, unity has +y as Up???
    Think I may be confusing myself :confused:
     
    Last edited: Sep 10, 2014
  30. Vern_Shurtz

    Vern_Shurtz

    Joined:
    Mar 6, 2009
    Posts:
    264
    I have the same issue. Also the quality of the clouds seems to be less. This may be due to the inability to edit anything. I was also getting DLL errors trying to add a TrueSky to an existing scene after removing a sky.

    I have to exit Unity and then on start up the TrueSky panel automatically comes up without issue.
    I am emailing support my invoice info to better facilitate support.

    Thanks
     

    Attached Files:

  31. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    I've sent a fix t
    You're quite right - Unity uses a left-handed coordinate system so we have to flip things around. The issue has been that we needed to use different matrix conversions for Forward rendering, compared with Deferred rendering or Forward rendering with postprocessors.

    I've sent you both the update - if this fixes things as I think it should, I'll post it to the store. Meantime, anyone needing the fixes, please mail us at contact@simul.co and I'll get it to you by return.
     
    John-G likes this.
  32. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Nice one, will try it tonight and give feedback in results. :)
     
  33. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Ok downloaded the latest update, and noticed some nice little additions.
    When using the Diagnostics mode under ShowCelesticalDisplay the compass points are shown for the 8 points. :)
    Also there is a new shadow sharpness mode in the trueSky UI script.

    Also there is a new Moon texture selector in the Sequencer, but while you can select a texture it does not display the image in the sequencer yet, WIP?
    Another addition I spotted in the Sequencer is a tickbox to render only the Ursa Major (The Greater Bear) but this does not appear to hold its setting yet, WIP?

    So setup my scene and now that the Options are no longer greyed out (Update fixed that :cool:) I set the lat/long to my hometown of Galway Ireland ;), and tested the accuracy of TrueSky's astronomical accuracy.

    The following speak for themselves:


    Setup Sequencer to lat/long of Galway 53deg17min N 9deg3min W
    Time set to 16:00 GMT.
    Celestical Navigator shown that the sun position for this location and time is 240deg (Close to SW) at a elevation of 25.9 degrees of the horizon.


    Moving my sliders to rotate the sextant as close as possible to these angles (low accuracy of slider) and there is the sun, exactly where its meant to be.


    Extremely happy with these results:

    So a great update. :D:D:D:D:D:D:D Thanks Roderick and the TrueSky team.



    EDIT: Further testing shown that Sun is perfect using different times and locations.
    Alas not so good with the moon, any time or position I've used has the moon off by up to 30 degrees along the X-Axis and the Y-Axis.
    Can you look at the formulas for the moon and see if you can spot anything (Also moon display and scale seems to be broken, may have to do with new texture select option). Cheers.
     
    Last edited: Sep 10, 2014
    rvkennedy and hopeful like this.
  34. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Ah! will get that fixed for you pronto!
     
    John-G likes this.
  35. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Hi Roderick, it's not that the moon is exactly 30 degrees of both axis, but that it varies up to and maybe more depending on coordinates and time.
    Without further testing of ingame results and real orbit data it's hard to say where the error is.
    If you are having difficulty finding it I can do a more in depth testing to see if it helps nail it down.
    Hopefully you can spot the issue on your end.
    Will test the stars next ;)
     
    rvkennedy likes this.
  36. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Looks like we were one day out - the sun didn't show it because it varies little from day to day. The version I've sent you fixes this. Let me know what you find with the stars!
     
    hopeful and John-G like this.
  37. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    681
    Hi.

    I'm really loving the asset. Just a few things I want to check to see if other people are experiencing them.

    * Shadow direction not correct? - I have a directional light attached to TrueSky. As I progress through time of day I can see the shadows change length and distance from 3D objects to represent the height of the sun in the sky. However the shadows always face the same direction. In other words, in real life you know where the sun is because it's opposite to the direction of your shadow. This is not the case in my TrueSky scene. It doesn't matter if it's 9am or 3pm, the direction of the shadow is the same. Is this a problem with the way my scene is set up or an issue in the calculation of the light direction?

    * Changing values through script doesn't seem to have any affect? - I need to have real time control over my settings and tried the KeyframeTesting script as an example. I've linked it to a TrueSky object but it doesn't seem to do anything. The script is being run and I've proved the cloudiness values are changing from 0.5 to 0.8 (by calling GetKeyframeValue before and after setting them and sending it to the Debug.Log). However these changes don't seem to update the display at all or get saved in the current sequence. Conversely if I edit the cloudiness value in the Sequencer it works fine. Do I need to call a Refresh/Apply function or something to apply scripted changes? Has anyone managed to change the behaviour of clouds through scripting in real time?

    * Location settings don't save - Lat/Long settings don't seem to save when edited in the Sequencer. Also it would be great if these could be get/set via scripting as I don't think that's possible at the moment.

    Any help with these points gratefully received (even if it's just to confirm you've also experienced the problem so I know it's not just me!)
     
    rvkennedy likes this.
  38. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Thanks Roderick, that update did the trick.
    Both moon and sun are working perfectly. Stars will be tested tonight ;)

    @RichJones have you tried the latest version from dev? There was an issue where the sun was flipped on the x-axis that might be related to the shadows.
    Haven't looked at shadows yet so that may have solved it.
    Regarding the sequencer and lat/long values in the sequence editor these reset when you reopen the sequence editor but the actual values in the sequencer file are not reset.
    At least as long as you don't click on the displayed reset values. The bug only effects the displayed values which show defaul values, while actual values used by the sequencer are ones changed by the user.
     
    Last edited: Sep 12, 2014
  39. sloopidoopi

    sloopidoopi

    Joined:
    Jan 2, 2010
    Posts:
    244
    I can confirm this issue. The Simul light script don't work like it should . The sunlight gameobject rotates in a weired fashion. Just set the speed field of the TrueSKY component to 10000 to get a short day/night cycle, run you scene and select the Sunlight gameobject to see how it behaves.
    (I use a patch from 10.09.2014)
     
  40. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Hi Roderick, having some difficulty identifying stars. Is it possible to to add a marker for the North Star (Polaris) and if possible the Big Dipper (Ursa Major) or the leading edge star Dubhe.



    I believe after some editing of the dimness and amount of stars I've located the Big Dipper. Though if this is it the scale of the stars is not correct. It may be to do with the FOV being skewered while stars are rotating around the North Star (polaris) especially the vertical aspect.

    Here is a screenshot to show what I mean: (Click for fullsize)


    Now with the date and location I used the Star Dubhe should be located at:
    30 degrees and elevation of 17.7 degrees, while I'm getting around 30 degrees and elevation of 26.1 degrees.
    and the star Alioth should be located at:
    30 degrees and elevation of 2.4 degrees, while I'm getting around 27 degrees and elevation of 19 degrees.

    Mizar and Alkaid should be below the horizon, whereas in-game Alkaid is 12 degrees above the horizon.


    Also can you tell me what scaling the markers are using for the compass points it seems to be 8 division's per 45 giving degrees 5.625 degrees per division, could you maybe make it 9 divisions for 5 degrees each.
    A small change that won't really be used much but a nice and quick method for checking degree spacing while testing.
     
    Last edited: Sep 12, 2014
  41. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    681
    Yeah I'm using a build from yesterday so it looks like the shadow issue is still there.

    That's interesting info about the Sequencer, thanks. I'll try changing the location values again and see if I get different output in the renderer. I think you're right, the Sequencer sometimes displays incorrect values even if they have been saved correctly in the file. It also randomly disappears for me sometimes and I have to reload it.

    Like I say, ideally I eventually don't want to use the Sequencer at all and set everything in code including locations.
    I've managed to fix my second issue ("Changing values through script doesn't seem to have any affect").
    It was my understanding that you always needed a sequence attached and scripted changes would be applied to that sequence file. However, for scripted changes to work it seems you must not attach a sequence to TrueSky and leave SequenceAsset set to None in the inspector.
    Then the example KeyframeTesting script seems to work a treat, although I've only tried modifying cloudiness up to this point. Will do some more scripting tests when I can.
     
    John-G likes this.
  42. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    @ RichJones Nice catch on not attaching a sequence for scripting to work. I can see this Asset really becoming a powerhouse.

    Did some testing with scripting with working results

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class KeyframeTesting : MonoBehaviour
    5. {
    6.     public float SliderValue2D = 0.0F;
    7.     public float SliderValue3D = 0.0F;
    8.     public simul.trueSKY trueSky=null;
    9.  
    10.     void OnGUI() {
    11.         GUI.contentColor = Color.red;
    12.         //Slider for 2D Clouds
    13.         SliderValue2D = GUI.HorizontalSlider(new Rect(225, 90, 200, 15), SliderValue2D, 0.0F, 1.0F);
    14.         GUI.Label(new Rect(225, 70, 65, 20), "2D Clouds: ");
    15.         GUI.Label(new Rect(290, 70, 100, 20), SliderValue2D.ToString());
    16.  
    17.         //Slider for 3D Clouds
    18.         SliderValue3D = GUI.HorizontalSlider(new Rect(225, 120, 200, 15), SliderValue3D, 0.0F, 1.0F);
    19.         GUI.Label(new Rect(225, 100, 65, 20), "3D Clouds: ");
    20.         GUI.Label(new Rect(290, 100, 100, 20), SliderValue3D.ToString());
    21.     }
    22.  
    23.     void Update ()
    24.     {
    25.         if(trueSky!=null)
    26.         {
    27.             int numk=trueSky.GetNumCloudKeyframes();
    28.             for(int i=0;i<numk;i++)
    29.             {
    30.                 uint uid=trueSky.GetCloudKeyframeByIndex(i);
    31.                 //Update 2D with value set by slider
    32.                 //trueSky.SetKeyframeValue(uid,"2Dcloudiness",SliderValue2D);
    33.  
    34.                 //Update 3D with value set by slider
    35.                 trueSky.SetKeyframeValue(uid,"3Dcloudiness",SliderValue3D);
    36.             }
    37.         }
    38.     }
    39. }
    Tip: If using this disable all the Debug.log entries to improve FPS in truesky.cs

    @Roderick How to change the 2D clouds value, what is the correct format for this line: trueSky.SetKeyframeValue(uid,"2Dcloudiness",SliderValue2D) which is used above to change the value of the 3d clouds.

    Looking through the truesky.cs it looks like the only values we have access to as of now is public void SetKeyframeValue(uint uid,string name,object value) for altering the sequence via script,
    This takes a float, int and bool. What are these 3 types function? Do they all apply to the 3d clouds?




    EDIT 14Sept:

    Ok wen't back over the documentation and figured out the 2D clouds, got some code working to change the 2d and 3d clouds.

    Code (CSharp):
    1. using UnityEngine;
    2. using System.Collections;
    3.  
    4. public class KeyframeTesting : MonoBehaviour
    5. {
    6.     public simul.trueSKY trueSky=null;
    7.     float Cloudiness3D = 0.5F;
    8.     float CloudBase3D = 8.0F;
    9.     float LayerHeight3D = 5.0F;
    10.     float WindSpeed = 200.0F;
    11.     float WindHeading = 0.0F;
    12.     float SimulTime = 0.5F;
    13.  
    14.     void OnGUI() {
    15.         GUI.contentColor = Color.red;
    16.         //Slider for 3D Clouds
    17.         Cloudiness3D = GUI.HorizontalSlider(new Rect(225, 90, 200, 15), Cloudiness3D, 0.0F, 1.0F);
    18.         GUI.Label(new Rect(225, 70, 100, 20), "Cloudiness: ");
    19.         GUI.Label(new Rect(320, 70, 100, 20), Cloudiness3D.ToString());
    20.      
    21.         CloudBase3D = GUI.HorizontalSlider(new Rect(225, 120, 200, 15), CloudBase3D, 0.0F, 20.0F);
    22.         GUI.Label(new Rect(225, 100, 100, 20), "Cloud base: ");
    23.         GUI.Label(new Rect(320, 100, 100, 20), CloudBase3D.ToString());
    24.  
    25.         LayerHeight3D = GUI.HorizontalSlider(new Rect(225, 150, 200, 15), LayerHeight3D, 0.0F, 25.0F);
    26.         GUI.Label(new Rect(225, 130, 100, 20), "Layer heigth: ");
    27.         GUI.Label(new Rect(320, 130, 100, 20), LayerHeight3D.ToString());
    28.  
    29.         WindSpeed = GUI.HorizontalSlider(new Rect(225, 180, 200, 15), WindSpeed, 0.0F, 1000.0F);
    30.         GUI.Label(new Rect(225, 160, 100, 20), "Wind Speed: ");
    31.         GUI.Label(new Rect(320, 160, 100, 20), WindSpeed.ToString());      
    32.      
    33.         WindHeading = GUI.HorizontalSlider(new Rect(225, 210, 200, 15), WindHeading, 0.0F, 360.0F);
    34.         GUI.Label(new Rect(225, 190, 100, 20), "Wind Heading: ");
    35.         GUI.Label(new Rect(320, 190, 100, 20), WindHeading.ToString());
    36.  
    37.         SimulTime = GUI.HorizontalSlider(new Rect(225, 240, 200, 15), SimulTime, 0.0F, 1.0F);
    38.         GUI.Label(new Rect(225, 220, 100, 20), "Time: ");
    39.         GUI.Label(new Rect(320, 220, 100, 20), SimulTime.ToString());
    40.     }
    41.  
    42.     void Update ()
    43.     {
    44.         if(trueSky!=null)
    45.         {
    46.             int numj=trueSky.GetNumCloud2DKeyframes();
    47.             for(int i=0;i<numj;i++)
    48.             {
    49.                 uint uid=trueSky.GetCloud2DKeyframeByIndex(i);
    50.                 //Update 2D with value set by slider
    51.                 trueSky.SetKeyframeValue(uid,"cloudiness",Cloudiness3D);
    52.                 trueSky.SetKeyframeValue(uid,"cloudBase",CloudBase3D);
    53.                 trueSky.SetKeyframeValue(uid,"WindSpeed",WindSpeed);
    54.                 trueSky.SetKeyframeValue(uid,"WindHeading",WindSpeed); // Not Working (WindHeading - Incorrect Name)?
    55.             }
    56.  
    57.             int numk=trueSky.GetNumCloudKeyframes();
    58.             for(int i=0;i<numk;i++)
    59.             {
    60.                 uint uid=trueSky.GetCloudKeyframeByIndex(i);
    61.                 //Update 3D with value set by slider
    62.                 trueSky.SetKeyframeValue(uid,"cloudiness",Cloudiness3D);
    63.                 trueSky.SetKeyframeValue(uid,"cloudBase",CloudBase3D);
    64.                 trueSky.SetKeyframeValue(uid,"layerHeight",LayerHeight3D); // Not Working (layerHeight - Incorrect Name)?
    65.                 trueSky.SetKeyframeValue(uid,"WindSpeed",WindSpeed);
    66.                 trueSky.SetKeyframeValue(uid,"WindHeading",WindHeading); // Not Working (WindHeading - Incorrect Name)?
    67.             }
    68.         }
    69.     }
    70. }
    having some issues trying to figure out the ID names for some of the components, for example:
    trueSky.SetKeyframeValue(uid,"layerHeight",LayerHeight3D); Layer height is the name on the sequence UI but does nothing in my example nor does cloudheigth or cloudheightkm as found in the docs (These I believe are the original standalone naming convention and not the unity version).
    Have you a list of all current UID names that we can script from with unity.

    Also can you show an example of how to access the time variable: Tried using GetKeyframeValue and SetKeyframeValue for time but not sure the correct code structure for void SetKeyframeValue(uint uid,string name,object value) and object GetKeyframeValue(uint uid,string name) in use.
     
    Last edited: Sep 14, 2014
  43. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    681
    The docs seem to imply time is only a property of Sky keyframes, but this isn't the case.
    You can use it to set the time of Cloud keyframes too, which makes sense as a keyframe of any type must have a time associated with it for it to know where it is.

    This code should set the cloudiness to 0.7 at midday:

    uint uid = trueSky.GetCloudKeyframeByIndex( 0 );
    trueSky.SetKeyframeValue( uid, "time", 0.5f );
    trueSky.SetKeyframeValue( uid, "cloudiness", 0.7f );
     
    John-G likes this.
  44. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,122
    Ok after playing around, I've figured it out you need to do both. The Skykeyframe controls the time within the day ie 24 hours. That is the daylight, sun moon and stars.
    While the cloudkeyframes controls the position of the clouds at that time. So you need to set both to move all keyframes to that particular time.

    uint uidCloud = trueSky.GetCloudKeyframeByIndex( 0 );
    uint uidSky=trueSky.GetSkyKeyframeByIndex(0);
    trueSky.SetKeyframeValue(uidCloud,"time",timevariable);
    trueSky.SetKeyframeValue(uidSky,"time",timevariable);

    Thanks RichJones for the pointer.
     
    Last edited: Sep 16, 2014
  45. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    Anyone know if the rain actually collides with things in this?
     
  46. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    The stuff this does is nice, might have to bite the bullit and use dx 11. I have to ask though. Does it work with occulus rift? And which thread should I be asking on? I see 2 truesky forum threads.
     
  47. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    ok we must be doing something wrong here. I originally calibrabted the system using Ursa Major, but there's every chance that was too rough of a process. Perhaps the one-day fix mentioned above has thrown something off in the stars. I'll bring some numbers up onscreen, that usually clarifies things.

    That would be sensible. I have a tendency to think in 8's for some reason.
     
    John-G likes this.
  48. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Rich, by doing this you're also moving the first keyframe from the start of the sequence to midday. Nothing wrong with that of course. But we can make it possible to insert a new keyframe instead. What effect are you trying to achieve?
     
    Last edited: Sep 19, 2014
  49. kurylo3d

    kurylo3d

    Joined:
    Nov 7, 2009
    Posts:
    1,123
    kennedy,

    Occulus rift support? Thats the only thing i care about right now.. oh and can the rain only show up in the distance since it does not collide with objects? That wy i can have particle emitters in the foreground or something.
     
  50. rvkennedy

    rvkennedy

    Joined:
    Mar 27, 2014
    Posts:
    127
    Thanks for this - I think the changes we made in fixing up for matrices for forward/deferred maybe broke the sun direction. I'll post an update soon but you can fix this now with the following line in trueSKY.cs, in the function getSunRotation():

    Code (CSharp):
    1. Quaternion q=Quaternion.Euler(el,0.0F,az);
    should become:
    Code (CSharp):
    1. Quaternion q=Quaternion.Euler(el,az+180.0F,0.0F);
    The script is not intended to change the properties of the saved sequence. But you should be seeing changes onscreen - I'm investigating this now.

    Investigating - I'll keep you posted!
     
    Last edited: Sep 19, 2014
    CityGen3D and John-G like this.