Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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,496
    Great progress! With some tweaks to the materials and smoothing of the spawning this would look incredible :) The new version greatly increases the quality and resolution of the surface detail, so I'm interested to see what it looks like when integrated!
     
  2. nighty2

    nighty2

    Joined:
    Dec 29, 2020
    Posts:
    2
    Thanks! Works like a charm with the new version!
     
    Darkcoder likes this.
  3. S1m0np3t3r

    S1m0np3t3r

    Joined:
    Dec 22, 2016
    Posts:
    8
    Hi @Darkcoder ,

    I had a little time, so I tried the new version, and I have some question. To get faster progess, I would like to ask them:
    1. 1. I tried to intstall objects to an Earth sized planet with the SGT Prefab Spawner, but nothing happens. (I can do it with lesser planets, which are based on sphere).
    2. 2. How can I modify the atmosphere? I would like, to the closest moon can be visible from the planet surface. Is it possible?
    3. 3. I played a little with the Explorer model from the Solar System Pack. If I see the Scene: if I like to add a moon to the Earth, I have to install it like like the Earth has installed to the sun?

    SGT_0001.png

     
  4. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,496
    1 - I wasn't able to notice a problem:

    upload_2021-5-1_22-58-46.png

    The Cube prefab here is a standard 1,1,1 cube. Maybe you didn't increase the SgtTerrainPrefabSpawner.Resolution setting enough? If it's too high then each chunk will be massive, and with the default 10 prefabs per chunk would result in perhaps one prefab per thousand km.


    2 - The atmosphere uses alpha blending. By default, it reaches 100% opacity when near the surface, so you cannot see anything outside. You can make it not reach 100% by reducing the SgtAtmosphere.Sky setting (e.g. 0.75 for 75% max). This will allow you to see moons etc, but it will also allow you to see the stars. In the future I want to make it so the starfields can auto fade out to allow for this, so I made a card for it HERE, don't expect it too soon though.

    3 - Yes, you should be able to just set the SgtFloatingOrbit.ParentPoint to the Earth, maybe I should add it. HERE's a card for that.
     
    S1m0np3t3r likes this.
  5. ProtoPottyGames

    ProtoPottyGames

    Joined:
    Dec 18, 2015
    Posts:
    74
    Fog Volume Showroom.png
    Ah..sorry for the confusing explanation. I guess the most simple way I could describe what I'm trying to do is use a typical flat Unity terrain, but have the atmosphere change as the player ascends similarly as it does on a round planet. I'll try and see about putting together some sort of example to better display what I'm trying to achieve.

    Edit:
    Something along the lines of this screen from the Fog Volume asset's Showroom scene, but with an atmosphere change that becomes sort of a space "layer".
     
    Last edited: May 1, 2021 at 8:19 PM
  6. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,496
    You could maybe hack together something like this in SGT with some custom meshes that are just a tiny chunk of a full planet, but it would be really difficult to work with. You're better off just making a scene setup like in that picture with a hand built terrain mesh, some particle clouds on top. I'm not sure how you'd do the space, maybe an inside out cube with a black texture?
     
    ProtoPottyGames likes this.
  7. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    58
    Hi. I'm using SGT with the Virtual Reality Interaction Framework, and have started to see this error when I attempt to fly the spacecraft, after a few seconds:

    Screen position out of view frustum

    It appears to be coming from UnityEngine.GUIUtility: ProcessEvent and I’ve tried disabling any UI related components. Has anyone seen this? Do I need to add the floating origin components to the scene?
     
    Last edited: May 2, 2021 at 6:14 AM
  8. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,496
    Which version of Unity, SGT, and which demo scenes or features do you get this error with?
     
    dmenefee likes this.
  9. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    58
    Unity 2020.3.25
    SGT latest release (3.8.4?)
    I don’t see this with a demo scene; I’m pretty sure it is the result of using VRIF with SGT. I’ve posed the question with that asset author too. It may also be the result of using the new input system, or any number of other variables in the somewhat complicated arrangement. It does look as if the problem occurs when I move out of a rather narrow zone; if I drive forward without any turns I can go quite far before seeing this. I had thought it might be the scene camera, but closing the scene tab didn’t fix the issue... hm. I haven’t tried disabling the VRUI component (which was definitely causing one of these crashes) *and* closing the scene tab. I might try that next time I work on this project today.

    If I decide to add floating origin support, should I just add the SgtFloatingCamera component to one camera (the center eye camera) and SgtFloatingObject components to the spacecraft containing the player/XR rig and to other scene components (there are very few right now)?

    thanks!
     
    Last edited: May 2, 2021 at 9:47 PM
  10. S1m0np3t3r

    S1m0np3t3r

    Joined:
    Dec 22, 2016
    Posts:
    8
    Ohh, I'm sorry, there were some troubles with the numbers.

    I've got another question: on the Earth sized planets, I can't produce the shadow with the standard settings, or the PostProccess camera setting. In these two cases the shadow works on the 1000 m diametres planet, but on the Earth sized planet, it doesn't. I did the same things both of the two sized planets. Maybe it's necessary to use other settings in the case of the Earth sized planet?
     

    Attached Files:

  11. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    74
    Still did not upgrade to latest Sgt, but this is a second type of planet I was trying to design for a few days... I have 7 types of planets in that procedurally generated system, and I want first to finish the design of all of those planets, then share a video with you guys including flight mechanics from one planet to another, then I will upgrade to latest Sgt (which I can't wait for)... Hopefully, in 2 weeks, I will be done with the upgrade... That is because, sometimes we dive into technical capabilities to deep, but a game is about how you tell the story. I think, it is time for me to see the story in my mind... At least, a blink of it... And, Sgt enables that for me...

    This is a planet that is loosing its atmosphere due to many earthquakes that cause severe loss of mass, therefore, gravitational force. At this moment of its history, the planet is resisting to loose its atmosphere. I have to work on this concept more including some orbital elements and some elements that can be surprizing how life can be persistent even in those conditions. For now, this is just a draft.

     
    shadmar and joshua_42 like this.
  12. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    58
    Regarding my problems with VR in SGT, I've tried setting up the floating origin system, but when it snapped my VR camera was disconnected from its original position and everything went kind of crazy (spinning out of control). The VR rig is inside a rigidbody (the spacecraft), so that's probably a clue.

    Anyway, the problem comes down to the rounding error that happens in Unity related to the clipping planes for a camera. Here's the complete error message:

    Screen position out of view frustum (screen pos 0.000000, 0.000000, 100000.000000) (Camera rect 0 0 1440 1440)
    UnityEngine.GUIUtility: ProcessEvent (int,intptr,bool&)

    The clipping planes are set up for .025 near, 100000 far, which is obviously problematic. However, I don't know how else to get a starry backdrop to work. If there's an alternative way to get stars that doesn't require such a huge clip plane setting I'd love to know what it is.
    thanks!
     
  13. Darkcoder

    Darkcoder

    Joined:
    Apr 13, 2011
    Posts:
    2,496
    Yeah I'm not sure if VR would work with the floating origin system, at least not without changing the setup from the fairly simple one I use in the demo scenes. The lack of a floating origin system shouldn't be causing these errors anyway, so you should try to find the source of that first.

    If you lower the clip planes then you must lower the background scale/radius so it doesn't go outside.


    Unity's built-in shadow system doesn't work if the camera draw range is above 100,000 or 1,000,000 depending on Unity version or pipeline. There's a possible way to overcome this I plan to experiment with later this year, but for now you can change the draw distance when on the planet or use smaller planets.


    Looks great! Can't wait to see more videos :)
     
    dmenefee likes this.
  14. dmenefee

    dmenefee

    Joined:
    Oct 14, 2019
    Posts:
    58
    It was me, as I suspected. One of my components adjusts the rigidbody mass of the spacecraft as fuel is consumed (did I mention that this is a simulation-oriented racing game?). There was a bug in that adjustment code that would reduce the mass to zero. Once that happened, the spacecraft, still under thrust (because I was pushing the throttle) would accelerate to infinity and beyond: crash.

    I fixed that bug and things look and work very well. I did create a modified version of the SgtFloatingCamera component that also adjusts an attached rigidbody component. When I use floating origin, it doesn't quite adjust the position of the other floating objects correctly, so I disabled that for now. I may want to revisit it depending on how large my racecourses get... at which time I'll look into that and may have more questions.

    thank you for your time! and sorry for taking it up with my bug!
     
  15. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    74
    Sorry for the late answer... I do not spend much time on forum but I need to look at forum more carefully when I do so...

    With the latest sgt, you may not need this trick. But, on that video, with 2 or 3 previous version of Sgt, Sgt already does most of space to planet flight (with latest version this is, even, awesome). For walking on the surface, I just modelled a 15-20 m radius of a convex surface plate and generated them with SgtTerrainPrefabSpawner aggressively around the planet. They stack on top of each other forming irregular intersections. Also, the model itself is not a straight planar surface, I moved some of the vetices up and down a little bit. Actually, I put a sphere object on probuilder, cut the top of it, and lowered the inner vertices of the top piece. Then, I exported it as prefab, and used GPUInstancer to gain some performance. It seems to be doing the job, but this technique still needs some more optimizations.

    Hope, this helps.
     
  16. SinDeSiecle

    SinDeSiecle

    Joined:
    Sep 30, 2017
    Posts:
    74
    This is amazing... I downloaded and checked it on SRP today. I even considered to migrate my project back to SRP from HDRP. Then, luckily, I remembered to breathe... :)

    Can't wait for the HDRP shader completed.
     
unityunity