Search Unity

Planets 1.4.1 Meet new PBR shaders, multiple lights, environment. Amplify Shader Editor support!

Discussion in 'Assets and Asset Store' started by s7, Jan 8, 2015.

  1. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    I re-applied the corono fix + removed the self-shadowing thing just like before, no problem.

    Mo' testing, mo' problems. See attached screenshot. Looks like the atmosphere shader is all off. Again: a mere 20 hours ago this was all working. Only updating to 5.2.1 since then.

    Now, in my game I am using an ortho cam. If I change that to a perspective cam, changing nothing else mind you, the atmosphere is in place. This is new. One benefit of your package compared to Imphenzia's planets is that your assets worked out of the box with an ortho setup. I only had to adapt the sun coronas.

    Did anything change related to ortho cams in Unity 5.2.1?

    If I did a full re-import of your Planet package, wouldn't my Prefabs become worthless then?

    If I wanted to throw away temp/cache files, how would I even do that? In three years of using Unity that would be my first. I was always able to solve problems through other means.
     

    Attached Files:

  2. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Sometimes it is wise to freeze engine updates. Do you get any benefits? Unity may just release another update tomorrow and everything which worked yesterday might just be failing. Its your call. Unfortunately you will have to face it one day.

    Release notes for 5.2.1: https://unity3d.com/unity/whats-new/unity-5.2.1

    Be careful about prefabs and materials. Theoretically it should not, however I have had my project materials reset just because of switching color space.

    To force it rebuild the project you have to remove everything but Assets and ProjectSettings folders.

    And don't forget to backup.

    Hope this helps.
     
  3. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Did more testing. Sorry to tell you this, but it's not me it's you :) Created a 100% new project in 5.2.1, did a 100% new download of the Planets asset. Fixed the SunCorona shader. Tested the Planet_Examples_Linear scene.

    Perspective camera -> everything fine
    Ortho camera -> atmosphere off (see attached screenshot)

    Please look if you can fix this. Maybe fire an email to Unity if necessary, as an asset creator your word will have a bit more weight than mine. I need an ortho cam in my game, and people with from-above / strategy game setups will too. As I said, ortho compatibility is a major argument in favor of your asset. It was there in 5.2.0.
     

    Attached Files:

  4. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    No need to hassle. Play with the atmosphere offset. You know this thing is already goes beyond because I have modified things for you. Also 5 minutes ago you said everything worked fine.

    Do you remember what you did to fix the ortho camera before? You just tried fresh downloaded asset. Could be that you forgot to change something? Make sure to check everything before posting another update.
     
    Last edited: Sep 24, 2015
  5. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    I didn't mean to hassle. Yes, 5 min ago I said everything worked fine. That was about the shader errors. Then I tried my actual game and noticed the garbled atmosphere.

    I can look at the atmosphere offset, yes. Problem is, I am using your asset pretty much unchanged. There isn't anything I forgot to re-apply.

    Meanwhile, can you reproduce the problem? What do you get when you change the cam from perspective to ortho in your Planets_Examples_Linear scene?
     
  6. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    No I can't reproduce it. It just works in orthographic mode on my end.
     
  7. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    What? OK, that's weird. Have you tried Win vs. Mac? Shouldn't make a difference, I know. But with Unity you never know.

    Say, could the scaling of GameObjects in the scene have an effect? Your demo often has a scale of 0.9 or 1.0, whereas I use something larger.

    Screenshot of my cam settings attached. Notice this is not my own project, it's the Planet demo scene, fresh project.

    EDIT: I will now go and delete the temp files of my main project and see if that helps. I will also see if I can replicate this on my MacBookPro, which uses an older Unity 5.x version.
     

    Attached Files:

    Last edited: Sep 24, 2015
  8. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Alright. Did a project reset on my main machine, to no avail.

    Took my 2007 MacBookPro. Fresh X.9.5. Fresh Unity 5.1.3f. Fresh download of Planets asset from the store. Scaled all relevant textures to 1K, applied no-self-shadowing method, but not 5.2-specific corona fix. The good news is that with the self-shadowing method applied, I got around 15-25 fps for the Planet_Example_Linear scene, which was a slideshow before (graphics card should be a 8600M w/ 128 MB VRAM) - not bad at all.

    The bad news is that setting the cam to ortho has the same atmosphere offing effect. See attached screenshot. So that was with Unity 5.1.3f. Now I don't really know what to think anymore, since on my main machine it worked with 5.1.3 and 5.2.0 o_O
     

    Attached Files:

  9. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    I have latest MacBook Pro with AMD Radeon M9 and of course I have tested on my PC.

    But the important thing is - you should be using right angle with your orthographic camera only. I think I said this before you even brought it, if you remember.
     
    Last edited: Sep 25, 2015
  10. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Well I don't know what an "M9" is, but doesn't matter anymore ... Because I found the problem. It wasn't your fault, it was mine. So, yeah, I apologize for making a fuss. I tried to point you to a problem that simply didn't exist.

    I was up yesterday until 3am going through my backups to find the culprit. And see, in March of this year I did edit the Atmosphere.shader, line 189 and 190 to:

    Code (csharp):
    1.  
    2. //     float3 viewDirection = normalize(_WorldSpaceCameraPos.xyz - i.posWorld.xyz);
    3.      float3 viewDirection = float3( 0, 1.0, -0.425 );
    How I arrived at these magic values, I don't remember. But with my camera having a rotation of x = 66.67 it works. And that camera rotation or (relative) position won't change. The problem started when after the update to 5.2.1 your shaders produced the errors I mentioned on page 2, related to the .cginc imports. So I re-imported the shaders and lost my edits which I had long forgotten.

    Another thing that didn't work were the planet's rings. They just weren't rendered, even though the geometry was there. Turns out that I took issue with your scaling of those rings. So, I changed the import setting of the ring model to 11.25 and hit apply (instead of changing the scale of the GameObject). The ring disappears when you do that. I don't know why. So I went back to setting the model to scale 1 and scaled the GameObject, which I don't like - I always go and scale the model itself, which works better with PoolManager.

    Btw, you were also right when on page 1 of this thread you said an ortho cam can work with your Planets_Example_Linear demo scene if you push the cam out far enough. It won't work at it's default position, but it will if you push it 150 world units out, let's say. I guess that is what you did without mentioning it explicitely?

    So, again, sorry for causing a fuzz here.
     
    Last edited: Sep 25, 2015
  11. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Hey. No worries. I completely understand how frustrated you were at that moment. The most important thing is that the issue is solved and you can continue working on your project. The distance from the orthographic camera to the planet matters in your case, so I guess I mentioned it somewhere in my previous post back that day.
     
  12. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    Using Planets shaders with some procedural height mapping has allowed us to create a huge universe.

    I'm only showing three planets, we don't have all day do we?
     
  13. wrench_nz

    wrench_nz

    Joined:
    May 13, 2014
    Posts:
    11
    Hi,

    Can this asset be used to randomise planet look @ runtime?

    Thanks.
     
  14. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Hey,

    It has no "Randomize" button. It's a shader framework with set of textures and planet prefabs.

    However, if you take a look at the video above your post, you can see that it is completely possible to add randomization to it. And all this can be done at runtime though.

    So to answer your question - yes, this asset can be used to randomize planet look at runtime.
     
  15. reevolution

    reevolution

    Joined:
    Feb 25, 2015
    Posts:
    4
    Hello Dude.
    With planets all work fine.
    But with sun i got some problems. I just run Demo and got this. I nothing change.

    I have unity Version 5.2.2f. Direct X 9.

    Can i fix it? Or this version asset Sun.png dont support this ?
     
  16. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Hey,

    Open SunCorona.shader and goto line 48. Comment empty pass line. It should look like this:

    // Disable Dynamic Batching
    // Pass{}

    Don’t forget to save!
     
  17. reevolution

    reevolution

    Joined:
    Feb 25, 2015
    Posts:
    4
    Thanks Dude all work.
     
  18. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Is there something special I need to do. In order to change the scale of a planet?
    Its been several months since I last used this Asset and I have another scene I use this in with a scale of 12000 with zero issues.

    But now that im using the asset again if I increase the scale past 3 or so the atmosphere texture goes away.
    Thinks its just the Z axis
    By looking at my other scene I can't see anything I'm doing different.
    Its as if the atmosphere/planet surface doesn't scale with it

    Edit: if I set two of the axis to 12000 and one axis to 1 it works.
    but of course now its not 3d lol.
    so it messes up as soon as I increase any of the 3 axis as the 3rd axis
    Using Unity 5.2.3
    Does in game and scene window and on runtime
     
    Last edited: Dec 7, 2015
  19. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Make sure you check on the vertex offset parameter in atmosphere material and modify if needed.

    Let me know if it helps.
     
  20. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Hi,

    as reported in the Sci-Fi Effects thread there are some problems with Unity 5.3. Forge3D/Planets/Atmosphere, /Planets/Ring, /Planets/Sun Corona are "broken". The Planets/Terrestrial materials are also pink, but the shader shows no error. The entire F3D Planets demo scene is pink. Will investigate further ...

    EDIT: Actually ALL shaders in the planets package appear pink, linear and gamma. But only the mentioned three shaders also show warnings in the Inspector.
     
    Last edited: Dec 10, 2015
  21. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Are you sure??? I have no issues with 5.3 :/

    Did you try fresh import?
     
  22. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    By the way the new update is on the way. Some minor fixes to make sure it runs fine on 5.3
    Will keep this updated if theres something else coming up.
     
  23. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    A quick fix for 5.3 GLCore users before the asset gets updated.

    Open all the pink shaders and comment this line

    // #pragma only_renderers opengl d3d9 d3d11

    This should make it work on GLCore.

    Can someone please confirm this works on OS X?
     
  24. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Yes, I can confirm that commenting that line throughout the Planets project does fix the pink materials problem. So ... cool thanks.

    It does not fix the problem of the Sun Corona being white in Editor mode *and* in Play mode. This is related to the Sci-Fi Effects problem, where the nebula + tunnels have this problem, more in that thread.

    Here a screen. As you can see, the Sun Corona is white in both modes. Unlike the Nebula Billboard Shader from the Effects package (see thread).

     
    Last edited: Dec 11, 2015
  25. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Just wondering, have you got Pass {} line commented in both corona and nebula files?
     
  26. Bradamante

    Bradamante

    Joined:
    Sep 27, 2012
    Posts:
    300
    Yes, I have, but it doesn't seem to make a difference if it is commented or uncommented. I get a
    Code (csharp):
    1.  
    2. Shader warning in 'FORGE3D/Billboard Nebula': Shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    warning no matter what. It's the only shader in the Effects package that does that.
    Since I re-opened the project the error behavior changed too. Now it'S just pink instead of white.
     
  27. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Try keeping only three following pragma lines in the header:

    #pragma vertex vert
    #pragma fragment frag
    #include "UnityCG.cginc"

    Also Pass {} started to break shader after 5.2, and it was causing to render the mesh as complete white square.

    Let me know if that makes any difference. Also if the following solution will not have any effect on OpenGL 4.1 on OS X, I will recreate the same shader in Shader Forge and send it to you for testing.
     
    Last edited: Dec 13, 2015
  28. Huracan-LP670-4

    Huracan-LP670-4

    Joined:
    Oct 15, 2015
    Posts:
    37
    add more planets make them have cores and mantles in side them
     
  29. Dinokin

    Dinokin

    Joined:
    Oct 11, 2015
    Posts:
    1
    hi friend! this asset is superb!!!! \o/

    i would like to know if it's possible to add stuff like black holes and pulsars in future versions?
     
    Last edited: Dec 13, 2015
  30. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    There is around 40 prefabs for both linear and gamma color space (meaning they have different materials).
    How do you see cores and mantles improve the asset?
     
    Last edited: Dec 14, 2015
  31. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Hi! Check Sci-Fi Effects as it may contain the stuff you mentioned. Pulsar, or more rift looking effect (you can use it for worm holes, or anomalies like that) will be added with the next patch. Thank you!
     
    Dinokin likes this.
  32. Huracan-LP670-4

    Huracan-LP670-4

    Joined:
    Oct 15, 2015
    Posts:
    37
    so the asset has cores or mantles?
     
  33. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Not really. I dont have any plans on adding them in future. Just wondering why you asked for such a thing?
     
  34. Dreamer

    Dreamer

    Joined:
    Mar 8, 2011
    Posts:
    67
    Well done! Nice planets!

    1. Is the planet customisable? I see it's said to be have procedural materials. Does that mean I can create infinite number of planets that are not looking identical?

    2. Can you please create a mobile version? Some authors create mobile versions for assets. Of course the quality will be reduced, but try your best? I'm sure more people including me would like to buy it if there is a mobile version. As you may know that the number of Unity developers developing for mobile platform are far more than PC.
     
  35. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Thank you very much! Yes you can fully customize and each planet type has it's own material options. I would say its semi-procedural, as there are no texture mask or noise generators, though it gives you a huge variety with the includeed texture samples.

    I had no plans for mobile version support, however there might be a chance of baking the complex shader output to a simple RGB texture. This will allow mobile devs to enjoy the asset on their devices without loosing the quality that much.
    I'm sure I'll get back to this, when I'm done with the current asset in production. Thanks!
     
  36. Dreamer

    Dreamer

    Joined:
    Mar 8, 2011
    Posts:
    67
    Baking into a texture is a nice idea, but I would like to create dynamic beautiful planets in run-time randomly. Anyway, thanks for your answer. I do look forward to it if you get back to this. :)
     
  37. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Why are the shadowed areas of my planets grey instead of black? They don't look nearly dark enough :(

    I am using the linear versions.
     
  38. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Have you tried playing with ambient color? This should help you tweak the shadowed areas to match them with your scene background.
     
  39. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Thanks I am still new to Unity and wasn't sure where to set that but I finally found it and that works.

    As an aside, what if I wanted to disable shadows completely?
     
  40. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Did you mean shadows cast by other planets? I have dropped the support for that since the last update. Make sure to update the asset if you haven't done so. Hope this helps!
     
  41. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    No I mean the self shadowing. As cool as the shadows look, I also want the option to disable them if I can. I know it probably means making a different copy of the shader, but if you could maybe guide me in what I would need to change?
     
  42. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    You can attach F3DSun script to your camera. This would give you a front lighing without changing single line of shader code. Does this makes any sense?

    If you really want to mess with the shaders, which I dont recommend, you need open the planet shader you want to modify and see what happens in the fragment shader part. You can find most of the functions being called in the PlanetPS.cginc file. For example, start with the earthlike type and comment out some lines which start with basecolor = to see what happens and how changing the function affects the shadows. You should start with AddDiffuse as it handles the lighing, as well as original pData.DiffuseFactor, which contains light/shadow mask, if you can call it that way
     
  43. jwvanderbeck

    jwvanderbeck

    Joined:
    Dec 4, 2014
    Posts:
    825
    Yeah that does. I'll give it a try.

    Thanks!
     
  44. Superjayjay

    Superjayjay

    Joined:
    Mar 28, 2013
    Posts:
    69
    I absolutely love this asset, but I have one nasty issue. Seems like soft particles colliding with planets act like normal particles and use soft particles a lot for a halo like effect as well as space fog.
    ie:


    Image 1 is what happens and Image 2 is what should happen. Pretend the rabbit is a planet :)

    If it helps have the latest 1.2 version, I'm using DX11 and gamma lighting. Usuing unity 5.2.2 though this happened in previous builds.
     
  45. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476
    Hey Superjayjay, thank you very much! For some reason Unity fails to render soft particels properly when you have a custom cg shader. Theres a little trick though. Create a new sphere, remove the collider and aligh it with the planet. Make sure it sits just underneath the planet. Adjust sphere's scale by a tiny ammount to finetune. Now see how your soft particles start to render properly interacting with the default sphere material underneath the planet.

    Hope this helps, well actually it will as I am using the same trick with my planet :)
     
  46. TreseBrothers

    TreseBrothers

    Joined:
    Jan 14, 2016
    Posts:
    20
    Hi - I am pretty new to Unity and having a funny issue with your beautiful planets pack.

    The prefabs add to my scene very nicely. However, in the editor as I change the X,Y, or Z position of one of the prefabs (such as sand_03_gamma), the planet goes "dark" -- the prefab just becomes a gray sphere basically losing its surface and atmosphere. Notably, I can click on the prefab and drag or rotate it without issue, this only occurs if I manually modify X, Y and Z position.

    My apologies -- I am very new to Unity and just starting to learn. Notably, this does not happen in your example scene.

    Any help would be greatly appreciated! I have attached two screenshots -- #1 is before the change and #2 is directly after the change.

    unity-planets-1.jpg

    unity-planets-2.jpg
     
  47. TreseBrothers

    TreseBrothers

    Joined:
    Jan 14, 2016
    Posts:
    20
    Ok -- I figured out my own issue. It would be great if someone could confirm my understanding of this.

    My scene lacked an object with a Script > F3D Sun. Updating the X,Y, and Z of an object manually was causing some kind of update cycle on the planet shadows that put the planet into pitch black.

    I have added a sun and moving along.
     
  48. Mazak

    Mazak

    Joined:
    Mar 24, 2013
    Posts:
    226
    You don't have to have a sun, but the planet cannot reside at x0,y0,,z0 without some changes.

    you can see this if you move the planet away from origin
     
  49. s7

    s7

    Joined:
    Aug 7, 2014
    Posts:
    476

    Hey,

    Glad you firgured out on your own, however, moving the planet to zero location without having F3DSun script will cause you this issue. Let me explain why: All the shaders have the custom sun source position set at the origin of the world by default (zero coordinates).

    So what happens when you move the planet to world origin, is that it covers the light comletely. Now if you add F3DSun to any gameobject, set it to your desired position, and then click autoupdate checkbox will instantly update the light source position inside the shader.

    You dont have to have it in the scene all the time, for example, if you have a static setup, though I like to have it there just for convinience.

    Hope this helped and let me know if you have further questions.
     
  50. hurleybird

    hurleybird

    Joined:
    Mar 4, 2013
    Posts:
    258
    5.3.1p3 seems to have broken things pretty significantly. For example, here are the stars after a fresh import in a new project.
     

    Attached Files: