Search Unity

Farland Skies - Low Poly skybox with custom shader

Discussion in 'Assets and Asset Store' started by PhannGor, Jun 18, 2016.

  1. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @BillyMFT,

    Nope, it's not possible to disable the sun or moon completely at runtime because it's a shader feature and it defines which variation of skybox shader should be used and included into the build.

    You can use the sun/moon tint alpha to hide them at runtime. Just take a look how it's done in the day-night cycle demo scene.
     
  2. BillyMFT

    BillyMFT

    Joined:
    Mar 14, 2013
    Posts:
    178
    ok thank you
     
  3. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Hi, stars in your "Asset" are prefabs? Can I take a separate star and make it a Gameobject?
     
  4. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Orexx,

    No, starts aren't prefabs or Gameobjects. All stars rendered by custom shader in one pass and their look and feel based on special cubemap texture.
     
  5. Orexx

    Orexx

    Joined:
    Jun 4, 2017
    Posts:
    26
    Hi @PhannGor
    thanks for the answer. And is it possible to edit so that only one star remains in the conditional sky in some place?
     
  6. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Yes, it's possible. You'll need to create your own cubemap with one star and set in in the corresponding section of the SkyboxController inspector.

    CropperCapture[30].png
     
  7. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    Hi there! We are running into an issue where all of the sudden the skybox stops drawing the sun/moon. It's really really odd. This is scene specific as well, I opened up another scene and the skybox worked correctly, back to the original scene and it's working fine except no sun/moon. I have tried deleting the prefabs from the scene and dragging them back in, rebaking the GI, deleting GI data and rebaking, clearing out shader cache. The only thing I hadn't tried is deleting the entire Library folder which I always avoid because it's a 20 minute rebuild.

    I will let you know if the Library folder rebuild solves it but figured I would mention this here because I have had this issue both with Low Poly as well as Cloudy Crown and have always just messed around until it was fixed, but I'm not sure if you know of anything else which could cause this.

    Oh and by the way, love the product, it's one of the first things I drag into a scene just to make the scene more visually attractive.
     
  8. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    OK so deleting the entire Library folder didn't work. I will keep plugging away at this
     
    PhannGor likes this.
  9. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    I was able to fix this! You will never believe what it was - for some reason, display of the sun and moon are tied to the coordinates of the Skybox Controller. If you set the coordinates relatively high, e.g. x:400 y:0 z:0 - it disappears



    2018-03-26_10-52-49.png 2018-03-26_10-53-06.png
     
    PhannGor likes this.
  10. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @cain06,

    1. Can you please specify which version on Unity do you use?
    2. Do you use some other custom shaders in this scene?
    3. Is sun/moon enabled in SkyboxController controller and its alpha > 0? (stupid question, i know)
     
  11. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Can you please add a bit more info? I would like to reproduce this issue on my side. Thanks!
     
  12. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    I edited my post, there should be two screenshots above now showing what happens
     
    PhannGor likes this.
  13. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Ok, I've reproduced it. That's really weird but sun/moon are really tied to coordinates and even scale of the SkyboxController. Will dig deeper and try to fix that.

    Good catch! Thank you for the info!
     
  14. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    I was really concerned that I would never track this down because I love the skybox so much but wouldn't be able to use it if I thought it might break in production. Fortunately this is a simple fix for me and I'm so happy I know what it is now.

    I know I said this before but this does affect both Cloudy Crown and Low Poly I believe for I have seen the issue in both cases. My typical use case is to setup the skybox exactly how I want it and then create a prefab out of it. Dragging the prefab onto the scene view will give it whatever coordinates Unity thinks are best based on drop position which is how this issue came about. If I had dragged directly into Hierarchy it would still have 0,0,0 and not be an issue.

    Thanks for looking into this. Love the skybox
     
  15. morphinegames

    morphinegames

    Joined:
    Mar 13, 2015
    Posts:
    33
    Although you would know best, it's probably this line in the SkyboxController

    Code (CSharp):
    1. if (_sunEnabled)
    2.             {
    3.                 SkyboxMaterial.SetMatrix("sunMatrix", _sunLight.transform.worldToLocalMatrix);
    4.                 if (_sunFlare && _sunFlareComponent) _sunFlareComponent.brightness = _sunTint.a * _sunFlareBrightness;
    5.             }
    6.  
    7.             if (_moonEnabled)
    8.             {
    9.                 SkyboxMaterial.SetMatrix("moonMatrix", _moonLight.transform.worldToLocalMatrix);
    10.                 if (_moonFlare && _moonFlareComponent) _moonFlareComponent.brightness = _moonTint.a * _moonFlareBrightness;
    11.             }
     
  16. P_Jong

    P_Jong

    Joined:
    Jun 14, 2017
    Posts:
    58
    Hi. I bought this last year and enjoyed using it in some test projects. I'm about to start a new project in Unity 2018.2 beta that will be developed to work on the Oculus Go and Oculus Rift. Does anyone know what the performance is with the Oculus Go? How does the shader work with the Lightweight Redner Pipeline for VR?
     
  17. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @P_Jong,

    This skybox works just perfect on Oculus Rift/HTC Vive. Regarding Oculus Go, didn't have a chance to test it on this device but it works perfectly fine on Daydream with Google Pixel (which is less powerful than Oculus Go). I guess, it should work just fine then on your target devices.

    Regarding Lightweight Render Pipeline, it will be directly supported in near future but current shader implementations are highly optimized to be used on mobile devices anyway.
     
    P_Jong likes this.
  18. ashleebeggs01

    ashleebeggs01

    Joined:
    Jul 9, 2017
    Posts:
    1
    Hi I just bought this and it's awesome, I notice though that whatever I set as the mid color it turns my assets into that color. So if it's pink all my assets have a very pink hue. Is there a way to not have this happen? Attached is an asset that should be light brown but after runtime it's now pink. If I change the mid color it turns to that new color.
    Ash
     

    Attached Files:

  19. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
  20. NaughtyMoleGames

    NaughtyMoleGames

    Joined:
    Jan 25, 2018
    Posts:
    51
    @PhannGor , Looks like you cannot add dotparams in unity 2018.2.2f1. See screen shot (no +)

    nodotparams.PNG

    Hope you can fix! Thanks!
     
  21. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @gorxmedia,

    Thank you for reporting this issue. Already working on hotfix.
    Will let you know when it will be done. Thanks!
     
  22. NaughtyMoleGames

    NaughtyMoleGames

    Joined:
    Jan 25, 2018
    Posts:
    51
    Awesome! Cant wait ;)
     
  23. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Just pushed the new version to the Asset Store but review process can take some time. If you need this update urgently then ping us at support@borodar.com with your invoice number.
     
  24. shardnzl

    shardnzl

    Joined:
    Jan 2, 2015
    Posts:
    8
    Hi PhannGor - this looks amazing and I am thinking of buying it as it would compliment my low poly project so well - but I have a wee question first. My project is for the Oculus Go so I have all of the limitations of VR and Android - looks like your plugin is optimised for mobiles (single pass) so that's great but would the distance fog work? Very important to me because Unity fog doesnt work in VR on mobile (something about the VR camera not having a depth buffer). I couldn't see it in your custom online demo but the screenshots clearly show it.
     
  25. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @shardnzl,

    Didn't tested it on the Oculus Go, but should work well in VR in general. I know that some customers successfully used it on HTC Vive, for example. It works exactly like usual skybox and should be rendered at infinite depth.

    Regarding fog, it's not the part of the asset. There is an option to adjust fog color to match skybox color automatically, but that's all. In the demo scene, we're using default Unity fog so probably it will not work for you. However, you can use some other fog implementation and adjust its color by grabbing corresponding skybox value through Skybox Controller API.
     
    shardnzl likes this.
  26. JeBuSBrian

    JeBuSBrian

    Joined:
    Mar 3, 2013
    Posts:
    15
    I feel like I'm missing something very basic, so if I am, I apologize in advance.

    How do you set the time of day in editor? By that I mean, when I'm editing my scene, it's always "night" time, with the moonlight. I'd like to be able to see how the scene looks in the editor during both day and night. Some way to control the time of day in the editor view must exist, right?
     
  27. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @JeBuSBrian,

    It's actually pretty easy to do on the latest version of the skybox. You should be able to change the time of the day right in the editor using Cycle progress property from SkyboxCycleManager script. Please take a look how it's done in DayNightCycleDemo scene that comes with the package:

    CropperCapture[4].png
     
  28. JeBuSBrian

    JeBuSBrian

    Joined:
    Mar 3, 2013
    Posts:
    15
    That doesn't seem to have any effect on the lights / skybox in scene view. The skybox always appears dark as night, with the moon in the sky, no matter what I set that value to. Cycle Progress works fine for gameplay mode, but not scene view.
     
  29. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @JeBuSBrian,

    Please make sure you're using the latest version of the asset from the Asset Store.
     
  30. JeBuSBrian

    JeBuSBrian

    Joined:
    Mar 3, 2013
    Posts:
    15
    I am. Dated 2018-08-22.
     
  31. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    @JeBuSBrian,

    Just double-checked all the things and... my apologies! For some reason this change was not included into latest release on the Asset Store but exist in our master branch... I'm attaching updated script here, also will make sure it will be included into upcoming release for 100%.

    Thank you for catching this!
     

    Attached Files:

    shyamarama likes this.
  32. JeBuSBrian

    JeBuSBrian

    Joined:
    Mar 3, 2013
    Posts:
    15
    That did the trick. Thanks!
     
    PhannGor likes this.
  33. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Is there a way to brighten up the back side of my objects, not receiving direct light from the sun/moon or do I need to write a custom shader for that?
     
  34. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Obsurveyor,

    Can you please add a bit more details on what exactly you need? In case you mean how to make shadows more soft or bright then you could use ambient lighting (Window > Rendering > Lighting Settings > Environment Lightning.
     
  35. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    I'd like to be able to increase the brightness of the indirect lighting from your skybox without increasing the brightness of the direct light, so Intensity won't work. In this picture, Realtime Lighting and Mixed Lighting are turned off(they don't have any effect anyway) and the only light is from your sun. SkyboxCycleManager Cycle Progress is at 50(sun high in the sky). The face facing the sun is fine, it's the other two I'd like to increase the brightness on.

     
  36. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    That's what I'm talking about:

    CropperCapture[16].png

    For this purpose, you can use the "Environment Lighting" section. Those settings will have an impact only on ambient light and will not affect other light sources.
     
  37. Obsurveyor

    Obsurveyor

    Joined:
    Nov 22, 2012
    Posts:
    277
    Then maybe 2018.4.3f1 is bugged because that slider does nothing:



    edit: Figured it out, it doesn't make sense to me but if you uncheck Auto Generate at the bottom of the Lighting panel in 2018, the Intensity Multipler slider won't do anything. There's no baked lighting in this scene and as far as I understand, the slider should have nothing to do with baked lighting but whatever, now I know. :) Thanks for taking a look.
     
    Last edited: Jul 12, 2019
  38. Myron

    Myron

    Joined:
    Oct 21, 2012
    Posts:
    8
    Hello, just tried your skybox on my VR god game. It looks awesome but unfortunately it is only displayed on one eye when I activate the single pass instanced stereo rendenring.
    Do you think it is something that can be fixed or it is impossible by design?

    Thank you for your time. Great job.
     
  39. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi Myron,

    I'm not familiar with single-pass instanced stereo rendering. Please give me some time to read the documentation and take a look at what I can do here. Will do my best to figure it out as soon as possible!
     
  40. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Ok, figured it out. To work properly with Single Pass Instanced rendering custom shaders should be modified in a way described on this page: https://docs.unity3d.com/Manual/SinglePassInstancing.html

    In short, the appdata and v2f structs should be modified a bit and few macros should be inserted in the main vert method. Here is corresponding patch: https://gist.github.com/PhannGor/1c4e7598d69956d307dd1bbc98f85bba

    Just tested those changes and all works fine on my machine with mocked HMD and Single Pass Instanced rendering enabled.
     
  41. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    I am having a weird issue. I am only using the SkyboxController Prefab, I am not using the cycle prefabs. Sometimes when the editor is left open long enough, the sky starts to get pink, and sometimes the clouds show up, even though they are off. Once I run my game, it resets to "day" time. I have both top and middle colors both a bluesky blue. Now sometimes, if I start the game, and the editor has turned pink, there will be a pink hue on my objects. as though it is holding on to a value from edit mode before I ran it. If I stop it, and re run it from a "blue" sky I do not see that. I feel like there may be some inner variables that somehow think time is marching on? Any ideas?

    I am running 2019.3.11f1, but this issue has been around for a long time, I'm just getting to working with the sky lately.

    UPDATE! I noticed it happens pretty consistently when I update a script, any script. I'm guessing it causes a recompile, and then my default settings for the sky are changed, but the changes are not reflected in the inspector? Or maybe the changes that happen aren't accessible through the inspector because I'm not using the cycle prefabs?
     
    Last edited: May 10, 2020
  42. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Abended,

    I just want to confirm that we've reproduced the issue. It seems like a bug or compatibility issue with the latest Editor versions (2019.3+). Now working on the fix. I Will let you know as soon as we'll have a solution.

    Thank you for reporting this issue and sorry for the delayed reply!
     
  43. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    Hey no, that's great! Glad you can replicate it!
     
  44. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    Hey, I'm also having another issue, I am still using the same unity version. I am trying to implement some emission on and object, and I've set up a global volume with bloom, bloom is affecting the entire skybox, and washing it out with brightness. Is there any setting I can use to make bloom ignore the sky? Thanks!
     
  45. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Hi @Adended,

    Can you please provide more details? A sample project or at least a few screenshots would be helpful too. Thank you!
     
  46. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    @PhannGor
    Sure I can try to put together a sample for you.
     
  47. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    Here's a screenshot of the bloom affecting the sky. I made a package, but it says file too big to upload in PM (8mb). Easier to see in editor.

    *Edit: I've been doing some reading, and it looks like bloom is affecting all skyboxes. I don't think you have to worry about this, I will find another way!
     

    Attached Files:

    Last edited: Jun 10, 2020
  48. TeKay921

    TeKay921

    Joined:
    Feb 4, 2016
    Posts:
    2
    Hey does this asset work with urp?
     
  49. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    230
    Yes, it should work just fine with URP.
     
  50. Abended

    Abended

    Joined:
    Oct 9, 2018
    Posts:
    142
    Any update on the pink sky fix?