Search Unity

Space Graphics Toolkit & Planets

Discussion in 'Assets and Asset Store' started by Darkcoder, Aug 18, 2012.

  1. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Looks great! You can already use the _DetailMaskMap "Detail Mask (RGBA)" with the different R/G/B/A detail textyres to apply things in different areas. It's not possible to use the terrain's Areas system with this because there can be unlimited areas, and there's no way to set unlimited detail textures and a way to define them in the shader (at least not with the way the shader works currently).


    The floating origin system should already work with Rigidbodies. The "Planet Surfing" demo scene for example uses both, and it seems to work just fine?


    Yes, but you would have to write your own code to generate this procedural texture, and generate atmosphere values like color. The SGT/Planet shader has the _MainTex property, which can be set with your custom texture. The SgtAtmosphereDepthTex component has properties like HorizonColor/OuterColor/etc that can be set from another component.
     
  2. harpingseal

    harpingseal

    Joined:
    Sep 3, 2020
    Posts:
    42
    Ok thank you,So i've just do some research on the water bug and the cause was the STG terrain as when i add a custom sphere instead of the water it still glitch and it is runtime only.That bug on mine will make the water/Sphere surface dissapear.It look like to be a Z-figthing caused by the Lod system but i don't know.Here's my mac Spec IMac (21.5-inch, Mid 2011) processor 2.5 GHz Intel Core i5 memory 10 GB 1333 MHz DDR3 Graphic card AMD Radeon HD 6750M 512 MB
     
  3. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    77
    I don't recall the particulars of what happened to my camera, but as it's a child of a rigidbody (a VR rig as a child of a rigidbody spacecraft using physics for motion), I think there were problems with snapping. If I can find the time I'll set up a simple test scene with a VR rig in a capsule with rigidbody and a couple of floating objects.

    Anyway, it's working with my copy of the code so I'm not hurting!

    BTW, I assume that the floating origin system does not work with static game objects. I had set some of them as static and they no longer moved, which is not surprising... I'm going to use the mesh combiner tool I have to substitute for static batching; it'll attach floating object component to the combined mesh(es) and that should work fine.

    thanks for your time!
     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    I see, perhaps it's an issue with OpenGL as their depth buffers work differently. You can try building for Metal and see if that changes anything. I currently don't have a mac to test this on though.


    VR rigs tend to take over control of the camera so that might be part of the issue.

    I haven't messed with static batching in a long time but I would assume it wouldn't work since the floating origin system requires them to move.
     
    dmenefee likes this.
  5. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    81
    Hi,

    Been having some trouble with the latest SGT for a while now. Unity 2019.4.28, SGT 3.8.5 (latest).
    In the editor, everything is fine, but when I build for Android for example, this issue appears:
    Example: Packs > Basic Pack > Obsidian Planet scene
    Simply touch the screen on Android and the camera movement is erratic (SgtCameraLook is broken). Lowering the sensitivity by a factor of 10 shows that the camera will keep rotating while the finger is down.

    Feels like it's an issue with the new Input System. If I add a Debug.Log in the SgtFloatingWarpPin.cs file at line 102, in the Pick function I will get this spam in the adb log:

    Code (CSharp):
    1. 05-29 20:49:39.606 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtInputManager:Update()
    2. 05-29 20:49:39.606 11608 11653 I Unity   :
    3. 05-29 20:49:39.606 11608 11653 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
    4. 05-29 20:49:39.606 11608 11653 I Unity   :
    5. 05-29 20:49:39.641 11608 11653 I Unity   : Aaaaaaaaaaaaaa
    6. 05-29 20:49:39.641 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtFloatingWarpPin:Pick(Vector2)
    7. 05-29 20:49:39.641 11608 11653 I Unity   : System.Action`1:Invoke(T)
    8. 05-29 20:49:39.641 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtInputManager:Update()
    9. 05-29 20:49:39.641 11608 11653 I Unity   :
    10. 05-29 20:49:39.641 11608 11653 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
    11. 05-29 20:49:39.641 11608 11653 I Unity   :
    12. 05-29 20:49:39.874 11608 11653 I Unity   : Aaaaaaaaaaaaaa
    13. 05-29 20:49:39.874 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtFloatingWarpPin:Pick(Vector2)
    14. 05-29 20:49:39.874 11608 11653 I Unity   : System.Action`1:Invoke(T)
    15. 05-29 20:49:39.874 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtInputManager:Update()
    16. 05-29 20:49:39.874 11608 11653 I Unity   :
    17. 05-29 20:49:39.874 11608 11653 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
    18. 05-29 20:49:39.874 11608 11653 I Unity   :
    19. 05-29 20:49:39.906 11608 11653 I Unity   : Aaaaaaaaaaaaaa
    20. 05-29 20:49:39.906 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtFloatingWarpPin:Pick(Vector2)
    21. 05-29 20:49:39.906 11608 11653 I Unity   : System.Action`1:Invoke(T)
    22. 05-29 20:49:39.906 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtInputManager:Update()
    23. 05-29 20:49:39.906 11608 11653 I Unity   :
    24. 05-29 20:49:39.906 11608 11653 I Unity   : (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 39)
    25. 05-29 20:49:39.906 11608 11653 I Unity   :
    26. 05-29 20:49:39.940 11608 11653 I Unity   : Aaaaaaaaaaaaaa
    27. 05-29 20:49:39.940 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtFloatingWarpPin:Pick(Vector2)
    28. 05-29 20:49:39.940 11608 11653 I Unity   : System.Action`1:Invoke(T)
    29. 05-29 20:49:39.940 11608 11653 I Unity   : SpaceGraphicsToolkit.SgtInputManager:Update()
    In the Nested Orbits scene for example, this will start spamming after you touch a star or planet and it will keep spamming even after the finger is off the screen.

    EDIT: Just found out that even if I chose Horizontal/Vertical Drag in the editor, on Android it appears like a Horizontal/Vertical Pull.

    Anyone been having these issues?

    Thanks
     
    Last edited: Jun 14, 2021
  6. harpingseal

    harpingseal

    Joined:
    Sep 3, 2020
    Posts:
    42
    Also is the new camera broken ? as I my speed far from star and planet is 100 m/s and when i'm close it's the same
     
  7. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    I see this issue too. I'll send you a fix soon.

    I changed the way SgtCameraMove works recently. The Speed Min/Max values are now locked to what you set, and mouse wheel merely changes the SpeedRange setting, which changes the bias between min/max based on your proximity to objects in the scene. Previously the wheel would change the max speed, so you could basically fly away from anything without any control.

    It looks like I didn't properly configure all the speed settings though, like in the Jovian scene.

    In any case, these camera control components are just examples to show off the scenes, they're not supposed to be fully featured and used for a final project.
     
  8. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    81
    I've noticed that the new SGTPlanet Water Gradient/Texture doesn't render on mobile, all my planets don't have water now. Works fine in the editor. Is there a custom setting somewhere?

    Saw the same with SGTTerrain, but thought that that was too performance intensive for a mobile phone.

    EDIT2: SgtPlanet water works on mobile, I was just building the material from scratch using the Planet.shader and forgot some parameters. I couldn't make SgtTerrain work though, built Basic Pack\Earth Sized Planet and I could only see a pink atmosphere and some hexa tiles moving around.
     
    Last edited: Jun 19, 2021
  9. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    Hello,
    I have a question about SGT Terrain Ocean Material. Would it be possible to add shadow casting to the water terrain?
    The water looks excellent btw!
     
  10. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    I just tested the "Planet Surfing" demo scene with a copy+pasted ocean from the "Earth Sized Planet" scene and it works fine on my Galaxy S6 with Unity 2021.1.12f1. The extreme camera ranges used in scenes like "Earth Sized Planet" may not work on all mobile devices or settings though, so you can try reducing it.


    You mean shadow receiving? I don't think this is possible using a normal shader setup. You would probably have to manually sample the shadow data which sounds difficult, especially with SRP being involved.
     
    pratt_timmy likes this.
  11. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,196
    Just had an update notification. Any visual changes or enhancements that you can showcase?
     
  12. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    Yes I mean shadow receiving. And thank you for the reply.
     
  13. Stardog_

    Stardog_

    Joined:
    Jun 1, 2019
    Posts:
    2
    Hi,
    I've bought the SGT asset like a month ago. I love the possibilities and the kind of looks you can achieve with it.
    However i've faced a problem recently : my goal is to make the simplex noise of the terrain planet apply to another procedurally generated scene. I managed to get the heights by using the OnScheduledHeights event and generated a heightmap like this one :
    preview.png

    This heightmap matches with the first half of the planet :
    planet.png
    It is obvious the heightmap is not complete, so does the heights array i managed to find.
    Idk if im missing out on somehting but i really need help.
    Thanks
     

    Attached Files:

  14. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Nothing worthy of an update post :D The albedo detail textures are nice, but they can easily cause the planet shader to exceed the sampler limit so I don't want to point them out too much. I'll look into making the samplers shared to make this less of an issue.


    What's the question? Indeed, you can call OnScheduleHeights/InvokeScheduleHeights to calculate the planet heights from the specified input points. If you're only getting half the planet then you haven't set the input points correctly. These should be normalized directions, and the heights should match the base radius of your planet.
     
    julianr likes this.
  15. Stardog_

    Stardog_

    Joined:
    Jun 1, 2019
    Posts:
    2
    How can i specify these input points ? I've been looking through the code (a really well-made code btw) and i haven't found anything that implies specifying normalized vectors as inputs.
     
    Last edited: Jun 26, 2021
  16. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    I didn't write that part of the planet code with extensibility in mind, so it's not documented. The points array is a NativeArray<float3>, so you would initialize it very similar to a normal array of normalized direction vectors.
     
  17. Steve2375

    Steve2375

    Joined:
    Mar 28, 2015
    Posts:
    33
    Hey, thanks for the great SgtTerrainPlanet component, it builds/renders planets in really super fast speed!

    I have two questions regarding it:

    - I would like to allow to deform the planet terrain during runtime by the player. After updating the heightmap I need a way to trigger the SgtTerrain component to rebuild only the area that changed. The function SgtTerrain.MarkAsDirty() seems to rebuild the whole planet, that is too slow for local updates. If there is no API function for that yet, it might be done somewhere in SgtTerrain.UpdateLod(), maybe you can point me to it.
    Btw: as the code has no comments it is hard for me to understand what is going on, is there a reference you implemented it after?

    - On 5th of Jan you wrote:
    >> I'm currently working on an improved planet terrain asset that should allow you to make something closer to what you see in say Star Citizen, and even this is very tricky to make. I'll hopefully have something to show off here soon!
    Will this be a completely new solution, replacing the existing SgtTerrainPlanet component? Can you already now mention some key features about the new solution? :)

    Thanks for your help!
     
  18. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    1 - The terrain code wasn't designed with editability in mind, so implementing this would be very difficult. The terrain generation is based on the geometry clipmaps technique, but this implementation is probably unlike any other.

    2 - My plan was to make this new asset based on the SgtTerrain class, and while I got some good results, they weren't good enough for a new asset in my opinion. Therefore I've shelved that idea, but I did release the ocean shader which was part of my experiments. I have some ideas on how to achieve what I originally wanted, but it would require yet again writing another terrain system that takes an entirely different approach to achieve the visuals I'm after. These experiments take up a lot of time though, so for now I've been busy working on a another idea (unrelated to SGT) that showed more promise, and indeed it's almost ready.
     
    julianr likes this.
  19. Steve2375

    Steve2375

    Joined:
    Mar 28, 2015
    Posts:
    33
    So for me editing the terrain is only changing the underlying height map and triggering the terrain mesh generator to update. Nvm I think I found how to update only the area around the player:
    :)
     
    pratt_timmy likes this.
  20. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Whoa, nice job. I don't think I would have been able to implement it that quickly!
     
    Steve2375 likes this.
  21. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    @Darkcoder
    I was hoping I could get some help with using the SGT Starfield Custom component.
    I'm using the SGT Starfield Custom to render a procedurally generated galaxy which works fairly well but I've been having some problems and I can't figure them out on my own unfortunately.
    The code I'm using is pretty simple. I populate the List<SgtStarfieldStar> Stars in SgtStarfieldCustom.

    The first problem I'm having is the brightness of the starfields. They are way to high. Brightness field needs to be turned way down or else things look unusual when at 1.
    upload_2021-6-30_16-36-0.png
    upload_2021-6-30_16-38-35.png
    Last problem is when trying to use the Power RGB option. I get this result no matter how I fiddle with stuff.
    upload_2021-6-30_16-47-22.png
     
  22. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Hmm, strange that it would be so bright. Can you let me know the exact version of Unity you're using, render pipeline, and build target? Does this issue occur with the normal starfields when using this same star texture, or only custom starfields?
     
  23. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    Using Unity version 2020.3.12f1. Recently upgraded from version 2020.1.4f1 and I was having the same problem in that version. This project is using the Built-in render pipeline. Using PC, MAC, & Linux Standalone platform; Target platform is Windows.
    As far as I can tell it's only the Custom starfields that has this issue. I just tested the other starfields to make sure and when using the same texture. They work fine.
     
  24. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    Ok I figured out what I was doing wrong. Nothing wrong with your code.
    I knew I should have shared the code I was using. You would probably have easily spotted what I was doing wrong.
    I was using RGB 0-255 in the code like a fool LOL
    Sorry for wasting your time.
     
  25. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Aha, yes this is an easy mistake to make, glad you found the solution :)
     
    pratt_timmy likes this.
  26. Rodneyk

    Rodneyk

    Joined:
    Jun 25, 2018
    Posts:
    2
    Question: is it possible to generate a 'map' of the universe you create. If not, what is the best way to achieve this?
     
  27. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    There's no built in feature to do this. There is no 'best' way, but what I would do is make a new component called something like MapMarker that has settings like Icon, Title, Color, etc. I would then make some sort of 'MapManager' component that listens for when these get added to the scene, and this would make a UI element associated with it, or some other technique depending on how you'd want it to look like.
     
    gRtVnAUoolam1492 and Rodneyk like this.
  28. Rodneyk

    Rodneyk

    Joined:
    Jun 25, 2018
    Posts:
    2
    Thanks, I understand. Will start working on it.
     
    Darkcoder likes this.
  29. Steve2375

    Steve2375

    Joined:
    Mar 28, 2015
    Posts:
    33
    I have a bug report concerning the SgtTerrainCollider component: at some locations on the planet there are 'gaps' or 'missing chunks'. This is pretty bad as it will cause the player to fall down there.

    It is easy to reproduce:
    1. load the demo scene '05 Collider' located in 'Space Graphics Toolkit/Features/Terrain'
    2. click on the 'Main Camera' transform and set these values to set the camera at the location where the problem occurs: Position: X=727 Y=150 Z=-701
    3. set the properties for the SgtCollider on the 'Terrain' GameObject to Resolution=100, Radius=3 (it will happen also for other value combination)
    4. hit 'Play' and check in the scene view that there is a stripe of chunks missing

    I would be super happy if there was a bug fix, feel free to send me the fix in a private message
     

    Attached Files:

    Last edited: Jul 7, 2021
  30. pratt_timmy

    pratt_timmy

    Joined:
    Jun 30, 2019
    Posts:
    21
    Would it be / is it possible, to bump up the number of shadows that can be cast onto sgtShadowLayer, sgtJovian, and etc.? After doing some testing and looking through the documentation and code it looks like the most shadows that can be cast onto a opaque renderer is two.
     
  31. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Thanks, I can replicate this issue. I'll see if I can fix it.


    I'm currently working on an update to SGT that rewrites almost all the shaders to use Better Shaders. While doing this I've rewritten the shadow system to support any number of shadows. I still need to iron out many issues with HDRP and such, so it may take at least a week to be ready.
     
  32. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Hey everyone,

    Here's a sneak peak of a new demo scene I'm working on for the next version:

    upload_2021-7-10_23-22-26.png

    This is using the new rewritten Spacetime feature, which has greatly increased spacetime well limits, and much more flexible visual settings.

    I've now more or less finished rewriting/converting all the shaders to use Better Shaders, so there's near full compatibility with all rendering pipelines, and adding new features to any of the shaders is much easier.
     

    Attached Files:

  33. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,196
    Hi. On the latest update (not sure if it does it on previous versions), under full screen Unity editor, using the Basic Pack / Water Level, my GPU maxes out to 100% from a stead increase of 60-66%, not full screen its fine. Unity 2020.1.8f1
     
  34. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Hey everyone,

    Version 3.9.0 of Space Graphics Toolkit is now out!
    • NOTE  This is a huge update. Back up your project files before installing.
    • Fixed scenarios where SgtTerrainCollider could cause gaps.
    • Fixed scenarios where SgtTerrainPrefabSpawner could cause gaps.
    • Fixed SgtStarfieldInfinite.Pulse setting.
    • Rewrote Accretion shader for better HDRP compatibility.
    • Rewrote Atmosphere shader for better HDRP compatibility.
    • Rewrote Aurora shader for better HDRP compatibility.
    • Rewrote Backdrop shader for better HDRP compatibility.
    • Rewrote Belt shader for better HDRP compatibility.
    • Rewrote Billboard shader for better HDRP compatibility.
    • Rewrote Cloudsphere shader for better HDRP compatibility.
    • Rewrote Corona shader for better HDRP compatibility.
    • Rewrote Flare shader for better HDRP compatibility.
    • Rewrote Jovian shader for better HDRP compatibility.
    • Rewrote Lightning shader for better HDRP compatibility.
    • Rewrote Prominence shader for better HDRP compatibility.
    • Rewrote Ring shader for better HDRP compatibility.
    • Rewrote Spacetime shader for better HDRP compatibility.
    • Rewrote Star shader for better HDRP compatibility.
    • Rewrote Starfield shader for better HDRP compatibility.
    • Rewrote Thruster shader for better HDRP compatibility.
    • Added Basic Pack / Continuum demo scene.
    • Added SgtCameraPivot component.
    • Added SgtAtmosphere.ScatteringHdr setting for HDR rendering.
    • Added SgtAtmosphere.InnerOffset setting.
    • Added SgtAtmosphere.AmbientBrightness setting.
    • Added SgtAtmosphere.MaxLights setting.
    • Added SgtAtmosphere.MaxSphereShadows setting.
    • Added SgtBelt___.AmbientBrightness setting.
    • Added SgtBelt___.MaxLights setting.
    • Added SgtBelt___.MaxSphereShadows setting.
    • Added SgtCloudsphere.AmbientBrightness setting.
    • Added SgtCloudsphere.MaxLights setting.
    • Added SgtCloudsphere.MaxSphereShadows setting.
    • Added SgtCorona.InnerOffset setting.
    • Added SgtJovian.AmbientBrightness setting.
    • Added SgtJovian.MaxLights setting.
    • Added SgtJovian.MaxSphereShadows setting.
    • Added SgtRing.AmbientBrightness setting.
    • Added SgtRing.MaxLights setting.
    • Added SgtRing.MaxSphereShadows setting.
    • Added SgtSpacetime.MaxGaussianWells setting.
    • Added SgtSpacetime.MaxRippleWells setting.
    • Added SgtSpacetime.MaxTwistWells setting.
    • Added SgtSpacetime.MaxPinchWells setting.
    • Added SgtSpacetimeWell.Distribution = Pinch setting.
    • Added SgtSpacetimeWell.Opacity setting.
    • Added SgtSpacetimeWell.Combine setting.
    • Added Spacetime / Pinch Well demo scene.
    • Added Spacetime / Styles demo scene.
    • Allowed touch controls to be inverse of mouse controls.
    • Updated all demo scenes for linear color space.
    • Updated all shaders to use local keywords.
    This is a massive update - though the changes are mostly internal, so you should be able to update most projects without issue. If you do update, make sure you delete the old SGT folder first, because many of the shader files and such were moved around.

    One exception is the Spacetime feature, which was (almost) completely rewritten, so you will have to re-configure these from scratch to get them working again. I recommend looking through the Features/Spacetime demo scenes again to learn how they now work, or reading the documentation HERE.

    The light and sphere shadow limits have now been increased to 16, though the default max values are set to what they were before, you must manually increase the MaxLights or MaxSphereShadows settings if you want to use this.

    HDRP support was also vastly improved, and now almost all features work as expected. Keep in mind you may need to manually tweak some demo scene settings to get them to look the same as the other pipelines (more info HERE), as the way these renderers work is different and I don't want to make multiple versions of each scene.

    Enjoy :)


    Enable vsync? It's supposed to use all available GPU power unless you artificially limit the framerate.
     
  35. julianr

    julianr

    Joined:
    Jun 5, 2014
    Posts:
    1,196
    Yeah, that fixed it. It's the only scene it has an issue with 1700+ fps, 100% max and fan starts to go mental :) I should really keep vsync on, but keep forgetting as my game doesn't need it. Nice update - thanks!.
     
    Darkcoder likes this.
  36. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    108
    Hi, this looks like a very interesting tool for a projects needing lod planets, I've read through the forum on here and I've seen a lot of questions regarding foliage/trees etc, a very valid request. Your probably thinking <sigh> not another one, but I'm not, my question is, does your lod planets components produce a mesh filter and mesh renderer? If so there is promise for users to adapt your lod planets with other packages, one springs to mind, Polybrush. As long as they have access to the mesh filter and maybe even add a mesh collider this could in theory be used with other packages providing a foliage system? Perhaps I'm missing something about how you render the mesh?
     
  37. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    There are currently 2 ways to add objects to LOD terrain planets:

    A) Manually place them in the editor with/without the help of the SgtTerrainObject component.

    B) Automatically using the SgtTerrainPrefabSpawner component.

    Both approaches work with normal GameObjects, so I imagine they would work with PolyBrush. Approach B procedurally places objects though, so any modifications you do to one specific object will be lost unless you modify the code to specifically replace one instance of an object with something else.
     
  38. AlanEvo

    AlanEvo

    Joined:
    Mar 29, 2018
    Posts:
    108
    That's correct, Polybrush is fairly in tune with placing surface textures and objects, like grass and trees to spherical based objects, proving the mesh has a mesh filter. Would be a nice example to show off ;)
     
  39. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Oh, the planet surface itself is rendered with Graphics.DrawMesh, so if Polybrush requires MeshFilter + MeshRenderer to place objects then I guess it wouldn't work. The surface uses normal MeshColliders though.
     
  40. AkhaSkull

    AkhaSkull

    Joined:
    Mar 6, 2014
    Posts:
    8
    Hello.

    I pop flares in space, and everything goes well when I launch the scene in the editor.
    But when I build and run, all the flares are pink.
    Using SGT 3.9.0 and Unity 2020.2.1f1.

    Any advises ?

    Thank you.
     
  41. aggaton

    aggaton

    Joined:
    Jul 3, 2021
    Posts:
    79
    According to the docs there is supposed to be a dropdown menu for Background, however it is not visible after I install this package. I see only: Shape, Atmosphere, Cloudsphere and Planet.
     
  42. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    I just made a new project with Unity 2020.2.2f1 + SGT 3.9.0 + 00 Flares demo scene, and it works without issue both in the editor and in a Windows 10 build. You'll have to narrow it down so I can replicate the issue.


    There's no feature called background in Space Graphics Toolkit or Planets, maybe you're thinking about Backdrop? The Backdrop feature is part of the Space Graphics Toolkit asset, not Planets. Planets comes with the Backdrop shader though, which is part of the Shared feature as mentioned in the Read Me ("The background is made using the SGT / Backdrop shader, which is part of the Shared feature."). You can copy+paste the Background GameObject from the example scenes to add it to your own.
     
  43. aggaton

    aggaton

    Joined:
    Jul 3, 2021
    Posts:
    79
    I purchased the Space Graphics Planets package and when I add it my project I get some compile errors

    Code (CSharp):
    1. Assets\Space Graphics Toolkit\Features\Belt\Scripts\SgtBelt.cs(26,162): error CS0117: 'SgtLight' does not contain a definition for 'MAX_LIGHTS'
    2.  
    3. Assets\Space Graphics Toolkit\Features\Belt\Scripts\SgtBelt.cs(29,191): error CS0117: 'SgtShadow' does not contain a definition for 'MAX_SPHERE_SHADOWS'
    4.  
    5. Assets\Space Graphics Toolkit\Features\Ring\Scripts\SgtRing.cs(85,162): error CS0117: 'SgtLight' does not contain a definition for 'MAX_LIGHTS'
    6.  
    7. Assets\Space Graphics Toolkit\Features\Ring\Scripts\SgtRing.cs(88,191): error CS0117: 'SgtShadow' does not contain a definition for 'MAX_SPHERE_SHADOWS'
    8.  
    9. Assets\Space Graphics Toolkit\Features\Jovian\Scripts\SgtJovian.cs(55,162): error CS0117: 'SgtLight' does not contain a definition for 'MAX_LIGHTS'
    10.  
    11. Assets\Space Graphics Toolkit\Features\Jovian\Scripts\SgtJovian.cs(58,191): error CS0117: 'SgtShadow' does not contain a definition for 'MAX_SPHERE_SHADOWS'
    12.  
    13.  
     
  44. aggaton

    aggaton

    Joined:
    Jul 3, 2021
    Posts:
    79
    Thanks for your answer!

    So I uninstalled all my packages and then reinstalled Space Graphics Toolkit, I now have the menu options. There seem to be a lot of packages that are incompatible and renders other packages unusable. I tried to identify the bad package, however after I installed all that I had before, the menu still works, weird. Might have been the Space Sim Framework, I had all sorts of other issues with that package.

    I still have below issues when trying to add Space Graphics Planets package, various constants are not defined in SgtLight and SgtShadow
     
  45. chalupaul

    chalupaul

    Joined:
    Oct 2, 2018
    Posts:
    3
    I'm getting the same. Unity 2020.3.14f1 on windows.
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Yeah I haven't had time to update Space Graphics Planets yet, a fix will be coming out very soon!

    [Edit] Update is now out!
     
    Last edited: Jul 29, 2021
    aggaton likes this.
  47. AkhaSkull

    AkhaSkull

    Joined:
    Mar 6, 2014
    Posts:
    8
    I use URP. I think that could be somewhere in. :)
    So i work on it.
    Depth Texture and / or Opaque Texture Enabled / Disabled. No change.

    My Renderer :


    My URPipeline :


    The Project Graphics Settings:


    Also, i try to upgrade the project materials. No Change.

    Thank for your help.
     

    Attached Files:

  48. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,769
    Still works as expected when I use URP. It looks like you're using a 2D renderer though, maybe that's the issue. Try making a new project with the URP template, which should work with SGT.
     
  49. AkhaSkull

    AkhaSkull

    Joined:
    Mar 6, 2014
    Posts:
    8
    Thank for your answer and your advise.

    I try a lot of things with the parameters of the graphic pipiline, but no change.
    So i launch a building with the debug options acivated.
    The first error message is :
    WindowsPlayer(DESKTOP-22KAMPN) Failed to find shader: Space Graphics Toolkit/Flare
    who is been generated by SgtFlareMaterial.cs, line 167:
    Code (CSharp):
    1. public void UpdateMaterial()
    2.         {
    3.             // Create?
    4.             if (generatedMaterial == null)
    5.             {
    6.                 generatedMaterial = SgtHelper.CreateTempMaterial("Flare Material (Generated)", "Space Graphics Toolkit/Flare");
    7.  
    8.                 ApplyMaterial();
    9.             }
    10.  
    11.             generatedMaterial.renderQueue = RenderQueue;
    12.  
    13. ...
    I put Space Graphics Toolkit/Flare in the always included shaders list , in the graphics project setting,
    and it work, the flares show up after building, no more pink bubbles.

    :D
     
  50. GTG101

    GTG101

    Joined:
    Feb 1, 2017
    Posts:
    8
    ErrorMessage.png Screenshot (10).png I'm getting errors, please help.
     
unityunity