Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Space Graphics Toolkit & Planets

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

  1. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    I should mention I'm working in VR, so its more demanding. I'll run some tests on the earth size example.

    I think its just the sheer volume of terrain being generated. Is it possible to completely switch off any terrain generation beyond the horizon? When I'm standing on one size of the planet I don't need the other side being built, even at a low resolution... I've noticed the frame rate is at its worse when I look down.
     
  2. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Can I also make a request? Other large scale planet generating assets I've used had a "grass" feature that allowed you to cover the entire surface (or biomes) with sprite grass (or any sprite) with very little overhead... far less demanding than spawning prefabs. Is that something you can add? Take a look at the "planetary terrain" asset on the store to see what I mean.
     
  3. PolarEclipse

    PolarEclipse

    Joined:
    Oct 11, 2021
    Posts:
    16
    Welcome back @Darkcoder !
    Was getting worried, I hope everything's all right for you :)
     
  4. javanoob

    javanoob

    Joined:
    Aug 15, 2012
    Posts:
    64
    Ok im struggling lol I want to drive a car (standard asset) around a planet surface (like full earth ,is this possible ,I get you need to swap SGT gravity on the car but im kinda lost :(
     
  5. PolarEclipse

    PolarEclipse

    Joined:
    Oct 11, 2021
    Posts:
    16
    Hey @Darkcoder, I noticed a difference on how Black Holes are rendered in VR, between PCVR and Quest builds.

    Both versions use Multi-pass, and are on the same Quality Settings (Ultra).
    I'm using Unity 2021.3.21f1, with built-in render pipeline.

    The distortion effect seems to be broken on PCVR build:
    PCVR Screenshot.png


    The distortion effects works much better on Quest build, however it shows a kind of mirrored, small black hole at the center Oculus Quest Screenshot.jpg

    Anything I can do on my end to get the same result on both versions?

    Thanks in advance :)
     
  6. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    I have also a stake in that, as I am trying to make huge planets (256 KM) performant on mobile. If the absolute size of the planets are really an issue, I would be thankful for any info / approach to tune it without loosing quality in the visbile area.
     
  7. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    I am planning to create a knowlegde sharing group on SGT if it doesn't exist yet, so we can exchange valuable know how and best practices. This thread seems rather limited for parallel trouble shooting and exchange.
    Please send me a message if you like to participate and we can set it up together.

    @Darkcoder, what about a discord community server? I can help set it up and maintain it.
     
    Last edited: Aug 20, 2023
    Sabso, raydekk, Vielfalt and 2 others like this.
  8. Vielfalt

    Vielfalt

    Joined:
    Jun 14, 2023
    Posts:
    3
    Hi @Darkcoder,
    I'm just started using SGT so forgive me if I'm wrong, but I think there's an issue with the "VR Stars" example, it doesn't seem to contain any Starfields? (Unity 2022.3.7f1)
     
    Last edited: Aug 22, 2023
  9. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    94
    Great idea, would love to join.
     
  10. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    @Darkcoder any chance to make the sun visible from below ocean surface?
    also, it looks like even with inner fog at 0.99, underwater looks too clear. Can we make it more dizzy?

    EDIT: FIXED. The Atmosphere(Underwater) Height was too low!

    upload_2023-9-15_11-46-57.png
     
    Last edited: Sep 22, 2023
  11. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Does anyone have a solution for swapping the focus of SGT floating camera to a new object? I'm getting sooo many game breaking issues trying to move focus from my landed spaceship to my on-foot player.

    Sure wish you could set a child object as the reference for floating origin, then I could just transfer it to the player. disabling one floating origin and activating a new one is a sure way to fire yourself off into space as it seems all the floating objects don't transition to tracking the new camera correctly.
     
  12. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Anyone know why my prefab spawner is dumping the prefabs randomly under ground or way up in the air?
     
  13. abrahamgamedev

    abrahamgamedev

    Joined:
    Nov 25, 2013
    Posts:
    6
    Hi! Is it possible to export planet models (.fbx or .obj) after generating these? I want to generate planets and use only the models and textures. I wanted to know it because the asset is at a discount and I need to know this before buying it.
     
    Last edited: Sep 8, 2023
  14. BLInformatique

    BLInformatique

    Joined:
    Oct 12, 2015
    Posts:
    19
    Hello, I have an error message when I upload to my project
    Space Graphics Planets:
    AssetsPluginsCWSpaceGraphicsToolkitFeaturesTerrainRequiredScriptsSgtTerrainShadowLayer.cs(36,37): error CS1061: 'SgtShadowLayer' does not contain a definition for 'Material' and no accessible extension method 'Material' accepting a first argument of type 'SgtShadowLayer' could be found (are you missing a using directive or an assembly reference?).
    Anyone have an idea? Thanks in advance.
     
  15. Bender_R

    Bender_R

    Joined:
    May 21, 2018
    Posts:
    79
    Hi there SGT users,

    I have a question, just started with this amazing toolkit. I'm trying to achieve a planet to land on. But for some reason the SGT Terrain Collider doesn't seem to do anything.

    My spaceship has a collider and a rigid body but flies right through the surface.

    Anyone who can point me in the right direction to fix this?

    Cheers!
    -Bender
     
    Last edited: Sep 7, 2023
  16. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    First, take a look at the "SGT Terrain Planet" component of the terrain (where you set the radius of the planet etc) and make sure you have your space ship set in the "Observer" field. Terrain colliders will spawn as this object gets close.

    If they still aren't working take a look during run time to see if they are spawning in the correct place, or if they are poorly matched to the terrain. I'm afraid you will have to do a lot of experimenting to get the colliders to match the terain. Watch them in the editor as you adjust the "resolution" and "detail" settings in the "SGT Terrain Collider" component.
     
  17. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    one of the problems I have observed is, that if a spaceship flies fast enough, it surpasses the generated mesh collider planes and the collision wasn't triggered.
    @Darkcoder any chance to adapt the terrain collision system to notice collisions even further inside the planet?
     
  18. Bender_R

    Bender_R

    Joined:
    May 21, 2018
    Posts:
    79

    Ok, I'll try that.
     
  19. Bender_R

    Bender_R

    Joined:
    May 21, 2018
    Posts:
    79
    @Mulbin Unfortunately this doesn't seem to work. Do I understand that the collider is generated/activated when my spaceship with collider is close enough?
     
  20. Hboybowen

    Hboybowen

    Joined:
    Oct 17, 2009
    Posts:
    31
  21. kamicth

    kamicth

    Joined:
    Sep 30, 2018
    Posts:
    32
    hello @Darkcoder, two questions:

    do you have news from your planettary project as addon for SGT with better lods chunks & biomes ?

    can you add near fade option in starfields to allow fading near stars quads when aproaching then spawn a 3d star or any other object with floating spawner. I also curious to know if it's possible to make it working with sgtfloatingmassive.
     
  22. XenoKrelian

    XenoKrelian

    Joined:
    Oct 4, 2017
    Posts:
    2
    Did you fix this, I myself want to use ECS with this pack, I made working version of the Floating Origin (built on the universe part of the pack), but cannot get shaders to work in ECS....
     
  23. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Has anyone ever managed to get a decent asteroid field from this? As with many parts of this asset typing numbers into fields seems to be a random and nonsensical exercise.

    Debris count target 5000... and yet here it is spawning 12 bits of debris.
     
  24. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Yes, you have to have your ship as the focus or they wont generate. Have you confirmed if the colliders are spawning at all?
     
  25. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Has anyone found a solution for using particle systems alongside the SGT floating system? I'm using a particle system to create a sprite based asteroid field as sadly this isn't included with SGT, dropping sprites in world space as it moves with the ship.. but they all jump position when the floating camera moves.

    I would use the SGT infinite star field but that is sadly locked to an awful shader with no diffuse so no good for rocks, only stars!

    Alternatively, has anyone managed to hack the SGT infinite star fields shader to be opaque with diffuse? That would also solve my problem!
     
  26. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Edit - just found the SGT floating particle feature!... but my god the framerate is bad. Would really love to see Diffuse opaque option for infinite starfield as it seems much less intensive.

    Anyone already done this?
     
  27. podperson

    podperson

    Joined:
    Jun 6, 2006
    Posts:
    1,371
    I'm having this problem right now with the latest version and Unity 2022 LTS.
     
  28. Bender_R

    Bender_R

    Joined:
    May 21, 2018
    Posts:
    79
    Nope, they're not spawning. I'm going to use another approach for the lading part.
     
  29. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    Problem:
    Ships fly through planetary terrain colliders after a certain speed, too fast for the physics collision detection to notice the contact.

    Solution Proposal:
    adding low detail mesh collider volume to increase the chance for hit detection:
    upload_2023-9-20_9-39-57.png
     
    Last edited: Sep 22, 2023
  30. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    I am building up a Knowledge Share Group on Discord to better assist us finding solutions for the various upcoming topics in parallel:
    https://discord.gg/FbcERQZ3aQ

    Whether you are a Knowledge Carrier or Seeker, we welcome you there to help improving the community experience and productivity regarding this awesome toolkit!
     
    Last edited: Sep 20, 2023
    Vielfalt likes this.
  31. rumorgames

    rumorgames

    Joined:
    Nov 28, 2012
    Posts:
    35
    This is a great idea. I have three different games built around @Darkcoder's assets, but he's become increasingly unreliable of late (he hasn't responded to support requests for another asset since May) and it's leading to some serious existential dread about how I'll be able to maintain them in the future.

    Organizing a community of other invested developers with domain knowledge and similar needs seems like a great place to start.
     
    JamesTCookie likes this.
  32. javanoob

    javanoob

    Joined:
    Aug 15, 2012
    Posts:
    64
    can anyone drop a small example of a FPS player walking on the terrain ? keep getting stuck here ,is there an example in the pack ? i cannot see one anywhere ? I am guessing by the lack of response I am missing something obvious lol ,I shall keep digging :)
     
    Last edited: Oct 24, 2023
  33. javanoob

    javanoob

    Joined:
    Aug 15, 2012
    Posts:
    64
    Any chance of a discord invite please :) this would be perfect..
    THANK YOU FOR THE QUICK RESPONSE :) x
     
    Last edited: Sep 25, 2023
  34. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    What foes SGT proximity drag actually do?
    I'm trying to set it uip so you can lock in orbits on planets but I havent had any luck so far.
     
  35. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    You already quoted the link?
     
  36. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    As far as I know it slows you down when close to surface of a planet, this way you don't clip through the collision planes
     
  37. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    I looked through the code and i cannot figure out how it does it. I would like to repurpose it so that i can detect if you are close to a planet and immediately set up a fake "orbit". I would also like to use it so that your ship can be stationary on the planet as it rotates etc right now it acts really wonky when you try to land on a small orbitting, rotating planet,
     
    Last edited: Sep 29, 2023
  38. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    I think this has something to do with this but if i follow it into the code i cannot see where it is doing any of the "am i close to a planet" stuff upload_2023-9-29_13-21-42.png
     
  39. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    A screenshot of me next a to a planet
    upload_2023-9-29_13-23-10.png
     
  40. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    I see this, which is what is (eventually) called when you invoke the distance check, but if two planets are right next to each other how does it even know which distance to return by reference if this event procs on two planets at the same time lol. Its somewhat confusing lmao. But i would need to know how that happens so i can make it do crazy orbit stuff.
    upload_2023-9-29_13-31-6.png
     
  41. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    Okay, next thing, I have a universe, and i tried to have a debris grid in my universe so i could spawn asteroids in the oort cloud etc, But once I got beyond the radious defined by my shape (a sphere, radius 30k, height -20k) (so it would only spawn out after a certain distance. And it seems like it is infinite, i ended up going like 70k and it was still regularly spawning asteroids, are the grids not for that sorta thing?
     
    Last edited: Oct 2, 2023
  42. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    As you can see I am well beyond the shape.
    upload_2023-10-2_11-45-52.png
     
  43. Untrustedlife

    Untrustedlife

    Joined:
    Apr 21, 2020
    Posts:
    78
    Do you have an example of this?

    Edit:
    I now have the matrix implementation from earlier someone posted, as well as my own double based sgtchild component, fps dfference is massive i'm talking +140 fps when using doubles, however it doesn't play as nice on small planets that are orbitting (it gets a tad jumpy) while the decimal implemenation doesn't do this. I'll stick with the decimal implementation for now.
    Sorry for the post spam btw.
     
    Last edited: Oct 3, 2023
  44. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Has anyone successfully used the SGT floating system with Unity 2022? Seems completely broken to me, planets zipping away into the distance on every floating update. Project worked perfectly on unity 2021, zero changes to the scene.
     
    Last edited: Oct 8, 2023
  45. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    CONFIRMED - major bug with Unity 2022

    Every time the floating point updates Unity 2022 seems to lose track of the relative positions of the floating camera and floating object for a brief moment... long enough to break any script that uses their relative positions.

    In my case it is very noticeable as I adjust the speed of my ship relative to distance to the planet. Every time it hits that magic number and re-positions the floating point.... zoooom! The floating objects slide along insanely fast for a moment because it stops calculating the distance.

    This all worked just fine in Unity 2021 so I guess I'll have to roll back... bad news is if I can't update unity versions, come next year this will cost my thousand of dollars in Unity Pro fees as I wont be able to access the new Unity basic package (with splash screen removed).

    I'd love to see SGT updated to Unity 2022 sometime... but I won't hold my breath.
     
  46. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    3,332
    Sorry for the late replies everyone... again. Basically, I get a lot of support requests every day which I usually don't mind answering. However, I occasionally get requests that take all day or more, and sometimes I get several at the same time which means I either get no (non-support) work done, or I temporarily ignore them... and I usually choose the latter. I haven't had as much time to work on these assets this year as I'd like, so I currently have a massive support backlog that is getting better now. This forum also has the feature where it only sends you one email notification for the first new post until you visit the thread, so it's very easy to end up not noticing many people have posted.

    I have no idea about DOTS support. If enough people begin to use it then I'll look into it, but for now I don't think it's popular enough for the amount of code modification that's likely required for proper support. I periodically update all shaders with the latest version of Better Shaders (I did it last week or so), so you shouldn't need to get this.

    The vast majority of triangles are the ones nearby, so I don't think not processing the ones so far away will change much. In any case, the current design of the terrain system doesn't make this king of setting easy to add.


    It's possible, but also tricky to properly optimize with batching and integrate with the floating origin system etc. a Simpler middle ground is to spawn a few 'grass' prefabs, and have those detect surrounding terrain heights, and then place billboards there in a batched way.


    Yes I'm fine, just busy juggling too many things.


    It's been a while since I looked at it, but doesn't the standard asset car use the WheelCollider, which only works with Y = up/down? If so, then it won't work. You'd have to replace the wheels with proper physics based ones that don't assume any up/down direction.


    I only have a Quest 2, so I can test it on that when I have more time. Does this issue occur the same way in the "06 Black Hole" demo scene?


    If you want maximum performance then it's best to write your own terrain LOD system that uses a higher performance technique. The method used by SGT is designed to smoothly morph each LOD level via the CPU, so it can maintain compatibility with any shader (e.g. atmosphere) while still minimizing pop-in. However, for maximum performance it would be much faster to use a more classic quadtree 'chunk' baked approach, which would more or less only process the exact new chunks that you approach, without any constant updating due to morphing.


    You're free to set up your own community and post about it here. However, I don't want to participate in any Discord server for my own products, because it sets the expectation (at least for some users) of instant communication with me. Also, having to check even more support channels will lower my working time even more, which is already strained.


    The "Starfields" GameObject has 5 child GameObjects with SgtStarfieldElliptical components?


    There's no feature like this. The obj format is fairly simple, so you could write an exporter for it. You can hook into the SgtTerrainPlanet component's OnDrawQuad event, and from there you can read the CurrentMeshes list from the SgtTerrainQuad the event gives you, and convert these into obj data and write it all out at the end of the frame.


    There is none, it's up to you to implement based on raycasts or similar.


    1 - The current implementation of the LOD and biome system works well? This system has been rewritten about 3 times by now.

    2 - Starfield materials do have a NEAR FADE setting.


    Mesh Colliders only have volume if they're convex, adding this 'volume' to a non-convex one will make no difference.


    The idea behind this code is that it tells you how far away you are from any solid object in SGT (e.g. a planet), and based on this distance you can apply drag, etc. Therefore, it doesn't matter what or how many planets you are near. If you need this information then you could modify the code so that it returns additional data via ref/out or similar.


    If your setup works at a lower distance and fails at this larger distance, then it's likely a floating point precision issue. If you can modify the debris grid's "04 Shape" demo scene and send it to me then I can test it.


    If I make a new project in 2022.3.10f1 and install SGT 4.1.5 + Burst, then the "Terrestrial Planet" demo scene works as expected. If I hook into the SpaceGraphicsToolkit.SgtFloatingCamera.OnSnap event then it outputs the correct values, and the camera in the scene appears to be snapping as expected. So what is the bug exactly?
     
  47. Dfnutnu

    Dfnutnu

    Joined:
    Oct 10, 2023
    Posts:
    3
  48. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    The bug is, if you write a custom script that gets the distance on update between the floating camera and a floating object, every time the floating point re-positions unity 2022 very briefly can't calculate the distance for a few miliseconds (possibly a single frame). Unity 2021 smoothly continues to calculate the distance even when the floating system re-positions.

    You won't see this in your demo scene as it doesn't effect anything in your demo scene, you aren't using additional scripts to monitor the distance.... or using that measurement to effect other things as I am.

    I've rolled the game back to 2021 and it all works again. Its just as likely a Unity fault, but frustrating as I'm locked to 2021 now.
     
  49. Mulbin

    Mulbin

    Joined:
    Feb 8, 2016
    Posts:
    58
    Does anyone have a workaround to further reduce the area that the terrain collider is generated? Its making Waaaaaaay more collider than i realistically need on large scale planets. The only thing I have using the collider is the player so its very wasteful generating all the extra colliders.

    I already have the radius at the minimum but its still way too much.

    upload_2023-10-15_0-21-44.png

    I only really need this area to generate colliders at any one time.

    upload_2023-10-15_0-22-58.png
     
  50. JamesTCookie

    JamesTCookie

    Joined:
    Mar 28, 2021
    Posts:
    28
    I encountered a visual bug with TerrainPlanet Oceans and Unity Skybox reflections on builds (not in Editor)

    It seems the skybox will be reflected on / or shines through the ocean within atmosphere?
    Encountered on Android and Windows Builds
     

    Attached Files:

    Last edited: Oct 25, 2023