Search Unity

[RELEASE] Nuaj', the 3D clouds simulator

Discussion in 'Assets and Asset Store' started by Patapom, Dec 16, 2011.

  1. PolyMad

    PolyMad

    Joined:
    Mar 19, 2009
    Posts:
    2,350
    Looks fantastic... but on my I7 laptop it's already only 30 fps on the webdemo... anyway, great.
     
  2. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Performance is quite variable depending on the settings you use in Nuaj'... Glad you like it anyway. :D
     
  3. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    Daayyyuummm this is looks soo cool o_O. Btw did you gonna port you Optical Flares to Unity too.....!!??? since you trying to mimic optical flares now i'm interested ^^
     
  4. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Héhé. Thanks. I don't think I have time for Optical Flares right now, I'm not sure if people would like that anyway.
    There are already lens flares in Unity aren't they ?

    Moreover, I've hacked the Optical Flares file format to read back their data and I'm really not sure I have the legal right to sell a product that is based on an other company's (lousy) proprietary format for which there is no known SDK...
     
  5. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,788
    True.Well it's too bad that you won't port it to unity since their system it's great to create a Lens Flare effect, btw rather than read OFP data why not using texture input? (since reading OFP data is copyrighted by VC). Sorry to derail this thread :D
     
  6. ykk

    ykk

    Joined:
    Dec 8, 2009
    Posts:
    51
    $_2012-01-13_16-12-12.jpg

    Model had outline,,

    I had outline problem in original ExampleScene. I just add a model in the scene. so, How can I solve this problem?
     
  7. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi !
    You should try and play around with the "World Parameters > UpScale Technique" parameter.
    Either set it to "Accurate" and tweak the ZBuffer Threshold slider for a lower value, or use the "Smart" technique that will render the opaque geometry on top of the clouds no question asked.
     
  8. xexex

    xexex

    Joined:
    Jan 17, 2012
    Posts:
    15
    $ScreenShot-1_17_2012 11.05.37 AM.png

    A strage hole in the sky,How can I solve this problem?
    (I built a standalone exe)
     
    Last edited: Jan 17, 2012
  9. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Seems to be a shadow map problem.
    Can you give me the azimuth/elevation of the Sun and the altitude of your cloud layer(s) please ?
    Is it view-dependent or just stands there while moving ?
     
  10. ttank7

    ttank7

    Joined:
    Apr 18, 2011
    Posts:
    42
    I love this cloud system. Thanks so much for making it! :)
     
  11. imtrobin

    imtrobin

    Joined:
    Nov 30, 2009
    Posts:
    1,548
    Reporting a problem, the GUIHelper class conflicts with other GUIHelper scripts. You are using namespace, which is not supported. Can you name your class NuajGUIHelper.
     
  12. xexex

    xexex

    Joined:
    Jan 17, 2012
    Posts:
    15
    Problem solved. I re-active the camera.
     
  13. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Thanks. :D

    Namespaces are not supported ? WTH ? :eek:
    I'll look into that...

    I'm glad. In a general manner, when you see a strange phenomenon like this, or lose the sky color or something, that usually means Unity killed my internal textures (and didn't notify me, which is kind of ugly) so you need to disable then re-enable the NuajManager component... That's the case during a fullscreen switch for example.
     
  14. ykk

    ykk

    Joined:
    Dec 8, 2009
    Posts:
    51
    How to save the prefab setting??
    My setting is reset back to default setting when import new script or import unitypackage in unity.
     
  15. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi ! What version of Unity are you using ?
     
  16. ykk

    ykk

    Joined:
    Dec 8, 2009
    Posts:
    51
    version 3.4.2f3
     
  17. ykk

    ykk

    Joined:
    Dec 8, 2009
    Posts:
    51
    unity version 3.4.2f3
     
  18. ykk

    ykk

    Joined:
    Dec 8, 2009
    Posts:
    51
    $particle.jpg

    I can't see particle in sky?? what is the problem??
     
  19. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi !

    Nuaj' works as a post-process that reads back the ZBuffer to compute the "amount of sky" to display. Your particles don't write anything in the ZBuffer so Nuaj' assumes it can display an infinite sky that covers your particles.
    A simple solution is to go to NuajManager > World Parameters > Upscale Technique and choose "Smart" that simply "puts the sky in the back".
    Another solution is to create some sort of terrain where the particles will be drawn against.
    The most comprehensive (but also more complex) solution would be to render particles in a special RenderTexture then mix that with the sky as a post-process occuring AFTER Nuaj' post-process.


    Otherwise, I don't understand your earlier problem with the prefab... What is it that you do that is reset/not stored ?
     
  20. dogzerx2

    dogzerx2

    Joined:
    Dec 27, 2009
    Posts:
    3,967
    can you increase the resolution of the clouds?
     
  21. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Well yes, there's a downscale factor (default 1/4) that you can increase but at your own risk !
    The secret of Nuaj' is actually downscaled rendering, if you increase this to the screen's resolution then bye bye FPS ! :D
     
  22. Gary.Corp

    Gary.Corp

    Joined:
    Feb 11, 2010
    Posts:
    9
    Impossible to enable the antialising and nuaj... It cause an horizontal invertion of on my skybox !
    Does someone had these probleme ? And solve it ???

    (i use Nvidia GC : GTX295 )

    Thks for your support

    Gary
     
  23. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi !
    I actually fixed that in a new version of Nuaj' I'm trying to submit but it has been rejected for some problem on the Mac I still don't understand...
    I can provide you the fix by mail if you like.
     
  24. Phantasm2

    Phantasm2

    Joined:
    Jun 24, 2011
    Posts:
    1
    Great work! I will definitely buy the solution for planetary systems based on Nuaj especially with the promised gas giant tutorial :) Is there any sense to expect it in the near future? :)
     
  25. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi thanks !
    Well, I'm sorry if I seem slow to some people about fixes/updates/versions/tutorials here but I'm buried under a pile of work, I'm in quite over my head right now... I'm going as fast as I can but Nuaj' is not my only project unfortunately. :(

    Lots of love. :D
     
  26. livemixlove

    livemixlove

    Joined:
    Sep 16, 2009
    Posts:
    17
    Does it work on 3.5?
     
  27. livemixlove

    livemixlove

    Joined:
    Sep 16, 2009
    Posts:
    17
    Upon import of the package, I get this error:

    Assets/Nuaj/Scripts/CameraEffects/EffectComposeAtmosphere.cs(73,34): error CS0121: The call is ambiguous between the following methods or properties: `UnityEngine.Graphics.Blit(UnityEngine.Texture, UnityEngine.Material)' and `UnityEngine.Graphics.Blit(UnityEngine.Texture, UnityEngine.RenderTexture)'

    Any solutions?`

    edit: I'm using the 3.5 dev release.
     
    Last edited: Jan 31, 2012
  28. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Hi !

    There is a fix you can download from here : http://www.patapom.com/Temp/NuajFix3.5.rar

    It's been ready for quite some time now but whenever I submit it to the asset store guys as a new version (1.01) they claim it doesn't work on the Mac : the screen is all garbage. And since I don't have a Mac for testing, I can't figure out what's wrong. Especially since I haven't changed the shaders !

    So here it is, a quick fix, not officially approved by the Asset Store : make sure you backup your existing files prior installing the new ones !

    Use at your own risk (although the risk is mild TBH :D )
     
  29. pthimon

    pthimon

    Joined:
    Feb 6, 2012
    Posts:
    6
    Hi, does Nuaj' support adding a cloud layer that covers just a region of the sky?
     
  30. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Thanks for the fix. I would like to help with the asset store problem if I can, as I am on a mac and own Nuaj, and Im reasonably familiar with it having done those botch-fixes to make it work on 3.5 a while ago.

    I don't get any corruption on my main mac pro though, so I would need you to send me the version of the files you are trying to submit (just in case its different to original version combined with the above fix somehow) and also let me know if there is any more detail to the garbage report that the Asset Store people gave you. I have a couple of other macs that I can try it on too.

    I have a couple of other questions/comments to make as well:

    I don't get good results with light cookie enabled, the resulting stuff is tiled on my objects in an ugly way. But since I've not really used light cookies before I don't know how its supposed to look or if Im doing something wrong. Do you have an example of how its supposed to look when working properly?

    I haven't been too happy with the way my distant scenery looks at the points where it meets the sky, so I have started experimenting with a setup where I use separate camera for the sky and everything else. If I achieve any useful results I will post details.

    Can you think of any way it may be possible to get the clouds to show up in reflective materials? e.g. water4.

    Sometimes an ugly line floats across my sky, looking somewhat like the point where two tiles meet. Is this a known issue and can it be improved somehow?

    Sometimes I feel like I should be trying to smooth out the light colour/intensity transitions a bit as sudden changes sometimes don't look great.
     
  31. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    OK my light cookie problem was a silly mistake on my part, I had not set the cookie size of the directional light to a nice big value that matched Nuaj setting. With this stuff working the last point in my previous post is also somewhat redundant, since the light cookie really helps the terrain colours to change nicely.

    I am fairly pleased with my first attempt at using 2 camera to overcome less than perfect area where objects meet sky. Obviously there are some drawbacks such as losing anything Nuaj would place stuff over the scenery/objects, e.g. rain, but for some scenarios it works quite well.

    Regarding my question about reflections, I noticed a reflection-related script but when I tried using it, it complained about a missing shader.
     
  32. WalterEspinar

    WalterEspinar

    Joined:
    Aug 23, 2011
    Posts:
    84
    I apply the fix for 3.5 and replaced the folder "Editor" and "Scripts", but have this error.

    EffectComposeAtmosphere has an invalid owner !
    UnityEngine.Debug:LogError(Object)
    Nuaj.Help:LogError(Object) (at Assets/Nuaj/Scripts/Helpers/Helpers.cs:856)
    EffectComposeAtmosphere:OnPreCull() (at Assets/Nuaj/Scripts/CameraEffects/EffectComposeAtmosphere.cs:47)

    there are another way for apply the fix?

    thank you
    [Edit] Solved

    the Drive camera are not set

    congratulations for this great job!
     
    Last edited: Feb 7, 2012
  33. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    Oh yes sorry, here it is as an attachment.
    You can find out how to use it if you look at chapter 13 in the new documentation file found here.
     

    Attached Files:

  34. Patapom

    Patapom

    Joined:
    Aug 19, 2009
    Posts:
    155
    You can provide a RGBA texture that controls the local density for the 4 possible layers (R=density of lowest layer, A=density of highest layer) so if you scale the texture large enough, you can "paint" your clouds as you like.
    By using a Render Texture instead of a normal texture and rendering into it, you can even animate the cloud density (making clouds appear or disappear with scenaristic events).
     
  35. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Just to update everyone that the asset store rejection does appear to be shader related as far as I could tell from trying it out as a mac user, and I think that Patapom is still a bit busy at the moment. So those wishing to use Nuaj with Unity 3.5 and don't want to wait should import the original asset store version and then replace a couple of folders with the ones that Patapom made available for download a bit earlier on this thread.

    Sadly I haven't been able to get the water reflection stuff working, maybe I did something wrong but I suspect it may be a similar shader issue so I will just to be patient. Which isn't very easy because Nuaj is one of the most beautiful things I have ever seen emerging from a computer in realtime, simply stunning when the right settings are used, a great joy :) And even if the very best that Nuaj has to offer is a bit much for most GPUs these days, I have only to think to the future and how much this system is going to rock eyeballs once even average class GPUs have real teeth.

    I have done a bit more testing with my alternative two camera approach to rendering Nuaj the rest of the scene, and I think it may have advantages in some scenarios so I will talk a bit more about it here.I haven't learnt how to do any useful image effects etc scripting using render textures yet, so I was just trying a very easy approach using the unity editor:

    Setup a Nuaj scene as normal.
    Create a second camera and make it a child of the existing camera.
    Make sure the second cameras transform position rotation values are all 0.
    Set the clear flags of the second camera to Depth only
    Set the Depth of the second camera to 1
    Set the original camera (the one that Nuaj works with) Culling mask to Nothing.
    Remove the Audio Listener from one of the cameras. Maybe some other tidying up to do also, I don't actually know that much about best practice when using multiple cameras in unity yet.

    Advantages of this approach:
    Better more consistent framerate (e.g. if some vegetation appears overlapping sky then the framerate shouldn't suddenly drop)
    Sharper appearance where sky meets scenery, other objects etc
    Very easy to apply image effects that only alter the Nuaj sky (e.g. perhaps you'd like to add some blur to the sky only)

    Drawbacks:
    Anything Nuaj would do to other objects is lost, including some colour stuff, low level clouds etc. So this technique is not good for all scenarios.
    Perhaps some other side-effects that I haven't thought of or come across yet.

    Please note that I am in no way anything to do witht he development of Nuaj, just a user that is very excited by the potential of the system and decided to mess around with it a bit, before bothering to learn anything about making my own custom image compositing scripts.
     
  36. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Forgot to mention that my 2 camera trick is also an easy way to make particles show up over the sky. No additional steps required beyond the instructions I posted above as far as I can tell.
     
  37. pthimon

    pthimon

    Joined:
    Feb 6, 2012
    Posts:
    6
    There appears to be a bug whereby if the stellar background is disabled then pixels of (usually green) noise appear in the sky, which then seems to cause problems with the HDR rendering, causing the sky brightness to flicker. This is on Windows with an ATI graphics card.
     
  38. weltenkonstrukt

    weltenkonstrukt

    Joined:
    Jul 14, 2011
    Posts:
    3
    Thanks a lot for this very fantastic weatheraddon. Unfortunatly i get some strange problems when using it.
    When i start a nuaj scene everything seems to be ok, but after a few milliseconds the textures become gray respectively get lost. It happens only with hardware enviroment.

    Here is a picture of the demoscene at the nuaj website in my browser. I also have this strange texturemissing (?) in unity (3.5Beta) itself.


    The nuajfix for the 3.5Beta is already installed.
    My GPU: Nvidia GF 7900GS, SM3.0 ready, no DX10

    Any ideas about a solution? It would be very nice :)
    Thanks a lot
     
    Last edited: Feb 15, 2012
  39. Jarhead

    Jarhead

    Joined:
    Jul 4, 2009
    Posts:
    38
    Just wondering how Nuaj HDR works with unity 3.5. I was working on a unity 3.5 scene that had Unity's HDR enabled with Bloom and Tone Mapping. Do I need to disable HDR in Unity 3D or is there a way to disable HDR in Nuaj...not sure how this should work...
     
  40. ttank7

    ttank7

    Joined:
    Apr 18, 2011
    Posts:
    42
    I am also curious as to the future of Nuaj and unitys now built in HDR?
     
  41. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,084
    Does this work on mobile?

    Does it gracefully degrade, if not? Screenshots?
     
  42. Jarhead

    Jarhead

    Joined:
    Jul 4, 2009
    Posts:
    38
    There seem to be a few annoying bugs with this plugin...

    1. The cloud shadow map feature seems totally FUBAR....if i use shadow maps for the 3d clouds, they tile across the terrain with a very visible hard edge. Additionally, when i turn the camera around the tiled light cookie seems move across the terrain, it looks terrible. I have the light cookie set to 512 for my directional light and shadow map size set to 512 under the 3D Clouds tab

    2. I think this is a known issue with shadow maps? However, the sunset is WAY to red.

    3. If the Orchestrator prefab is included with the Nuaj prefab than module editors that have layers forget their settings when modified in the editor. For example, if i modify Altitude for 3D clouds AND the Orchestrator prefab is in the scene the altitude modification is reset when the play button is pushed. It seems like this is an issue with settings are in base classes, all derived class settings seem to be saved.

    4. Sunset seems to create ugly lines that shoot across the sky.

    5. At night it's way too dark and I get weird blue glows on the terrain, where i guess moonlight is creating shadows on my terrain? However, it looks very unnatural.

    6. At sunset/dawn the sun glows red right through the terrain.

    Some of this might just be settings in the plugin, however, I suspect not all of them are.
     
    Last edited: Feb 19, 2012
  43. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Problem 1 sounds like a mistake I made too and discussed a little earlier in the thread. The settings you need to match are the Light Cookie Size in Nuaj with the Cookie Size of the directional light. The shadow map size under 3D cloud is not the right setting to match with the light. The Light Cookie Size one that you want is found under the Shadow Map Parameters in the first Tab of the Nuaj Manager, when Use Light Cookie is ticked.

    As for problem 3, Im not sure if it is really a problem. I think the Orchestrator is supposed to be an example of how a script can be used to control Nuaj. For example the different weather presets in the Orchestrator work by changing the parameters of a 2D and 3D cloud layer, etc. So when the Orchestrator is enabled it is bound to override some of the values you've entered into Nuaj Manager directly. If I wanted a more limited Orchestrator that for example only controls the time of day and not the cloud layers, I would use a copy of the Orchestrator script with quite a lot of the code commented out/removed. Or I might build upon the script if I wanted weather presets that had different cloud layer parameters, or wind that affected more cloud layers than the standard Orchestrator is coded to control.
     
  44. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,526

    If you have a mobile that supports shader model 3?
     
  45. pthimon

    pthimon

    Joined:
    Feb 6, 2012
    Posts:
    6
    I'm pretty sure the sun is supposed to rise in the east and set in the west! A quick fix is to negate PhiTheta.x in ModuleStellites.SatelliteStar.ComputeSunPosition (lines 879-880):
    Code (csharp):
    1. float CosPhi = Mathf.Cos( -PhiTheta.x );
    2. float SinPhi = Mathf.Sin( -PhiTheta.x );
    Also I think the Longitude term in fSolarTime (line 869) should be added rather than subtracted so that times can be expressed in UTC (i.e. if you head east then sunrise time should get earlier):
    Code (csharp):
    1. float fSolarTime = _TimeOfDay + 0.17f * Mathf.Sin( 4.0f * Mathf.PI * (_JulianDay - 80f) / 373f ) - 0.129f * Mathf.Sin( 2.0f * Mathf.PI * (_JulianDay - 8f) / 355f ) + 12.0f * _Longitude / Mathf.PI;
    At sunrise or sunset there sometimes is a white line where the sun meets the horizon.
     
  46. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Cheers for the fix, I had been wondering about that myself but hadn't gotten round to looking at it in more detail. Kinda reminds me of the problem in Microsoft Explorapedia where the Earth spun in the wrong direction!

    I dont suppose anybody can suggest alternative methods for getting reflection of the sky working? Or has anybody had success with using the Nuaj script and the shader that was attached to this thread earlier?
     
  47. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    So, we can see from this thread that there are a range of issues, and its unfortunate that the developer doesn't seem to have had time to comment on or fix the more recent ones or fix the shader issue which prevented publication of an updated version to the asset store. But for a moment I would like to put these teething problems to one side and ask other users how they have found the system? Because Im still rather amazed by what it can do, which granted makes the niggles even more annoying because the system has so much potential, but even so Id still like to sing its praises a bit here. Last night I created a scene that had the Nuaj sky and the community ocean shader, and tried it on a machine with a pretty good CPU GPU, and I was very impressed with the results. Im not sure Id try using this system in software that has lower-end machines in mind right now, but looking to the future or for non-game uses where we may have control over the spec of the hardware and the system is beyond lush. It makes UniSky look rather silly by comparison. Or am I getting carried away? I so want this system to do well with Unity, are you out there Mr Developer?
     
  48. xexex

    xexex

    Joined:
    Jan 17, 2012
    Posts:
    15
    Problem 1,2,4,5,6 I made too!
    Performace is too low when I set big terrain with vegetations and many buildings in the scene,(with Nuaj sky framerate below 30,with out Nuaj framerate above 80).
    My CPU Xeon X5675,GPU Nvidia Quadro 6000.
     
  49. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Have you tried the 'use 2 cameras' approach that I mentioned a little earlier in the thread? It has some downsides but it does overcome performance issues with vegetation etc, so it might be appropriate for certain scenarios.
     
  50. Jarhead

    Jarhead

    Joined:
    Jul 4, 2009
    Posts:
    38
    @elbows...Patapom should cut you in as a partner for providing technical support for his product :)