If you haven't already, please consider writing a review. They really help me out!
Space Graphics Toolkit (SGT) is a large collection of components, shaders, and graphical effects that can be combined in any way you like to make impressive space scenes.
This asset is split into Feature and Pack folders.
Feature folders contain mostly code and example scenes for a specific SGT feature. For example, the Atmosphere folder contains components and shaders allowing you to add an atmosphere to your planets.
Pack folders contain mostly media and example scenes that combine multiple SGT features into one scene. For example, the Alien Worlds Pack contains a selection of alien planet textures, materials, and demo scenes.
To install this package, first open the Package Manager window, and wait for the package list to finish downloading.
Click the dropdown, and select Unity Registry, so you can see all of Unity's official packages.
Once the list loads, scroll down to find the Burst package, and click Install.
You should now be able to enjoy the full Space Graphics Toolkit experience!
If there is a new version of SGT available, first make sure you back up your project files.
Next, install the latest version.
If for some reason the latest updates breaks your project (e.g. errors in the console), then try deleting the root folder for this asset, and reinstalling it.
If it still doesn't work then go back to your previous version, and let me know what the errors are, so I can fix it.
To reduce file size, I only include a few examples in the main asset. This allows me to release updates more efficiently. To get more, click the links below.
This pack contains a selection of realistic looking planets with an alien theme.
You can download it from HERE.
This pack contains a variety of galaxies.
You can download it from HERE.
This pack contains a variety of nebulae.
You can download it from HERE.
This pack contains all major solar system bodies, including the Moon and multiple versions of The Sun.
You can download it from HERE.
This pack contains 25 high resolution planets across a wide range of planet types. The main SGT asset only contains 2, so this pack is great if you want lots more planets.
You can find more information about it from HERE.
Many SGT features are rendered using a combination of components. For example, the Atmosphere feature is rendered using the SgtAtmosphere, SgtAtmosphereDepthTex, SgtAtmosphereLightingTex, and SgtAtmosphereScatteringTex components.
The main reason why these components are separate is to improve code organization, but this system also allows you to optimize your scene. If you open the context menu (the ⋮ button) at the top right of these components, you'll notice you have the option to Export Mesh, Export Texture, or similar. For example, the SgtAtmosphereLightingTex component's context menu has the Export Texture option. This allows you to save the generated atmosphere LightingTex texture as an asset, so you can now remove this component, and drag and drop your saved texture into the atmosphere material's LightingTex setting.
Doing this allows you to improve performance of your scene, because the SgtAtmosphereLightingTex component no longer has to generate a new texture each time you add an atmosphere to your scene. The downside of course is that you can no longer adjust the texture settings, so it may not be suitable for your project if you need to be able to control the generation settings in game.
Most features of SGT work the same in the editor as they do from C# code, including the identifiers for each setting. For example, to add an atmosphere to a planet just add the SgtAtmosphere component, as you would do in the editor, and the settings you modify from code should be the same as from the editor.
Therefore, to understand how to set something up from code, I recommend you first try to do it in the editor. Each feature of SGT has its own folder with demo scenes that take you through most of the main features, and each component setting has tooltip information to help you.
The biggest difference is that the in-editor experience has some presets that can save you time. For example, components like SgtAtmosphere require you to set the sphere mesh used to render the outer atmosphere. In the editor this can automatically be set, but from code you would have to manually load it yourself.
Space Graphics Toolkit is currently developed using Unity 2019.4.12f1, because this is the minimum version required for new Asset Store submissions.
All features have been tested up to Unity 2021.2 and are known to work.
To enjoy the latest features and bug fixes I recommend you update your project to at least 2019.4.12f1. You may be able to download the latest version and run it in an older version of Unity, but I haven't tested this and can't guarantee it will work.
Space Graphics Toolkit supports all 3 render pipelines (Standard, URP, HDRP) in a seamless way that automatically detects your current project settings, and makes the required modifications to the scene so they look similar.
However, each pipeline handles things slightly differently, and this section of the documentation details what to be aware of.
This compatibility was made possible using the Better Shaders system (not required).
The Better Shaders asset generates multiple variants of each shader ahead of time, so even if you don't have this asset you will still be able to have full render pipeline compatibility with SGT.
BetterShaders (and therefore this asset) currently supports:
Standard - All versions supported by SGT.
URP7.x in Unity 2019.3LTS
URP10.x in Unity 2020.3LTS
URP12.x in Unity 2021.2
URP14.x in Unity 2022.2->2022.3LTS
HDRP7.x in Unity 2019.3LTS
HDRP10.x in Unity 2020.3LTS
HDRP12.x in Unity 2021.3LTS
HDRP14.x in Unity 2022.2->2022.3LTS
Support for newer versions will appear when it does in this asset.
Many SGT components (e.g. atmosphere) implement their own custom lighting. To make a normal Unity light compatible with them you must add the SgtLight component to it. This will automatically read the Unity light's color, intensity, position, etc.
Lights behave differently in each rendering pipeline, so the CwLightIntensity component has been added to all the demo scene lights. This component has the ability to override the light intensity for each pipeline. For example, if the IntensityInURP setting is set to 100, then when your project uses URP, the light's intensity will automatically be changed to 100.
Some feature of SGT (e.g. Terrain Ocean and Softness) require scene depth information to render properly. By default, cameras does not generate this, so you must manually add the CwDepthTextureMode component to your camera, and set the DepthMode setting to Depth or DepthNormals.
Some features of SGT like SgtBlackHole and the Terrain Ocean shader require scene depth and scene color information. By default, these are not generated in URP, you must enable the Depth Texture and/or Opaque Texture setting in your pipeline settings asset.
To make HDRP compatibility seamless, each demo scene contains the Demo GameObject, which has the SgtDemo component. This component adds the Volume component in HDRP.
This volume will adjust the scene exposure, disable the visual environment, and disable fog. These are all done to make the scenes look consistent with the other rendering pipelines. If you want to adjust these settings yourself then you can delete this component and adjust the volume settings yourself, or delete this GameObject and create your own volume.
If your camera uses HDR rendering and your scene uses atmospheric scattering, you should enable the atmosphere material's LIGHTING SCATTERING HDR setting. This will modify the atmospheric scattering shader to perform calculations that can exceed the standard 0..1 (0..255) color range, making it suitable for HDR rendering.
All SGT demo scenes were designed to look best in the standard and URP rendering pipelines. In HDRP, the atmosphere rendering can appear brighter than expected. To fix this, you may want to reduce the SgtAtmosphere component's Brightness settings. A setting of 0.6 makes it look similar to other pipelines.
If your atmosphere uses scattering, then you may also want to update the atmosphere material's ScatteringStrengths settings. For example, you could multiply them by 0.5.
In URP, the SgtBlackHole component works by distorting the OpaqueTexture of the scene around the black hole. As the name suggests, this means the distortion doesn't show any transparent objects. In most of the example scenes the background starfield is transparent, so it will not appear. To make them appear and still keep them transparent, you can find the backdrop/starfield material used to render the background, and change its RenderQueue setting to be 2001 (Geometry + 1). You can do the same thing for other transparent effects you want to appear in the black hole distortion, like the spacetime effect in the Gravitational Waves demo scene.
Yes, this asset has been developed and tested in VR, and supports both multi-pass & single-pass rendering modes.
You can see the VR Stars demo scene for an example of how starfields can be set up to create an immersive scene.
Yes, all features of this asset have been written with maximum compatibility and in mind, and have been heavily optimized to run on almost any device and platform, while still giving impressive visual results.
When you first import this asset you may see some shader warnings in the console. These are harmless and you can clear/ignore them, and they won't appear any more.
If however you see errors coming from SGT shaders then let me know!
Some scenes in SGT require very large view distances, which is achieved by increasing the camera's Clipping Planes / Far to a suitable value. This works well on consoles, Direct3D, Vulkan, and Metal due to using a reversed z buffer, but notably OpenGL and OpenGL ES don't support this (at least in Unity). This means rendering of the scenes with with this extreme view distance will break down and suffer from z fighting and other related issues beyond about 100,000 units distance.
If you must support OpenGL and OpenGL ES with high view distance scenes where this might be an issue, then you can mitigate some of these issues by increasing the Camera Offset setting available in most components of SGT. You can also increase the camera's Clipping Planes / Near setting to reduce issues, where the highest possible value for your current scene setup should be used.
The SgtPlanet and SgtTerrain components are rendered using the Graphics.DrawMesh API, which currently doesn't have any parameter to specify its motion vectors. This means the planet surface itself will not have any motion blur, or if it does, it will not behave correctly when snapping with the Universe feature.
If you have a massive terrain planet with a terrain ocean and atmosphere, the edge of the planet when viewed from space can appear to have some sort of pixel artefacts around the edges. This issue appears to come from motion blur, but it's unclear what causes it.
The effect of this issue can be hidden by increasing the planet's atmosphere height, or by disabling motion blur in the scene volume overrides.
This is a list of the example scenes and a description of what it shows.
This shows you how to make a basic star with a volumetric corona. This is done by adding the SgtAtmosphere component to your star, and setting the SourceMaterial setting to a material using the Space Graphics Toolkit/Atmosphere shader. You can then add the SgtAtmosphereDepthTex component, which allows you to color the corona as you desire.
This shows you how the atmosphere material''s Lighting setting can be enabled, adding lighting to your atmosphere. You can then add the SgtAtmosphereLightingTex component to control the colors as you like. Keep in mind you must add the SgtLight component to your main scene light.
This shows you how the SgtAtmosphereLightingTex component''s SunsetSharpnessR/G/B settings can be used to control the color of your planet''s sunset & sunrise.
This shows you how the Atmosphere material''s Scattering setting can be enabled, adding light scattering to your atmosphere. You can then add the SgtAtmosphereScatteringTex component to control the colors as you like.
This shows you how to connect UI elements to atmosphere settings, allowing you to more easily see what settings change what visuals.
This shows you how to render animated aurora around the poles of a planet. This is done by adding the SgtAurora component to your planet, and setting the SourceMaterial setting to a material using the Space Graphics Toolkit/Aurora shader. You can then add the SgtAuroraMainTex component, which allows you to color the aurora as you desire.
This shows you how to render clouds in the background of your scene. This is done using the SgtBackdrop component with a material using the Space Graphics Toolkit / Backdrop shader. These clouds maintain their size and rotation no matter where you look, so they look great in VR.
This shows you how the Backdrop shader''s Power RGB setting can be enabled, which makes it suitable for rendering stars by only changing the color of the outside of the star texture.
This shows you how the SgtBackdrop component''s ClampSizeMin setting can be increased, which prevents the stars from getting too small. If a star gets too small, it begins to flicker as the camera rotates.
This shows you how to control the star settings from UI sliders.
This shows you how the backdrop material''s PULSE setting can be enabled, which causes the size of each star to pulse over time. You can control the pulse speed using the SgtBackdrop component''s StarPulseSpeedMin/Max settings.
This shows you how to render thousands of billboard asteroids that orbit with great performance. This is done using the SgtBeltSimple component with a material using the Space Graphics Toolkit / Belt_Opaque shader.
This shows you how the belt material''s Lighting setting can be enabled, adding lighting to your asteroids. You can then add the SgtBeltLightingTex component to control the lighting gradient as you like. Keep in mind you must add the SgtLight component to your main scene light.
This shows you how the SgtBeltSimple component''s AsteroidColors setting can be used to create a color gradient of different possible asteroid colors.
This shows you how the belt material can be changed to the Space Graphics Toolkit / Belt_Additive shader, which allows you to render transparent stars.
This shows you how the belt material''s POWER RGB setting can be enabled, making it more suitable for colored stars.
This shows you how the asteroid data of a belt can be manually modified. This is done by finding the SgtBelt___ component, opening its context menu (the ⋮ button), and selecting the Make Editable Copy option. This will create a new GameObject with the SgtBeltCustom component, and copy all procedural asteroid data into the Asteroids list, allowing you to manually modify them. Keep in mind if you modify this list from code, then you must manually call the DirtyMesh() method after.
This shows you how the SgtBillboard component can be added alongside the SpriteRenderer component. This turns the sprite into a billboard that always points toward the camera. The SpriteRenderer.Material can then be set to the "Billboard" material, which makes it glow.
This shows you how to make a more impressive billboard flare using a second layer.
This shows you how to shrink the overlaid billboard when an object goes between the camera and the light. This is done by adding the SgtOcclusionScaler component to it. Keep in mind solid objects in your scene require colliders for this to work.
This shows you how Directional lights can be used. This is done using the SgtLight.TreatAsPoint setting, and the SgtLightPointer component. Directional lights have the benefit of allowing shadows to appear on your objects, even at great distances. These SGT components then rotate the directional light toward the camera, making it act like a point light.
This shows you how the SgtDebrisSpawner component can spawn asteroid prefabs around the camera. These asteroids are randomly spawned over time, so performance should be consistent, and you can interact with them as you like. Keep in mind the asteroid positions do not persist, if you fly back they will be in new random positions.
This shows you how the SgtShapeSphere and SgtShapeGroup components are combined to make a sphere shape around the star. This shape group is then set in the SgtDebrisSpawner.SpawnInside setting, making it so asteroids will spawn more frequently near the star. Keep in mind the spawn probability is based on the SgtDebrisSpawner.Target position relative to the shape group. This means debris can spawn outside of shapes if they are small enough, and your camera is inside them.
This shows you how the SgtDebrisDebris component can be used to procedurally spawn asteroids around the camera. Unlike the SgtDebrisSpawner component, these asteroids will have persistent positions. Keep in mind if you move the asteroids after they spawn then their updated position will NOT be saved.
This shows you how the SgtDebrisDebris component''s Spawn Inside setting can be used, forcing debris to only spawn near the star, or any other shapes you define in the shape group.
This shows you how the SgtFlare component can be used to generate star billboards. Normal star billboards use large sprite textures which use a lot of GPU memory, but these use very little, because the billboard shape is stored in the mesh. This component also gives you full control over the visual result, allowing you to tweak it at runtime.
This shows you how to render a volumetric gas giant. This is done using the SgtJovian component with a material using the Space Graphics Toolkit / Jovian shader. You can then add the SgtJovianDepthTex component to control the edge gradient as you like.
This shows you how the SgtJovian.Rim__ settings can be used to control the outer edge color of the gas giant.
This shows you how the jovian material''s Lighting setting can be enabled, adding lighting to your gas giant. You can then add the SgtJovianLightingTex component to control the lighting gradient as you like. Keep in mind you must add the SgtLight component to your main scene light.
This shows you how the SgtJovianLightingTex.SunsetSharpnessR/G/B settings can be used to control the sunset colors.
This shows you how the jovian material''s Scattering setting can be enabled, adding atmospheric scattering to your gas giant. You can then add the SgtJovianScatteringTex component to control the lighting gradient as you like. Keep in mind you must add the SgtLight component to your main scene light.
This shows you how the jovian material''s FLOW setting can be enabled, adding animated movement to your gas giant surface. The pixels in this texture define which direction the albedo will flow, where a color of RGB 128,128,0 = no movement, 255,128,0 = flow right, 0,128,0 = flow left, etc.
This shows you how the SgtLightningSpawner component can procedurally spawn animated lightning around a sphere. The lightning animation is controlled by the lightning sprite(s) you specify, where the red channel defines the shape of the lightning, the green channel defines when each pixel should appear, and the blue channel defines when each pixel should disappear. For a basic setup the green channel can have values of 0, and the blue channel can have values of 255. This will make the lightning shape (red channel) appear gradually over the lifetime of the animation.
This shows you how the green channel of the lightning texture can be modified to change when each pixel in the lightning texture appears. The green channel values are increased for each number in the texture to make them appear later in the animation.
This shows you how the blue channel of the lightning texture can be used to change when each pixel disappears, allowing you to create an animation sequence. Keep in mind the blue channel should always have a higher value (brighter) than the green channel for any given pixel.
This shows you how the animated lightning can look with a properly designed texture.
This shows you how the SgtPlanet component can be used with the SGT / Planet shader to render a basic planet. You can adjust the basic look of the planet by adjusting the material settings like the Albedo (RGB) Smoothness (A) texture, Normal texture, etc.
This shows you how the planet component's Displace setting can enabled to change the planet heights based on the heightmap set in the planet material.
This shows you how to add seamless detail textures to your planet. This is done by enabling the planet shader's SHARED / Detail R and SHARED / Normal Enabled settings. You can then set the SHARED / Normal R texture, which is a seamless normal texture that will be used by all detail levels. You can then enable the DETAIL / Enabled setting, which will apply one level of detail to your planet. If you want the detail to appear in specific areas only, then you can set the SHARED / Detail Mask (RGBA) texture. You can also enable Detail R/G/B to add even more types of detail to your planets.
This shows you how the planet shader's second DETAIL / Enable and associated settings can be used to enhance the detail of the planet even more. This is useful if you need to zoom or fly even closer to the planet.
This shows you how the planet shader's Water setting can be enabled. Then then allows you to adjust the planet component's Water Level setting.
This shows you how the planet component's Clamp Water setting can be enabled. This forces the water to stay at the Radius value, and the max height to be at the Displacement value, making it easier to set up your scene.
This shows you how the P3dPlanetWaterGradient component can be added alongside the planet component. This allows you to change the color of the water based on its depth.
This shows you how the P3dPlanetWaterTexture component can be added alongside the planet component. This allows you to pick a normal map for the water, and this will be applied to the planet water animated.
This shows you how the planet shader's Coast Sharpness setting can be used to adjust the transition between land and sea.
This shows you how the planet shader's Emission setting can be used to make the water glow, making it look like lava.
This shows you how the planet component's Shared Material setting can be set to an atmosphere added to the planet GameObject. Keep in mind the atmosphere's Inner Mesh Radius setting should match the planet's Radius setting.
This shows you how the planet component's Mesh Collider setting can be used to generate a collider that matches the visual mesh. Keep in mind this can be slow if your mesh is high resolution. You can make a lower resolution 'invisible' planet with a collider to work around this.
This shows you how to render solar prominences around a star. This is done using the SgtProminence component with a material using the Space Graphics Toolkit / Prominence shader.
This shows you how the prominence material''s FADE EDGE setting can be enabled, causing prominence planes viewed edge-on to fade out and give a better look.
This shows you how the prominence material''s CLIP NEAR setting can be enabled, causing prominence planes in front of the star to fade out and give a better look.
This shows you how the prominence material''s DISTORT setting can be enabled, causing prominence texture to change over time and ripple like a flame.
This shows you how the prominence material''s DETAIL setting can be enabled, enhancing the prominence base texture''s detail.
This shows you how to render an accretion disk. This is done using the SgtRing component with a material using the Space Graphics Toolkit / Ring shader.
This shows you how the ring material''s Detail setting can be set toColor, allowing you layer in a detail texture to enhance the base accretion disk texture.
This shows you how a different ring texture can be used, making it suitable as a planetary ring.
This shows you how the ring material''s LIGHTING setting can be enabled, adding lighting and shadows to the ring. You can then add the SgtRingLightingTex component to control the lighting gradient as you like. Keep in mind you must add the SgtLight component to your main scene light.
This shows you how the ring material''s LIGHTING SCATTERING setting can be enabled, adding light scattering through the ring.
This shows you how the SgtShadowSphere component can be added to your planet, causing it to automatically cast shadows on rings.
This shows you how the SgtShadowRing component can be added to your ring GameObject, which causes the ring to cast shadows in your scene using the SGT shadow system. Keep in mind this requires the SgtShadowLayer component to be added to your planet to make it compatible with the SGT shadow system.
This shows you how the ring material''s DETAIL setting can be set to Alpha, allowing you to add a detail texture that makes the ring more interesting up close.
This shows you how the ring material''s NEAR FADE setting can be enabled, which causes the ring to fade out as the camera approaches. You can add the SgtRingNearTex component to control the fade out transition.
This shows you how to control the SgtRing.RadiusInner + RadiusOuter settings, allowing you to control the ring size at runtime.
This shows you how to render basic background stars. This is done using the SgtBackgroundMesh component, which generates a sphere of billboard quads you can texture with an additive shader. The CwFollow component can then be used to glue them to the camera, so they always appear in the background.
This shows you how the SgtBackgroundMesh component can have larger quads and different material with a cloud texture to make a background of clouds.
This shows you how the SgtCameraMove and SgtCameraLook components can be added to your camera. This allows you to move and rotate the camera in a typical freeflight camera style.
This shows you how the SgtCameraMove component''s Target setting can be used to control the asteroid Rigidbody instead of the camera. The TargetRotation setting can then be used to rotate it based on the control inputs.
This shows you how you can add a number of asteroids, and add variety to them with the SgtProceduralSpin and SgtProceduralScale components. Keep in mind if you''re using Rigidbodies, you should use the SgtProceduralTorque component instead.
This shows you how the SgtGravitySource and SgtGravityReceiver components can be combined to add newtonian gravity to your scene. The SgtProceduralForce component is also used to give initial velocity of the asteroids so they can orbit.
This shows you how to combine the Procedural Spin + Scale and Newtonian Gravity demo scenes.
This shows you how the SgtSimpleOrbit component can be used to make GameObjects orbit each other.
This shows you how SGT shadows can be applied to normal opaque objects in your scene. This is done by adding the SgtShadowLayer component to them.
This shows you how the SgtLens component can be used to render a gravitational lensing effect. This can simulate subtle lensing effects, all the way to black holes that bend light back to you. Keep in mind the lens GameObject should be on its own layer, and the lens Camera component''s CullingMask should exclude this layer.
This shows you how the SgtLens component''s WarpOuter setting can adjust the voerall size of the gravitational lens size.
This shows you how the SgtLens component''s WarpStrength setting can adjust the maximum angle light can bend around.
This shows you how the SgtLens component''s HoleSize setting can adjust the size of the event horizon.
This shows you how the SgtLens component''s HoleEdge setting can adjust the thickness of the event horizon.
This shows you how the SgtBlackHole component can be used to render a gravitational lensing effect. This component works similar to SgtLens, but it works in screen space rather than using a cubemap. This makes it suitable for active scenes where your black hole can move, or there are objects near it. Keep in mind this effect cannot bend light backwards, and can only distort pixels on the screen. Keep in mind if you''re using URP then you must enable rendering of the Opaque Texture in your pipeline settings.
This shows you how to render a basic spacetime grid. This is done by making a new GameObject with the SgtSpacetime component. You can then make a child GameObject with the SgtSpacetimeMesh component. You can adjust the SgtSpacetimeMesh settings to change the size and resolution of the generated grid mesh.
This shows you how the spacetime can be deformed using a basic gaussian distribution. This is done by making a new GameObject with the SgtSpacetimeWell component, and setting its Distribution setting to Gaussian. You can then adjust its Radius and Strength settings as desired.
This shows you how the spacetime well moves with the current GameObject position to deform the spacetime mesh underneath. In this scene the SgtRotate component is used on its parent GameObject to make it orbit around the center of the scene.
This shows you how the spacetime can be deformed using a ripple distribution. This is done by making a new GameObject with the SgtSpacetimeWell component, and setting its Distribution setting to Ripple. You can then adjust its Radius, Strength, and Frequency settings as desired.
This shows you how the ripple can be animated. This is done using the SgtSpacetimeWell component''s OffsetSpeed setting.
This shows you how the spacetime can be deformed using a twist distribution. This is done by making a new GameObject with the SgtSpacetimeWell component, and setting its Distribution setting to Twist. You can then adjust its Radius, Strength, Frequency, and HoleSize, and HolePower settings as desired.
This shows you how the twist can be animated. This is done using the SgtSpacetimeWell component''s OffsetSpeed setting.
This shows you how the spacetime can be deformed to gravitate toward the spacetime well. This is done by making a new GameObject with the SgtSpacetimeWell component, and setting its Distribution setting to Pinch. You can then adjust its Radius and Strength settings as desired.
This shows you how different styles of spacetime rendering can be achieved. This is done by making a new material with the Space Graphics Toolkit / Spacetime Additive shader, and adjusting the settings. See the documenetation for the Spacetime feature to learn what each setting does.
This shows you how to create a procedurally animated star. This is done using the SGT / Star shader, which is applied to the material on this sphere object.
This shows you how the shader's Flow settings can be used to make the star surface flow in different directions. This is done by setting the flow Texture, which stores the amount of flow in the alpha channel. This texture should use the equirectangular (cylindrical) projection.
This shows you how the shader's Sunspots settings can be used to add dark and light spots to the surface. This is done by setting the sunspots Texture, which stores the change in brightness, where gray (128) is no change, white (255) is brighter, and black (0) is darker. This texture should use the equirectangular (cylindrical) projection.
This shows you how the shader's Rim Color and Rim Power settings can be used to control how the edge of the star appears.
This shows you how to render a procedurally generated starfield using a box distribution. This is done using the SgtStarfieldBox component with a material using the Space Graphics Toolkit / Starfield shader.
This shows you how the SgtStarfieldBox component''s Offset component can be used to change the starfield distribution.
This shows you how the StarColors setting can be used define a range of colors that will be randomly picked from when generating each star.
This shows you how the StarRadiusMin/Max, MainTex, and OverrideBrightness settings can be adjusted to create clouds instead of stars.
This shows you how the starfield material''s DstBlend setting can be set to OneMinusSrcColor, which changes the way the starfield renders when many stars/clouds are overlapping to make it look smoother. Keep in mind this technique may not work in HDRP, or with HDR rendering.
This shows you how the starfield material''s POWER RGB setting can be used to only color the edges of the stars, and keep the center white. This makes them look more like stars, even when they change their color.
This shows you how the SgtStarfieldBox component''s ClampSizeMin setting can be used to fade stars out instead of scaling them when they go below a certain minimum size on screen. This reduces aliasing and improves visual quality.
This shows you how multiple starfields can be combined with different settings, giving a more interesting look.
This shows you how the SgtStarfieldElliptical component can be used to procedurally generate and render a starfield in the shape of an elliptical galaxy or sphere.
This shows you how the Symmetry setting can be used to flatten the star distribution into a disc.
This shows you how the Offset setting can be used to push stars away from the center.
This shows you how the Bias setting can be used to change the probability stars appear closer or farther away from the center.
This shows you how multiple starfields can be combined with different settings, giving a more interesting look.
This shows you how the SgtStarfieldSpiral component can be used to procedurally generate and render a starfield in the shape of a spiral galaxy.
This shows you how the SgtRotate component can be used to automatically rotate the spiral galaxy.
This shows you how the ArmCount setting can be used to change the amount of spiral arms.
This shows you how the Twist setting can be used to change the spiral arm twist rate.
This shows you how the ThicknessInner setting can be used to change the spiral arm thickness at the center.
This shows you how the ThicknessOuter setting can be used to change the spiral arm thickness away from the center.
This shows you how multiple starfields can be combined with different settings, giving a more interesting look.
This shows you how the SgtStarfieldNebula component can be used to procedurally generate and render a starfield in the shape of a custom SourceTex you specify. Keep in mind this texture must be marked with Read/Write Enabled.
This shows you how the HeightSource setting can be used to change how the stars are offset from the local XZ plane.
This shows you how the ScaleSource setting can be used to change how the stars are sized based on their underlying color.
This shows you how the Jitter setting can be used to prevent bright clusters of stars from blowing out the brightness of your starfield. Keep in mind this also causes the overall shape of your starfield to lose its sharpness.
This shows you how the HorizontalBrightness setting can be used to control how the starfield is lit when viewed side-on. This allows you to prevent the brightness blowing out when making flat starfields like galaxies.
This shows you how multiple starfields can be combined with different settings, giving a more interesting look.
This shows you how the SgtStarfieldInfinite component can be used to make infinitely repeating stars around the camera.
This shows you how the Far setting and SgtStarfieldInfiniteFarTex components can be used to fade stars out based on the FarRadius and FarThickness settings. This is used to hide the pop-in and pop-out of the stars as they infinitely scroll.
This shows you how the Stretch setting can be used to make the stars stretch based on the velocity of any camera with the SgtCamera component. Keep in mind when not-moving, the stretch will be 0, and thus the stars will disappear. To avoid this, this demo scene also has a non-stretched starfield with otherwise the same setting, so you can still see the stars when not moving.
This shows you how the settings can be changed to make infinitely repeating dust.
This shows you how the Near setting and SgtStarfieldNear components can be used to fade stars out based on the NearRadius and NearThickness settings. This is used to smoothly fade the stars when they get too close and clip into the camera.
This shows you how SgtStarfieldInfinite automatically works with the Universe feature's SgtFloatingCamera component. See the Universe feature for more information.
This shows you how the SgtStarfieldDome component can be used to procedurally generate and render a starfield in the shape of a dome.
This shows you how the Bias setting can be used to place more or less stars near the horizon.
This shows you how the star data of a starfield can be manually modified. This is done by finding the SgtStarfield___ component, opening its context menu (the ⋮ button), and selecting the Make Editable Copy option. This will create a new GameObject with the SgtStarfieldCustom component, and copy all procedural star data into the Stars list, allowing you to manually modify them. Keep in mind if you modify this list from code, then you must manually call the DirtyMesh() method after.
This shows you how the starfield material''s PULSE setting can be enabled, which causes the size of each star to pulse over time. You can control the pulse speed using the SgtStarfield___ component''s StarPulseSpeedMin/Max settings.
This shows you how the Starfield_Multiply material can be used instead of the standard additive Starfield material. This causes anything rendered before it to darken, which can create interesting effects. Keep in mind that additive and multiply rendering results change based on draw order, so the Starfield_Multiply material''s RenderQueue setting is set to Transparent + 1 (3001) to force it to render after the base starfield. This may limit the use of this effect.
This shows you how the SgtTerrainPlanet component can be used to generate a planet mesh with dynamic LOD based on camera distance. The SgtTerrainPlanetMaterial component is added alongside it to render the mesh with a material using the Space Graphics Toolkit / Terrain Planet shader. See the Planet and Terrain feature documentation for more information on the shader settings.
This shows you how the SgtTerrainSharedMaterial component can be used to render an atmosphere on top of the terrain.
This shows you how the SgtTerrainHeightmap component can be used to deform the dynamic planet mesh using a heightmap texture. Keep in mind this texture should use the equirectangular cylindrical mapping.
This shows you how the SgtTerrainSimplex component can be used to add procedural heights to the terrain. Fly down to the surface to see it in action.
This shows you how the SgtTerrainCollider component can be used to generate MeshColliders on the terrain when the camera approaches the surface. You can control the Detail of the generated collider to alter how many triangles each MeshCollider is given. You can also control the Resolution, allowing you to adjust the overall side of each MeshCollider.
This shows you how the SgtTerrainPrefabSpawner component can be used to procedurally spawn prefabs on the terrain as the camera approaches. This gives you control over the maximum amount (Limit), their orientation (Rotate), and the Prefabs list that will be randomly picked from.
This shows you how the SgtTerrainPlanet.Areas setting can be used to define different areas on the planet surface. Components like SgtTerrainSimplex and SgtTerrainPrefabSpawner can then use the Area setting to lock themselves to these area. These areas are defined using the SgtTerrainSplatmap asset, which takes an input color texture, and allows you to associate different colors with different areas by name. You can duplicate the example asset to make your own.
This shows you how the SgtTerrainFeature component can be used to deform a specific area of the planet using a custom heightmap texture.
This shows you how to add a layer of ocean to your terrain planet. This is done by making a new GameObject, and adding the SgtTerrainOcean and SgtTerrainOceanMaterial components. This should be rendered with a material that uses the Space Graphics Toolkit / Terrain Ocean shader (see documentation for more details). Keep in mind the ocean requires your camera(s) to render a Depth Texture, which can be enabled by adding the SgtDepthTextureMode component to them.
This shows you how the SgtTerrainSharedMaterial component can be added to both the terrain and the ocean GameObjects, allowing the atmosphere to render on top of them.
This shows you how the ocean material''s DEPTH COLOR settings can be used to change the color of the ocean as it approaches the shoreline.
This shows you how the ocean material''s BAKED DETAIL settings can be enabled, allowing you to add up to 3 layers of detail to your ocean. The tiling of each detail level can be adjusted using the SgtTerrainOcean component''s BakeDetailTilingA/B/C settings. Each detail layer also has the Fade Range setting, which can be used to hide the previous layer as you approach the next layer.
This shows you how the SgtTerrainOceanMaterial component''s Animate setting can be enabled. This will animate the ocean detail textures over time to make the surface look more interesting. The Detail A/B/C settings can be used to control which detail layers are modified.
This shows you how the ocean material''s WAVES settings can be used to add animated waves to the shoreline of the ocean. See the documentation for the Terrain feature for more information of the wave settings.
This shows you how the planet material''s SHORE settings can be used to add beaches to the shoreline of the terrain. See the documentation for the Terrain feature for more information of the wave settings.
This shows you how to render the ocean underwater. This is done by duplicating the ocean GameObject, and enabling the SgtTerrainOcean component''s Invert setting.
This shows you how to make an underwater-only atmosphere. This is done by duplicating the atmosphere GameObject with different settings, and removing the SgtAtmosphere component''s OuterMesh setting. You can then drag and drop this into the underwater ocean''s SgtTerrainSharedMaterial.SharedMaterial setting. The SgtTerrainUnderwater component can then be used to swap the planet''s terrain atmosphere material to the underwater version when the camera goes underwater.
This shows you how to turn a normal sprite into a thruster using the SgtThruster, SgtThrusterScale, and SgtThrusterRoll components. The SGT Thruster shader/material is also used to make the sprite glow.
This shows you how the SgtThrusterControls component can be used to set the SgtThruster.Throttle value using input axes.
This shows you how to make a basic scene with the SgtCameraMove and SgtCameraLook components. This works well for small scenes, but if the camera moves too far away then movement begins to break down, as well as rendering, physics, etc.
This shows you how the SgtFloatingCamera component can be added to the camera, causing its position to snap back to 0,0,0 when it moves too far away. The cumulative camera position is still stored in this component, so you can still have accurate positioning very far away (e.g. even lightyears away).
This shows you how the SgtFloatingObject component can be added to the asteroid, allowing its position to update each time the camera position snaps. And that''s it, your scene now implements the Universe feature. If you want to accurately position objects very far away then I recommend you adjust the LocalX/Y/Z values, which give you higher precision than Transform.position, and won''t change when the camera position snaps.
This shows you how the SgtFloatingSpeedometer component can track the speed of a SgtFloatingCamera or SgtFloatingObject component, and display the speed to a UI Text element.
This shows you how the SgtFloatingOrbit component can be added to the asteroid. The ParentPoint setting is used to make it orbit around the star.
This shows you how the SgtFloatingOrbitVisual component can be used to draw a visual ring of the orbit. Make sure you set this component in the SgtFloatingOrbit.Visual field too.
This shows you how the SgtFloatingSpawnerSphere component can be added alongside your SgtFloatingObject component. When the SgtFloatingCamera gets within your specified Range, it will spawn the prefabs you specify using a sphere distribution.
This shows you how the SgtFloatingSpawnerRing component can be added alongside your SgtFloatingObject component. When the SgtFloatingCamera gets within your specified Range, it will spawn the prefabs you specify using a ring distribution.
This shows you how the SgtFloatingSpawnerOrbit component can be added alongside your SgtFloatingObject component. When the SgtFloatingCamera gets within your specified Range, it will spawn the prefabs you specify in orbit.
This shows you how the SgtFloatingRoot component can be added to your scene. All spawned prefabs will be placed under this GameObject to improve organization.
This shows you how you can tap objects on the screen and warp to them. The tapping is handled by the SgtFloatingWarpPin component in the Canvas/Pin GameObject, which picks any GameObject with the SgtFloatingTarget component attached. The warping is then handled by the SgtWarpSmoothstep component.
This shows you how the SgtFloatingScaler component (Right) can be used to reduce the rate at which distant objects shrink. Using a fixed scale (Left) works well for solid objects, but for glowing stars it can quickly lead to them becoming too small to see.
This shows you how the SgtFloatingSpawnerSphere component can be used to spawn stars that can be warped to. This scene uses realistic distances, with all 100 stars spawning within a radius of 2 lightyears, and a warp distance of 100 AU.
This shows you how the SgtFloatingSpawner___ component can be nested, allowing the stars to spawn planets when you get close enough.
This shows you how the SgtFloatingSpawner___ component can be nested, allowing the stars to spawn planets when you get close enough.
This shows you how to create a third person camera system using the Universe feature. This is done by placing the SgtFloatingCamera component on the camera parent orbit point. The warp is performed on the Rocket Ship''s SgtFloatingObject rather than the camera, and the camera pivot point is made to follow the Rocket Ship using the SgtFloatingFollow component.
This shows you how to simulate massive distant objects in space (e.g. galaxies). You can't use the SgtFloatingObject to render these, because Unity's rendering breaks down beyond a certain size and/or distance. To work around this, you must instead use the SgtFloatingMassive component. This component scales and positions the object to make it appear as if it's incredibly distant and massive, but it's actually brought closer to prevent any issues. This component works like SgtFloatingObject, but it takes over the Transform component, and doesn't allow you to manually move it (e.g. no Rigidbody).
This shows you how the Accretion, Flare, and Prominence features can be combined to create an animated accretion disk with astrophysical jets shooting from the poles.
This shows you how the Terrain and Universe features can be combined to render a planet with the same radius as Earth.
This shows you how to make a nebula scene by combining the Starfield Spiral and Backdrop features.
This shows you how the Spacetime and Singularity can be combined to create an animated gravitational wave ripple effect
This shows you how the Jovian and Aurora features can be combined. These are both transparent effects, which normally can''t be combined with correct depth ordering. To fix this, you can enable the ZTest setting in the Jovian''s material, which will add depth to the jovian, allowing the aurora to render correctly around the jovian.
This shows you how to make a nebula scene by combining the Starfield Nebula, Billboard and Backdrop features.
This shows you how the Earth Sized Planet demo scene can be modified to create a different style of planet.
This shows you how the SgtTerrainObject component can be used to keep an object glued to the surface of a planet. This object can then be moved around using the Thruster features.
This shows you how the SgtThruster, SgtThrusterScale, and SgtThrusterRoll components can be combined to make a simple flickering thruster effect.
This shows you how to make a nebula scene by combining the Starfield Spiral and Backdrop features.
This shows you how the SgtLightningSpawner component can procedurally spawn animated lightning around your planets.
This shows you how the Prominence feature can be used to create an animated vortex effect.
This shows you how the SgtStarfieldElliptical component can be layered many times with different radius and distance settings, to give an impressive feel in VR with stars at varying depths.
This shows you how the SgtStaticPlanet component's WaterHeight value can be controlled from a UI slider.
The Atmosphere feature allows you to add a volumetric haze around an object. This can be around a star to make a corona, or with lighting around a planet to make a planetary atmosphere.
The demo scenes in the Features/Atmosphere/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtAtmosphere component is rendered using a material that uses the Space Graphics Toolkit/Atmosphere shader. Here are what its settings do:
Inner Depth Tex
The DepthTex applied to the inner mesh (surface).
Outer Depth Tex
The DepthTex applied to the outer mesh (sky).
LIGHTING
This allows the atmosphere to receive light and shadows using the SGT custom lighting model.
LIGHTING / Ambient Color
This allows you set the ambient light color when no other lights are shining on the atmosphere.
LIGHTING / Lighting Tex
The lookup table for the lighting gradient.
LIGHTING SCATTERING
This allows the atmosphere lighting calculations to include atmospheric scattering, which adds a halo/glow around the light sources.
LIGHTING SCATTERING / Scattering Terms
The allows you to set up to 4 different layers of atmospheric scattering. Each value allows you to control the size of the halo/glow around each light source, where a higher value means a smaller radius.
LIGHTING SCATTERING / Scattering Strengths
This allows you to set the strength/brightness for each of the 4 scattering layers set above. Setting one to 0 will disable that scattering layer.
LIGHTING SCATTERING / Scattering Tex
The lookup table for the scattering gradient.
LIGHTING SCATTERING HDR
This allows the atmosphere scattering calculations to exceed the normal 0..1 (0..255) range, making it suitable for HDR rendering. If your project uses HDR camera rendering, then you should enable this.
The Aurora feature allows you to add animated ribbons around a planet's poles to simulate aurora.
The demo scene in the Features/Aurora/Examples folder shows you a basic configuration of this feature. You can then experiment with changing each of the SgtAurora component settings to see how it impacts the final look.
The SgtAurora component is rendered using a material that uses the Space Graphics Toolkit/Aurora shader. Here are what its settings do:
Main Tex
The MainTex applied to the aurora ribbons.
NEAR FADE
This allows the aurora to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
ANIMATION
This allows the aurora ribbons to animate over time.
ANIMATION / Anim Speed
This allows you to set how fast the aurora animates.
The Backdrop feature allows you to make background stars, clouds, and other visuals. This is achieved using static billboards that face and always follow the camera. These are very good for backgrounds because:
1 - They are very efficient to render, because there is very little overdraw (unless you increase the individual billboard size too much).
2 - Each billboard can have its own texture, so even when you zoom in there is exceptional detail, unlike with skyboxes.
3 - They look great in VR, because the billboards are static and look consistent from all angles, unlike particle billboards.
4 - They consume very little memory, because each billboard is just 4 vertices.
The demo scenes in the Features/Backdrop/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtBackdrop component is rendered using a material that uses the Space Graphics Toolkit/Backdrop shader. Here are what its settings do:
POWER RGB
Normally the color of each backdrop billboard will be multiplied by the billboard texture, which gives it color. However, this setting causes the RGB values to instead get raised to the power of its color. If your billboards have a star texture, then this causes only the edges of the star to get colored, keeping the center white. This makes it suitable for rendering stars.
POWER RGB / Color Influence
This allows you to control how powerful the color tinting applies to the billboard texture.
The Belt feature allows you to make rings of asteroids that orbit in circles. These asteroids are rendered with such high performance that you can have tens of thousands of them at once, but this does come with the limitation that you can't interact with them.
The demo scenes in the Features/Backdrop/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtBelt component is rendered using a material that uses the Space Graphics Toolkit/Belt shader. Here are what its settings do:
LIGHTING
This allows the belt to receive light and shadows using the SGT custom lighting model.
LIGHTING / Ambient Color
This allows you set the ambient light color when no other lights are shining on the belt.
LIGHTING / Lighting Tex
The lookup table for the lighting gradient.
The Billboard feature allows you to make quads that always face the camera. This is useful for rendering distant stars that you can never land on, but still want to have look good when fairly close. While billboards are typically very simple, their implementation in SGT gives you lots of advanced features, like tracking the camera's roll, fading out behind solid objects, and rotation to avoid distortion when not looking at them directly.
The demo scenes in the Features/Billboard/Examples folder take you step-by-step through the basic configuration of this feature.
Light sources in Unity are only visible when they shine on objects. This means it can be hard to see where they are when you're in space. To make
it clear where your lights are, you can use flares to give them a nice looking visual.
SGT comes with several components and materials that allow you to make impressive flared using billboards. A billboard is a flat mesh (e.g. quad or sprite) that rotates toward the camera.
To add a billboard to your scene, drag and drop a sprite from your Project tab into the Hierarchy tab.
For example, the Space Graphics Toolkit\Features\Shared\Examples\Textures\Billboard1 sprite can be used.
Your scene should now contain a new GameObject with the SpriteRenderer component.
To turn this sprite into a billboard, simply add the SgtBillboard component. I also recommend you enable the Avoid Clipping setting.
You can now play your scene and your billboard should always face the camera.
By default, sprites in Unity use the default sprite shader, which uses alpha blending.
To make them glow, you need to use a shader that uses additive blending. Simply change the Sprite Renderer component's Materialsetting
to the Billboard material that comes with SGT.
The billboard you just created is a good start, but to make your flare look more impressive you should add a second layer.
To do this, drag and drop another sprite onto the sprite GameObject you created earlier. This will add a new sprite as a child of your existing sprite.
You then need to change the material on your new flare. But this time, you should choose the Billboard Overlay material. This material will force your second flare layer to render on top of everything.
You may notice the second billboard layer you added looks great from some angles, but it shines through all foreground objects (e.g. planets), which makes it look bad.
To fix this, add the SgtOcclusionScaler component to your second billboard layer. This component will shrink the current GameObject if the line of sight between the camera and the flare is blocked by a collider, or by components like SgtJovian and SgtAtmosphere that implement their own custom occlusion code.
If you play your game, your first light flare should always be visible and look the same, and your second layer should now grow and shrink based on what's in front.
The Cloudsphere feature allows you to add a layer of clouds around your planets.
The demo scenes in the Features/Backdrop/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtCloudsphere component is rendered using a material that uses the Space Graphics Toolkit/Cloudsphere shader. Here are what its settings do:
Cull
You can use this setting to make the cloudsphere render outside to space (back), or inside to the ground (front).
Depth Tex
The lookup table for the optical depth gradient.
NEAR FADE
This allows the cloudsphere to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
DETAIL
This allows you to enhance the detail of the cloudsphere's base texture.
DETAIL / Detail Strength
This allows you to control how much the detail texture will influence the base texture's opacity.
DETAIL / Detail Tiling
The detail texture will be tiled this many times around the cloudsphere.
DETAIL / Detail Tex
The detail texture.
LIGHTING
This allows the cloudsphere to receive light and shadows using the SGT custom lighting model.
LIGHTING / Ambient Color
This allows you set the ambient light color when no other lights are shining on the cloudsphere.
LIGHTING / Lighting Tex
The lookup table for the lighting gradient.
The Debris feature allows you to procedurally spawn debris/dust/asteroids and other small objects around the camera.
This feature comes with two debris spawning components, which both implement debris spawning using different strategies.
The demo scenes in the Features/Debris/Examples folder take you step-by-step through basic configurations of this feature.
The SgtDebrisSpawner component implements gradual spawning of debris over time with random positions, making this approach perfect for moving debris (e.g. asteroids you can interact with).
The main limitation of this debris spawning approach is that there is no persistence of debris data, meaning returning to the same location will give you new asteroid positions.
The SgtDebrisGrid component implements debris spawning where the positions are procedurally chosen. This approach is ideal if you want a consistent distribution of static debris that look the same when returning to the same location.
One thing you should keep in mind when using this approach is that debris spawning performance is proportional to your camera movement speed.
The Flare feature allows you to generate star flares from scratch using a combination of a custom mesh, and a gradient texture. This allows you to generate very large and detailed flares that use very little GPU memory, unlike typical billboard textures.
The demo scenes in the Features/Flare/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtFlare component is rendered using a material that uses the Space Graphics Toolkit/Flare shader. Here are what its settings do:
Color
The overall flare will be tinted by this color.
Brightness
The Color.rgb values will be multiplied by this before use.
DstBlend
This allows you to control the DstBlend portion of the blending mode. By default this is set to One, for additive blending. However, this can be set to OneMinusSrcColor, which makes the blending smoother.
ZTest
This allows you to control how the flare appears relative to other opaque objects in the scene.
If this is set to LEqual then it will behave like any other transparent object and get occluded by solid objects in front.
If this is set to Always then it will render on top of all opaque objects.
Main Tex
The color gradient texture applied to the flare.
The Galaxy feature allows you to render a galaxy based on a galaxy texture and a star mask. The galaxy itself is applied to a squashed sphere mesh, so it isn't volumetric, but you can combine it with the Starfield feature to make it look impressive up-close.
The demo scene in the Features/Galaxy/Examples folder shows you how you can configure the galaxy.
The SgtGalaxy component is rendered using a material that uses the Space Graphics Toolkit/Galaxy shader. Here are what its settings do:
Tint
The base galaxy will be tinted by this color.
Color Shift
The base galaxy colors will be hue shifted by this angle.
RIM / Min
The edges of the galaxy effect will fade out. This allows you to specify how soon the dark parts of the galaxy will fade out.
RIM / Max
The edges of the galaxy effect will fade out. This allows you to specify how soon the light parts of the galaxy will fade out.
BASE / Texture
The base galaxy texture. This can be based on a satellite image.
BASE / Scale
The galaxy texture will be zoomed in or out by this amount.
BASE / Blend (XY)
This allows you to set the transition size and sharpness along the edge of the galaxy.
STARS
If you enable this then the galaxy will be overlaid with a layer of stars.
STARS / Mask (A)
This allows you to specify where the stars should appear on the galaxy. This should match the shape of the base texture.
STARS / Texture
This allows you to specify the stars texture.
STARS / Tiling
The star texture will be tiled this many times across the galaxy.
STARS / Bias
The higher you set this, the fewer stars will appear in darker areas of the stars mask texture.
STARS / Strength
This allows you to control the final brightness of the stars.
DUST
If you enable this then the galaxy will be overlaid with a spiral of dark dust clouds.
DUST / Texture (A)
This allows you to specify the dust texture.
DUST / Tiling
The dust texture will be tiled around the galaxy this many times.
DUST / Scale
The dust texture will be tiled in/out of the galaxy this many times.
DUST / Twist
This allows you set how much the dust texture twists around the galaxy.
DUST / Bias
This allows you to make the twist rate different at the core of the galaxy compared to the outer edge.
DUST / Alpha Offset
This allows you to fade out the dust near the center of the galaxy.
DUST / Alpha Power
This allows you to control how quickly the dust near the center of the galaxy fades out.
DUST / Color
This allows you to control the dust color near the center of the galaxy.
DUST / Color Power
This allows you to control how quickly the dust color near the center of the galaxy fades to black toward the edge.
NEAR FADE
This allows the galaxy to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
For example, if you want a fade distance of 100 units, then you would set 1/100 or 0.01.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
The Jovian feature allows you to create volumetric gas giant planets.
The demo scenes in the Features/Jovian/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtJovian component is rendered using a material that uses the Space Graphics Toolkit/Jovian shader. Here are what its settings do:
ZWrite
By default, transparent objects like the jovian don't write to the depth buffer. However, if you have a transparent effect around it like the Aurora, then you need to enable this so that the aurora behind the planet get masked out.
Depth Tex
The lookup table for the optical depth gradient.
Noise Tex (A)
The flow texture will be offset by this.
LIGHTING
This allows the jovian to receive light and shadows using the SGT custom lighting model.
LIGHTING / Ambient Color
This allows you set the ambient light color when no other lights are shining on the jovian.
LIGHTING / Lighting Tex
The lookup table for the lighting gradient.
LIGHTING SCATTERING
This allows the atmosphere lighting calculations to include atmospheric scattering, which adds a halo/glow around the light sources.
LIGHTING SCATTERING / Scattering Terms
The allows you to set up to 4 different layers of atmospheric scattering. Each value allows you to control the size of the halo/glow around each light source, where a higher value means a smaller radius.
LIGHTING SCATTERING / Scattering Strengths
This allows you to set the strength/brightness for each of the 4 scattering layers set above. Setting one to 0 will disable that scattering layer.
LIGHTING SCATTERING / Scattering Tex
The lookup table for the scattering gradient.
FLOW
This allows the jovian texture to be distorted using a flow map.
FLOW / Flow Speed
The flow map will animate at this speed.
FLOW / Flow Strength
The flow map will be allowed to distort the UV by this amount.
FLOW / Flow Noise Tiling
This allows you to set the frequency of the noise used to offset the flow map timing to make it look less uniform.
The Lightning feature allows you to add a layer of animated lightning to your planets. The lightning is procedurally spawned around the planet from a set list of lightning textures. The lightning texture stores how the lightning animates over time, giving you very high performance.
The demo scenes in the Features/Lightning/Examples folder take you step-by-step through the basic configuration of this feature.
The lightning texture animation is stored using the RGB pixels in a specific way.
The Red channel is used to store the overall shape of the lightning. This works similarly to texture opacity.
The Green channel is used to store when that pixel should appear during the animation.
The Blue channel is used to store when that pixel should disappear during the animation.
Since the Green and Blue channels define the start and end of the animation respectively, the blue channel should always be brighter than the green channel for each individual pixel.
The Nebula feature allows you to render a nebula based on a seamless nebula texture. The nebula itself is applied to a sphere mesh that is deformed, so the illusion can break if your camera moves too fast. However, you can combine this with clouds from the Starfield feature to make it look more impressive.
The demo scene in the Features/Nebula/Examples folder shows you how you can configure the nebula.
The SgtNebula component is rendered using a material that uses the Space Graphics Toolkit/Nebula shader. Here are what its settings do:
Tint
The base galaxy will be tinted by this color.
Color Shift
The base galaxy colors will be hue shifted by this angle.
TEXTURE / Texture
This is the base nebula texture.
TEXTURE / Scale
This allows you to set the amount of texture tiling.
TEXTURE / Blend (XY)
This allows you to set the transition size and sharpness along each edge.
TEXTURE / Jitter
This allows you to set how far the texture on each side of the nebula will be randomly offset from the center.
DETAIL
If you enable this then the nebula will be overlaid with a layer of detail.
STARS / Texture (A)
This allows you to specify the detail texture, where the detail is stored in the alpha channel.
STARS / Tiling
The detail texture will be tiled this many times across the galaxy.
STARS / Bias
This allows you to adjust the contrast of the detail texture.
STARS / Strength
This allows you to control the final brightness of the detail.
RIM / Min
The edges of the nebula effect will fade out. This allows you to specify how soon the dark parts of the nebula will fade out.
RIM / Max
The edges of the nebula effect will fade out. This allows you to specify how soon the light parts of the nebula will fade out.
NEAR FADE
This allows the nebula to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
For example, if you want a fade distance of 100 units, then you would set 1/100 or 0.01.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
The Planet feature allows you to render terrestrial planets like Earth, Mars, etc.
The SGT / Planet shader is specifically designed for rendering high quality planets. Using an Albedo, Normal, and Height texture as a base, this shader can greatly enhance them with distortionless detail textures, a dynamic water level, and much more.
The SgtPlanet component allows you to render planets using the aforementioned SGT / Planet shader. This component adds extra information to the planet mesh that is necessary for correct rendering with this shader. This component also allows you to deform the planet mesh using the heightmap in the planet material, as well as adjust the water level.
The demo scenes in the Features/Planet/Examples folder take you step-by-step through the basic configuration of this feature.
This shader allows you to render high quality planets. You can access it by making a new material, and selecting the Space Graphics Toolkit/Planet shader.
Color
This allows you to tint the terrain color.
Metallic
This allows you to control the PBR metallic setting of the whole planet (usually 0).
Smoothness
This allows you control the PBR smoothness of the whole planet (usually 1).
Normal Strength
This allows you to dampen or strengthen the normal map set below.
Albedo Shift
This setting allows you to rotate the
Albedo (RGB) Smoothness (A)
This is the main texture, where the albedo color is stored in the RGB channels, and the PBR Smoothness is stored in the alpha channel.
This texture should use equirectangular (cylindrical) projection, and have Wrap Mode = Repeat on the U axis.
Normal
This is the normal map. This should match the albedo mapping.
Height (A)
This is the height map, where the height is stored in the alpha channel.
SHARED / Detail R/G/B/A
This allows you to specify how many detail types should appear on each delay layer. The location of these detail types can be controlled using the mask map below.
SHARED / Detail Mask (RGBA)
This allows you to control where the detail textures are applied on your planet. This should match the albedo mapping.
SHARED / Noise Texture (A)
This is used to break up the repetition of the detail textures.
SHARED / Albedo Enabled
This allows you to enable albedo detail mapping for all detail layers.
SHARED / Albedo R/G/B/A
This allows you to set the seamless albedo texture used for each detail layer.
SHARED / Normal Enabled
This allows you to enable normal detail mapping for all detail layers.
SHARED / Normal R/G/B/A
This allows you to set the normal map used for each map in this layer.
DETAIL / Enabled
This will add a detail map layer to your planet, making it look higher resolution up close.
DETAIL / Tiling
This allows you control the amount of times this detail texture is tiled along around the planet.
DETAIL / Fade Range
If the camera goes below this distance to the surface then it will begin to fade out. This is useful because having multiple detail levels visible at the same time can look overwhelming.
DETAIL / Fade Bound
If the camera goes beyond this distance to the surface then it will begin to fade out. This is useful because having multiple detail levels visible at the same time can look overwhelming.
DETAIL / Strength R/G/B/A
The allows you to set the overall albedo and/or normal map strength for this layer.
NIGHT
This allows you to add night lights to your planet.
NIGHT / Sharpness
This allows you to control how sharp the transition between no night lights and full night lights is.
NIGHT / Offset
This allows you to control how far into the light side the night lights will appear.
NIGHT / Texture (RGB)
This is the emissive texture used for rendering the night side of the planet. This should match the albedo mapping.
WATER
This allows you to render water on the planet surface.
WATER / Tiling
This allows you to set the amount of times the water texture is tiled around the planet.
WATER / Metallic
This allows you to set the PBR metallic of the water (usually 0)
WATER / Smoothness
This allows you to set the PBR smoothness of the water (usually 1)
WATER / Emission
This allows you to set the brightness of the water. This is useful if you want lava to glow.
WATER / Coast Sharpness
This allows you to set how quickly the water hides the underwater terrain.
The SgtPlanet component allows you to render a planet using the specified mesh and material that the SGT / Planet shader.
While it's possible to manually render a planet with the MeshFilter and MeshRenderer components, the SgtPlanet component also adds additional UV data to the mesh so it can seamlessly tile detail textures around the surface without polar distortion.
For further information I recommend you go through the demo scenes in the Planet feature folder.
If your planet material has water enabled, then you should add this component so you can control the water color based on the ocean depth.
If your planet material has water enabled, then you should add this component so you can control the water normal texture, and this component will also handle its animation.
The Prominence feature allows you to render animated streaks coming off the surface of your stars. This feature can also be used to render fictional vortex like effects.
The demo scenes in the Features/Prominence/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtProminence component is rendered using a material that uses the Space Graphics Toolkit/Prominence shader. Here are what its settings do:
FADE EDGE
This setting fades out all prominence planes that are parallel to the camera's view angle.
FADE EDGE / Fade Power
This controls how quickly the planes fade out based on their angle relative to the camera's view.
CLIP NEAR
This setting fades out all prominence planes when they're in front of the star/planet they're rendered on top of.
CLIP NEAR / Clip Power
This controls how quickly the planes fade out based on their position relative to their center point.
DISTORT
This causes the prominence plane's UV to shift over time to make them look like a flickering flame.
DISTORT / Distort Scale (XY)
This controls the texture tiling.
DISTORT / Distort Speed (XY)
This controls the texture animation speed.
DISTORT / Distort Strength
The controls the strength of the UV displacement.
DISTORT / Distort Tex (A)
DETAIL
This applies a layer of detail to the prominence plane.
DETAIL / Detail Scale (XY)
This controls the texture tiling.
DETAIL / Detail Speed (XY)
This controls the texture animation speed.
DETAIL / Detail Strength
The controls the strength of the opacity modification of the base texture.
DETAIL / Detail Tex (A)
This allows you to specify the detail texture.
The Ring feature allows you to render different kinds of rings, including animated accretion disks, and planetary rings.
The demo scenes in the Features/Ring/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtRing component is rendered using a material that uses the Space Graphics Toolkit/Ring shader. Here are what its settings do:
Tiling
The ring texture will be tiled this many times around the circumference of the ring.
NEAR FADE
This allows the ring to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
DETAIL
This applies a layer of detail to the ring. The Mode setting should be set to Color for an accretion disk, and Alpha for a planetary ring.
DETAIL / Detail Tiling (XY)
This controls how many times the detail texture is tiled around the ring.
DETAIL / Detail Speed (XY)
This controls the texture animation speed.
DETAIL / Detail Twist
If you want the detail tiling to be different between the inner and outer parts of the ring, you can set the amount of twisting here.
DETAIL / Detail Twist Bias
This allows you to control if the twisting should be uniform, or isolated to the inner ring.
DETAIL / Detail Tex
This allows you to specify the detail texture.
LIGHTING
This allows the ring to receive light and shadows using the SGT custom lighting model.
LIGHTING / Ambient Color
This allows you set the ambient light color when no other lights are shining on the ring.
LIGHTING / Lighting Tex
The lookup table for the lighting gradient.
LIGHTING SCATTERING
This allows the atmosphere lighting calculations to include atmospheric scattering, which adds a halo/glow around the light sources.
LIGHTING SCATTERING / Scattering Terms
The allows you to set up to 4 different layers of atmospheric scattering. Each value allows you to control the size of the halo/glow around each light source, where a higher value means a smaller radius.
LIGHTING SCATTERING / Scattering Strengths
This allows you to set the strength/brightness for each of the 4 scattering layers set above. Setting one to 0 will disable that scattering layer.
LIGHTING SCATTERING / Scattering Tex
The lookup table for the scattering gradient.
The Singularity feature allows you to add gravitational lensing effects to you scene. This is where dense objects can cause light to bend around them, as seen around black holes.
This feature is implemented in two ways, using the the SgtBlackHole, and the SgtLens components.
The main difference between these two implementations is that SgtBlackHole works in screen space, and SgtLens works in world space from a fixed point. Rendering in screen space works well, but it cannot warp near the edges of the screen, because the pixels that should appear there are outside of the screen view, and therefore don't exist. Rendering in world space gives you consistent results regardless of camera angle, but because it's rendered from a single point it cannot accurately render objects that are close to it (due to a high degree of parallax). Also, the world space rendering is done using a cubemap that is baked from your scene, which means the cubemap must be updated if your scene changes, which can be expensive to do. Therefore, if your scene is frequently changing, or there are objects nearby to the black hole, then you should use SgtBlackHole instead.
The demo scenes in the Features/Singularity/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtSingularity component is a screen space (camera) effect, which means it can run fast and give consistent quality, but it can't warp pixels that are off screen (e.g. behind the camera).
The SgtLens component is a world space (cubemap) effect, which means it's slow to update, but it can render very quickly, and it can warp pixels in any direction, including behind the camera.
The Spacetime feature allows you to render a grid that can be deformed by gravitational bodies, including gravitational waves from orbiting black holes.
The demo scenes in the Features/Spacetime/Examples folder take you step-by-step through the basic configuration of this feature.
You should now see the SgtSpacetime component in your inspector tab.
For the spacetime effect to render, you need to make a mesh that it will be displayed on. This mesh will be deformed by gravitational bodies by modifying vertex positions, so for best results you should use a high resolution grid mesh. You can use any mesh for this (including Unity's built-in Plane mesh), but SGT comes with a component to generate this mesh for you. To use it:
You should now see the SgtSpacetimeMesh component in your inspector tab. Feel free to adjust the SizeX/Z and QuadsX/Z settings to your desire.
To make the spacetime effect display curvature, you need to add gravitational wells. To do this:
You should now see the SgtSpacetimeWell component in your inspector tab.
You now have a basic spacetime set up. To show the spacetime curvature of planets and such, just add the Spacetime Well as a child to your planet, and watch it deform the grid as it moves.
By default, all spacetimes use the "Spacetime (Default)" material, which has basic rendering settings for the spacetime effect.
To create your own, either make a new material with the Space Graphics Toolkit / Spactime Additive material, or duplicate one of the example ones. Then drag and drop it into the SgtSpacetime component's Material setting.
Coord
This allows you to control the source of the grid UV coordinates. Either using the Mesh UV data, or from world space coordinates.
Tiling
This allows you to control how often the grid texture appears.
Proximity
This allows you to control how far from a spacetime well the PROXIMITY COLOR setting appears. For example, if you set this to 2 and your well has a radius of 2 units, then the proximity colors will begin from 4 units away.
WARP / Mode
This allows you to control how the spacetime wells will deform the spacetime mesh. Either by offsetting them in a fixed direction (e.g. down), or attracting them toward the well to create a 'pinch' effect.
WARP / Offset Vector
If you've setWARP / Mode to Offset, then this allows you to specify the world space offset a well will give when its strength is 1.
WARP / Pinch Power
If you've setWARP / Mode to Pinch, then this allows you to specify the overall strength of the pinch effect relative to each well's Strength setting.
BASE COLOR / Color
The spacetime will initially be given this color.
BASE COLOR / Brightness
The color value will be multiplied by this.
BASE COLOR / Albedo (RGB)
The color value will be multiplied by this.
WARP COLOR
These settings work the same as the BASE COLOR settings, but will appear based on the strength of the spacetime well at the current point.
PROXIMITY COLOR
These settings work the same as the BASE COLOR settings, but will appear based on the distance to the current spacetime well relative to its radius, and the Proximity setting.
The Star feature allows you to render star surfaces with a procedurally animated surface.
The demo scenes in the Features/Star/Examples folder take you step-by-step through the basic configuration of this feature.
This shader allows you to render high quality planets. You can access it by making a new material, and selecting the Space Graphics Toolkit/Star shader.
Color
This allows you to control the base color of the star.
Brightness
The Color value will be multiplied by this. This allows you to easily adjust the overall brightness.
Noise Warp
If you specify a Texture below, then it will be deformed based on the procedural noise. This should typically use low values like 0.001.
Texture (RGB)
This is the main texture, where the star colors are stored in the RGB channels.
RIM / Color
This allows you to set the color around the edge of the star surface.
RIM / Power
This allows you to control the rim color falloff/distribution, where a higher value pushes the rim color closer to the edges.
NOISE / Channels
This allows you to specify which color channels the noise will modify. Noise adds and subtracts from the color, so a white color means red green and blue will be modified equally.
NOISE / Strength
This allows you to control the overall contrast of the noise.
NOISE / Tile
This allows you to control the frequency of the noise.
NOISE / Speed
This allows you to control the animation speed of the noise.
NOISE / Octaves
This allows you to control the detail of the noise.
FLOW / Strength
If you specify a FLOW / Texture (A), then this controls its overall strength.
FLOW / Texture (A)
This texture improves the appearance of the star surface by offsetting the noise timing, and with high strength values it can give the surface the appearance of flowing.
SUNSPOTS / Color
This allows you to control the color of the sunspots.
SUNSPOTS / Strength
This allows you to control the overall influence of the sunspots on the final star surface.
SUNSPOTS / Noise Warp
If you specify a Texture below, then it will be deformed based on the procedural noise. This should typically use low values like 0.001.
SUNSPOTS / Texture (A)
This allows you to set where on the surface dark and bright sunspots are. Gray values (128) mean there is no sunspots, and the color will not be modified. Black values (0) mean there is a dark sunspot. White values (255) mean there is a bright sunspot.
OTHER / Noise Texture (RG)
This is the look up table for the noise. You should leave this as-is.
For further information I recommend you go through the demo scenes in the Planet feature folder.
The Starfield feature allows you render a wide range of effects involving a large amount of stars. For example, elliptical galaxies, spiral galaxies, and even starfield warp effects.
The demo scenes in the Features/Starfield/Examples folder take you step-by-step through the basic configuration of this feature.
The SgtRing component is rendered using a material that uses the Space Graphics Toolkit/Ring shader. Here are what its settings do:
DstBlend
This allows you to control the DstBlend portion of the blending mode. By default this is set to One, for additive blending. However, this can be set to OneMinusSrcColor, which makes the blending smoother.
NEAR FADE
This allows the starfield to fade out as the camera approaches.
NEAR FADE / Near Range Recip
This allows you set the reciprocal of the world space distance where the fade will begin.
NEAR FADE / Near Tex
The lookup table for the fade gradient.
FAR FADE
This allows the starfield to fade out if the camera goes too far away.
FAR FADE / Far Radius
This allows you set the world space distance where the fade will begin.
FAR FADE / Far Range Recip
This allows you set the reciprocal of the world space thickness of the fade region.
FAR FADE / Far Tex
The lookup table for the fade gradient.
The Terrain feature allows you to render high resolution planets with a dynamic surface mesh that increases in detail based on camera distance. This is suitable for large planets (e.g. greater than 1km radius), and can even be used to render planets as large as Earth. If your planets don't need to be so large or they're only viewed from far away then I recommend you instead use the SgtPlanet component from the Planet feature, because it's much simpler to use.
The demo scenes in the Features/Terrain/Examples folder take you step-by-step through the basic configuration of this feature.
Begin by creating a terrain planet.
Your scene should now contain a selected GameObject with the SgtTerrainPlanet and SgtTerrainPlanetMaterial components.
You can now set the SgtTerrainPlanetMaterial component's Material setting.
The terrain feature comes with the SGT / Terrain Planet shader, which is specifically designed to be used with the SgtTerrainPlanet component. This shader works similarly to the SGT / Planet shader, so I recommend you read the documentation for that first.
The main difference is the DETAIL layers no longer have the Tiling. Instead, you must specify the tiling in the SgtTerrainPlanet component's BakedDetailTilingA/B/C settings. This bakes the tiling into the terrain mesh, which allows for much higher resolution detail textures than would be possible from shader settings alone.
SHORE / Mask (A)
This allows you to optionally specify where the beach around the shore should appear. This texture should match the mapping of the planet surface albedo/normal/etc textures.
SHORE / Albedo (RGB)
This allows you to specify the albedo detail texture applied to the beach.
SHORE / Detail
This allows you to specify which layer of detail the detail texture will be applied to.
SHORE / Range
This allows you to specify the world space height above the water level that the beach will appear.
SHORE / Noise Tiling
This allows you to increase the detail tiling relative to the underlying noise tiling.
The terrain feature comes with the SGT / Terrain Ocean shader, which is specifically designed to be used with the SgtTerrainOcean and SgtTerrainOceanMaterial components to render an ocean. This shader works similarly to the SGT / Terrain Planet shader, so I recommend you experiment with that first.
DEPTH COLOR / Range
This allows you to specify the depth at which the ocean color will reach the color you specify below.
DEPTH COLOR / Power
This allows you to control how sharp the transition between the deep ocean and shore color is.
DEPTH COLOR / Color
This allows you to control the color of the deep ocean.
TRANSPARENCY / Mode = Vertical
The ocean will be given transparency based on the vertical depth between the water surface and ground surface.
TRANSPARENCY / Mode = Depth
The ocean will be given transparency based on the distance between the camera depth texture and the ground surface.
TRANSPARENCY / Range
This allows you to change how deep into the ocean you can see in meters.
TRANSPARENCY / Power
This allows you to change how quickly the ocean occludes based on its depth, where a higher value means it's harder to see through until the depth gets quite low.
TRANSPARENCY / Depth Scale
This allows you to change how quickly the ocean occludes based on its depth, where a higher value means it's harder to see through until the depth gets quite low.
TRANSPARENCY / Fresnel
This allows you to boost the opacity of the ocean when viewed at shallow angles. This is used to hide depth texture issues when using large planets.
REFRACTION / Enabled
This allows you to enable refraction that causes the terrain seen through the water surface to be distorted.
REFRACTION / Strength
This allows you to control the overall refraction distortion strength.
SHORE / Fade Range
This works similarly to the TRANSPARENCY / Range setting as a second layer. This allows you to fade the shore out abruptly to avoid sharp transitions at the shoreline.
SHORE / Mask (A)
This allows you to optionally specify where the waves on the shore should appear. This texture should match the mapping of the planet surface albedo/normal/etc textures.
WAVES
This adds a basic animated wave effect to the shorelines of the planet.
WAVES / Blend
This allows you to control how the wave color will blend into the underlying ocean color.
WAVES / Opacity (A)
This allows you to specify the opacity map of the waves. The bottom of the texture is the front of the wave, the top of the texture is the back of the wave. The left side of the texture is used when the wave is in deep water, and the right side of the texture is used when approaching the shore.
WAVES / Color
This allows you to change the overall color of the waves.
WAVES / Range
This allows you to set the maximum local space depth from where waves can appear.
WAVES / Interval
This allows you to set the amount of waves within the wave range.
WAVES / Speed
This allows you to set the animation speed of the waves.
WAVES / Noise Tiling
This allows you to set the resolution of the noise that will break up the waves to make them look more interesting.
If you want your terrain to be deformed using a pre-designed global heightmap, then you can use the SgtTerrainHeightmap component. Simply add this to your terrain GameObject, and set its Heightmap setting to the heightmap texture you want.
This heightmap texture must use the equirectangular cylindrical projection, and a pixel of 0 means no height, and 255 means maximum height. You can control the overall height scaling using the Displacement setting.
If your planet has an atmosphere using the SgtAtmosphere component, then you can render that on top of the terrain using the SgtTerrainSharedMaterial component. Simply add this component to your terrain GameObject, and drag and drop your atmosphere GameObject into the SgtTerrainSharedMaterial.SharedMaterial setting. The SgtAtmosphere component automatically creates the SgtSharedMaterial component on the same GameObject, which makes sharing the material easy. Other components like SgtCorona also use this shared material system.
If you want to procedurally generate planet heights or just augment your heightmap, then you can add the SgtTerrainSimplex component to your terrain GameObject. You can then adjust settings like Amplitude to control the final look.
If you want to add colliders to your terrain, then you can add the SgtTerrainCollider component to your terrain GameObject. This component will automatically generate MeshColliders on the surface of your planet based on camera distance. You can control the size of these colliders using the Resolution setting, where a higher value means smaller colliders. You can control the triangle count of these colliders using the Detail setting, and you can control how many colliders spawn around the camera using the Radius setting.
If you want to add prefabs to your terrain, then you can add the SgtTerrainPrefabSpawner component to your terrain GameObject. This will procedurally spawn prefabs on the surface of your terrain as the camera approaches. These prefabs are spawned in groups whose size is based on your Resolution setting. The amount of spawned groups depends on your Radius setting, and you can control how many can spawn per group with the Limit setting.
The areas feature allows you to specify where on the terrain your procedural heights and prefabs will appear. To create your own, just duplicate the Features/Terrain/Media/Terrain Areas example asset. This asset allows you to specify a texture, and a list of colors within it you wish to associate with a specific area name.
Once created, you can drag and drop this asset into your SgtTerrainPlanet component's Areas setting. You can now specify which area your procedural height and prefabs spawn.
The performance of terrain mesh generation depends on how many triangles are generated, and how fast your camera moves.
The base triangle count is controlled using the SgtTerrainPlanet component's Resolution setting.
When the camera approaches the terrain, its mesh increases in detail. This mesh doubles in detail each time your camera distance halves, and the maximum amount of times it can halve depends on your Radius and Smallest Triangle Size settings.
The amount of triangles generated for each LOD stage is controlled using the Detail setting. A detail setting of 1 is a good starting point for desktop devices. You can use a higher value like 2 for higher performance devices, or a lower value like 0.5 for mobiles and other lower spec devices.
Finally, the performance can also be impacted by camera speed. Each time your camera moves more than one triangle distance, the terrain mesh is updated. If you keep your camera speed the same as it approaches the surface of the terrain, then more and more triangles will have to be generated each frame, which may lower performance. To mitigate this, it is recommend that you slow your camera down as it approaches the surface, so a consistent amount of triangles are generated each frame.
The Thruster feature allows you to create spaceship thrusters that apply Newtonian forces to your spaceship, as well as render a basic thruster effect.
The demo scenes in the Features/Thruster/Examples folder take you step-by-step through the basic configuration of this feature.
Right click in your Hierarchy window, and select Space Graphics Toolkit > Thruster, and you should see a new Thruster GameObject in your scene with the SgtThruster component attached.
If you want the thruster to add force to a Rigidbody then drag and drop your Rigidbody into the Rigidbody inspector setting.
The most basic visual for a thruster is a sprite. To add one, just add the SpriteRenderer component to your Thruster GameObject, or one of its children.
You can then set the Sprite setting to the Thruster sprite that comes with SGT.
To make it transparent and have an easily adjustable color, change the Material to the Thruster material that comes with SGT. You can now change the color in a way that preserves the white glow in the middle.
Currently your thruster is just a flat sprite that looks bad from different angles, so to make the visual rotate to the camera you can add the SgtThrusterRollcomponent. This will automatically roll it to the currently rendering camera.
Currently your thruster remains the same size regardless of the thruster being on or off. To fix this, you can add the SgtThrusterScale component.
This will scale the current GameObject based on the SgtThruster component's Throttle value, and also has options for flickering, and dampening.
You now have a basic thruster that can add forces to your spaceships.
To control the thrusters based on user input, you need to write a simple script that stores a reference to each SgtThruster you have, and adjust the Throttle value (e.g. 0 to 1) based on these inputs.
The Universe feature allows you create massive scenes by shifting the scene origin.
Normal Unity scenes store positions using three floats (Vector3), where a position of 0,0,0 is called the origin of the scene. This system works great for most games that take place in a small area, but space games often need to take place over thousands or millions of kilometers, which the Vector3 alone is simply not capable of doing consistently.
The issue is that float values lose decimal precision the higher they get (or lower for negative), which means if your spaceship is 1 million meters/units from the center of the scene, the accuracy of the camera and position values will be very poor, giving you graphical issues, physics issues, and so on. So you want to keep your position values as close to the origin (0,0,0) as possible, so float accuracy remains high.
One solution is instead of moving your camera, you keep your camera fixed at the 0,0,0 origin, and move all the objects in your scene by the distance the camera would have normally moved. This works great, however, it can result in performance issues, because moving objects can sometimes be computationally expensive (e.g. moving physics objects). It can also make scene setup more difficult, and may introduce issues with existing components and scripts that expect the camera to be able to move.
A better solution that SGT uses is instead of keeping the camera at 0,0,0 all the time, it snaps it back to 0,0,0 when it moves too far away. This approach gives good performance because objects only need to have their positions shifted occasionally, it also maintains good rendering precision because values are always near the origin.
Before you proceed to use the Universe feature, keep in mind that updating an existing project to include it is difficult, because many things may break without it being clear what the cause is. I highly recommend you only include this in a new project, where you can add things one by one so you immediately know what change caused your scene to break.
Additionally, keep in mind that storing world space positions is not a good idea when the scene origin shifts, because those positions aren't persistent. For example, if you have a missile script that is chasing a specific Vector3 world space position, it will begin chasing the wrong position as soon as the camera snaps. To update these values you can hook into SgtFloatingCamera.OnSnap, you can also instead store relative world-space positions, or use a Transform component.
Finally, if you're making a game with multiple separated cameras (e.g. split screen, security camera), all cameras must be within a reasonable distance of each other at all times, because the Universe feature was designed with one observer in mind, so the origin itself can only move around one main camera at a time. This means you cannot have a split screen game where both players are on opposite sides of the universe, because it makes the scene setup simply too complex to handle.
At the most basic level, you just need to add the SgtFloatingCamera camera to your camera GameObject (e.g. Main Camera), and the SgtFloatingObject component to all your other GameObjects (e.g. spaceship, planet, character, enemy, asteroid).
Once done, you will see that when your camera moves more than (default) 100 units away from the origin, its position snaps back to the origin, and all objects in your scene will shift by the same amount.
If you need to update a script whenever the camera snaps, you can hook into the SgtFloatingCamera.OnSnap event. This event gives you a reference to the SgtFloatingCamera, and gives you a Vector3 containing the world space distance that the scene shifted.
If your script stores world space positions, then you must hook into this event and increment your values by this world space delta the event gives you.
You may have noticed that both the SgtFloatingCamera and SgtFloatingObject components store the Local X/Y/Z and Global X/Y/Z values. These values are known as the SgtPosition values, and they allow your objects to be positioned anywhere in the universe with high accuracy.
The local values are equivalent to unity world space units (meters), and the global values are equivalent to 50000000 units (meters) each. Each time a local value exceeds this +- 50000000 value it will reset to 0, and increment the global value.
When combined and used to their limit, these values can precisely store the position of an object +- 461168601842738790400000000 meters across each axis. This is equivalent to +- 48745559677 light years, or 48.7 billion light years, which is greater than the 46.6 billion light year radius of the observable universe.
The universe is massive, and it's unrealistic to have all bodies in the universe active at the same time (e.g. galaxies, stars, planets, moons), because your computer would explode. However, you can still create a full universe if you design this in the right way.
The key to this is spawning everything in a hierarchy. For example:
1 - Spawn a few galaxies.
2 - When the camera gets close to a galaxy, spawn some billboard sprites inside that represent massive star clusters.
3 - When the camera gets close to one of these clusters, spawn some smaller clusters inside the massive cluster.
4 - When the camera gets close to one of these smaller clusters, spawn even smaller clusters inside this.
5 - When the camera gets close to this even smaller cluster, you can now spawn some actual 3D stars.
6 - When the camera gets close to one of these stars, spawn some planets around it.
7 - When the camera gets close to one of these planets, spawn some moons, and so on...
If you design this well, then your scene should have no more than a few hundred objects active at the same time, yet still give the illusion of having millions of billions of planets.
All of this can be implemented using the SgtSpawner___ components, which can spawn prefabs in a specific distribution when the camera gets within the Range you specify.
The basic setup described above works well for 'small' objects (e.g. spaceships, planets, stars) in a massive scene, but they are not capable of rendering truly massive celestial bodies like galaxies. This is due to a limitation of how Unity is implemented, where over a certain size/distance objects just disappear.
However, Space Graphics Toolkit comes with the SgtFloatingMassive component that can solve this issue. This component takes over the current GameObject's Transform settings to size and position massive objects to make them appear as if they are massive and distant, but behind the scenes it's actually small and fairly close.
If your scene needs to be able to render galaxies and other massive distant bodies then you must attach the SgtFloatingMassive component to it, instead of the SgtFloatingObject component.
Here's a list of all my other assets, please check them out!
You can also view this list on my Asset Store page.
Rapidly develop your game with consistent input across desktop & mobile using Lean Touch. This lightweight asset comes with many modular components, allowing you to customize them to your exact project needs!
Lean Touch+ is an extension to the popular Lean Touch asset, adding many more example scenes.
Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.
Quickly optimize the performance of your games using Lean Pool. Within minutes you can use this lightweight asset to preload, recycle, and limit the spawning of your prefabs.
Quickly polish your games using Lean Transition. This asset allows you to easily tween or animate almost anything in your game, making it transition smoothly.
Lean GUI is a colllection of components that extend Unity's GUI system, allowing you to rapidly enhance the user experience (UX) of your game's UI.
Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!
Lean Texture allows you quickly modify textures in your project with a range of filters, pack them together into channels, and much more!
Lean Texture+ is an extension to Lean Texture, adding many new types of texture modification tools!
Unlock a universe of visual possibilities with Modular Backgrounds. Simply drag and drop these graphics into the background of your scenes.
Paint all your objects using Paint in 3D - both in game, and in editor. All features are optimized with GPU accelerated texture painting, so you can enjoy consistent performance, even if you paint your objects one million times!
Paint all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!
Paint in Editor unlocks the ability to paint objects in your scene - great for making small tweaks, or even creating entirely new texture sets!
FLOW allows you to add large scale interactive fluids to your scene - all highly optimized using GPU acceleration.
Unlock the full potential of your 2D games using Destructible 2D, this asset allows you to quickly convert all your boring solid sprites into fully destructible ones!
Quickly make the space scene of your dreams using Space Graphics Toolkit. This huge collection of space effects can be customized and combined in any way you like, allowing you to quickly make realistic or fantasy worlds. Each feature has been heavily optimized to run on almost any device and platform.
Enhance your space scenes using this large pack of high detail volumetric planets. These planets are finished using the powerful planet features from Space Graphics Toolkit (not required).
Unity sounds only emanate from a single point source. This is great for explosions and footsteps, but quite often you need something more advanced. Volumetric Audio is an easy to use package that allows you to define boxes, spheres, capsules, paths, or meshes that sounds can emanate from.
Replaced Galaxy feature textures.
Replaced Nebula feature textures.
Added STARS 2 setting to Galaxy shader, for secondary layer of stars.
Added DETAIL setting to Nebula shader.
Added ZWrite setting to Jovian shader.
Fixed Jovian demo scene.
Optimized SgtFloatingOrbitVisual during runtime.
Removed SgtFloatingMassive.StartDistance setting.
Removed SgtFloatingMassive.StepDistance setting.
Added SgtFloatingCamera.MasiveDistance setting.
Fixed SgtFloatingMassive objects disappearing when entering them (e.g. a galaxy).
Moved main build to Unity 2021.3.0f1.
Updated shaders to latest version.
Fixed SgtBelt lighting disappearing when overlapping position with light.
Updated shaders to latest version.
Added Fade Bound setting to Terrain Ocean shader's baked detail setting.
Fixed Terrain Planet shader's night light angle.
Fixed Starfield shader warning.
Fixed Backdrop shader warning.
Added CastShadows setting to SgtPlanet component.
Added ReceiveShadows setting to SgtPlanet component.
Added CastShadows setting to SgtTerrainPlanetMaterial component.
Added ReceiveShadows setting to SgtTerrainPlanetMaterial component.
Added SgtTerrainShadowLayer component.
Added Backdrop_Multiply shader to Backdrop feature.
Fixed Terrain Planet shader's Normal Strength setting.
Updated shaders for URP and HDRP.
Added "16 Underwater" demo scene to Terrain feature.
Added "17 Underwater Atmosphere" demo scene to Terrain feature.
Added Invert setting to SgtTerrainOcean component.
Added SgtTerrainUnderwater component to Terrain feature.
Added Cull setting to cloudsphere shader/material.
Moved main build to Unity 2020.3.0f1.
Fixed Terrain shader's shore texture being stretched.
Fixed Jovian demo scene's aurora effect.
Added new Nebula feature.
Added new Galaxy feature.
Replaced Star Pack with new Galaxy Pack and Nebula Pack (see documentation).
Fixed SgtAtmosphere component's SourceMaterial not syncing with the sky.
Fixed SgtTerrainCollider child layers.
Fixed Planet shader's WATER setting to now override NIGHT setting.
Added SgtAtmosphere.OcclusionPower setting.
Added SgtJovian.OcclusionPower setting.
Added FACETED setting to Solid shader.
Added FACETED setting to Planet shader.
Added FACETED setting to TerrainPlanet shader.
Fixed issue where the dark side of rings could become transparent.
Fixed issue with TerrainPlanet shader compilation in URP.
Improved SgtPlanet start up performance when Displace is disabled.
Fixed issue where terrain areas set to Everywhere wouldn't work.
Fixed issue where the dark side of jovians could become transparent.
Added Align To setting to Starfield shader.
Added Align To setting to StarfieldInfinite shader.
Added SgtTerrainClamp component to Terrain feature.
Terrain height modifier components are now executed in component order.
Jovians no longer cast shadows on themselves.
Fixed the SgtFlareMainTex component's Color setting being ignored.
Fixed the SgtStarfield___ component's stretch feature not working in URP/HDRP.
Fixed SgtDebrisGrid when using Universe feature.
Added warning to SgtTerrainAreas inspector if the texture is non-readable.
Fixed SgtTerrainCollider vertex alignment and distribution to match visual mesh.
Fixed SgtTerrainPrefabSpawner component's Area being misaligned.
Fixed Terrain Planet shader error/magenta when enabling all settings.
Added SgtRing.SortDistance setting to improve depth sorting with jovians.
Fixed shadows not appearing on jovians.
Improved SgtRing depth sorting.
Fixed SgtOcclusionScaler against jovians.
Fixed SgtOcclusionScaler against atmospheres.
Fixed Universe/Floating Massive demo scene.
Fixed SgtTerrainFeature.Scale setting.
Removed SgtJovianScatteringTex.Mie setting.
Removed SgtJovianScatteringTex.Rayleigh setting.
Added Scattering Terms setting to Jovian shader.
Added Scattering Strengths setting to Jovian shader.
Removed Scattering Mie setting from Ring shader.
Removed Scattering Strength setting from Ring shader.
Added Scattering Terms setting to Ring shader.
Added Scattering Strengths setting to Ring shader.
Added DETAIL / Fade Bound setting to Planet shader.
Added BAKED DETAIL / Fade Bound setting to Terrain Planet shader.
Fixed planet emission in HDRP.
Added Pulse demo scene to Starfield feature.
Added PulseMin setting to starfield shader.
Added PulseMax setting to starfield shader.
Added StarPulseSpeedMin setting to starfield components.
Added StarPulseSpeedMax setting to starfield components.
Added Pulse demo scene to Backdrop feature.
Added PulseMin setting to backdrop shader.
Added PulseMax setting to backdrop shader.
Added StarPulseSpeedMin setting to backdrop components.
Added StarPulseSpeedMax setting to backdrop components.
Changed folder structure to be inside Plugins/CW/SpaceGraphicsToolkit.
Changed folder structure of each feature's examples to be inside /Examples.
Changed folder structure of each feature's core to be inside /Required.
Updated inspector code to support third party assets that implement nested inspectors.
Reverted SgtJovian shader change to support older devices.
Updated SgtTerrainCollider to support larger planets.
Updated all features to use external shaders/materials for smaller and faster builds.
Moved most component material settings to external shader/material.
Added Unity Fog / Disable setting to all material settings.
Merged Accretion feature into Ring feature.
Merged Corona feature into Atmosphere feature.
Removed SgtRingMesh component.
Removed Width/Height and Format settings from all texture generating components.
Renamed SgtFlareMaterial component to SgtFlareMainTex.
Added SgtOcclusionScaler.MaxRaycastDistance to reduce flickering issues at extreme distances.
Replaced BakedBackdrop meshes with SgtBackgroundMesh component for greater flexibility.
Changed SgtLens component's default execution order to 100, so it first renders after most components finish updating.
Fixed terrain ocean transparency in HDRP.
Mostly fixed SgtLens rendering in HDRP.
Fixed SgtTerrainCollider with odd Resolution values.
Fixed SgtTerrainPrefabSpawner with odd Resolution values.
Fixed possible shader errors in URP.
Fixed SgtBelt___ inspectors not appearing.
Fixed Max Sphere Shadows = 0 not working on lit components.
Fixed Max Sphere Shadows > 2 not working on lit components.
Fixed SgtTerrainFeature build error.
Fixed spaceship controls not working with new InputSystem package.
Fixed atmosphere coloring in linear color space.
Fixed SgtBackdrop component RenderQueue setting in all demo scenes.
Fixed transform gizmos not appearing in Unity 2021.2.
Fixed demo scene errors with certain keyboard layouts.
Removed RenderQueue setting from SgtStarfield___ components.
Removed RenderQueue setting from SgtBelt___ components.
Added SgtFloatingMassive component for rendering distant galaxies etc.
Added Floating Massive demo scene to Universe feature.
Added Terrain Planet / Feature demo scene to Terrain feature.
Fixed spaceship motion blur issue in HDRP.
Fixed specular highlight angle on massive planets in HDRP.
Fixed backdrop blur issue in massive scenes in HDRP.
Removed BlendMode setting from SgtBackdrop component.
Removed BlendMode setting from SgtStarfield component.
Fixed SgtStarfield and other components blocking scene shadows.
Added Starfield / Custom demo scene.
Added Starfield / Belt demo scene.
Added SHORE settings to Terrain Planet shader.
Added new SHORE settings to Terrain Ocean shader.
Added new WAVES settings to Terrain Ocean shader.
Added Moon to SolarSystemPack/Explore demo scene.
Added Terrain/Waves demo scene.
Added Terrain/Shore demo scene.
Fixed SgtAtmosphere flickering in some scenarios.
Fixed SgtCorona flickering in some scenarios.
Removed SgtAtmosphere.InnerOffset setting.
Removed SgtCorona.InnerOffset setting.
Fixed starfield pulse not working.
Improved SgtTerrainPlanet floating point precision.
Added SgtTerrainOcean component for improved ocean mesh rendering.
Rewrote Terrain Ocean shader depth coloring.
Added TRANSPARENCY / Mode setting to Terrain Ocean shader.
Added TRANSPARENCY / Fresnel setting to Terrain Ocean shader.
Added TRANSPARENCY / Depth Scale setting to Terrain Ocean shader.
Added REFRACTION / Enabled setting to Terrain Ocean shader.
Added WAVES settings to Terrain Ocean shader.
Fixed SgtPlanet causing mesh normal seams.
Fixed SgtCloudsphere causing background colors to become oversaturated.
Fixed SgtCloudsphere tiling around equator.
Fixed SgtJovian shadows not appearing.
Added two cloudsphere detail textures to Cloudsphere feature.
Fixed SgtLight gc alloc.
Fixed SgtLight point light attenuation in URP.
Fixed SgtLight point light attenuation in HDRP.
Fixed SgtFloatingCamera.GetPosition implementation.
Rewrote Planet shader detail texture implementation to use less samplers.
Rewrote Terrain Planet shader detail texture implementation to use less samplers.
Updated Solar System Pack to use new shader settings.
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.
Added SHARED / Detail Albedo setting to SGT / Planet shader.
Added DETAIL / Albedo R/G/B/A settings to SGT / Planet shader.
Added SHARED / Detail Albedo setting to SGT / Terrain Planet shader.
Added DETAIL / Albedo R/G/B/A settings to SGT / Terrain Planet shader.
Fixed SgtCameraLook touch controls.
Fixed SgtThrusterControls input sensitivity.
Fixed touch controls in all example scenes.
Fixed SgtStarfieldNebula roll with camera.
Made all components auto update when modified by animation.
Fixed many minor demo scene issues.
Fixed many minor bits of code to improve consistency.
Added SGT / Terrain Planet shader.
Added SGT / Terrain Ocean shader.
Added SgtTerrainOceanMaterial component.
Added second detail layer to SGT / Planet shader.
Added up to 4 optional detail channels to SGT / Planet shader.
Added mouse wheel support back to SgtCameraMove component.
Added new tutorial scenes to Terrain feature.
Fixed error in some scenes when using new InputSystem package.
Fixed memory leaks from SgtTerrainPlanet and related components.
Fixed Planet Surfing demo scene spaceship controls.
Simplified SGT / Planet shader detail settings.
Removed water settings from SgtTerrainPlanetMaterial component.
Fixed SgtStarfieldInfinite render issue in HDRP.
Fixed pink materials when reimporting with SRP.
Simplified hierarchy of all demo scenes.
Fixed media pack links in documentation.
Fixed SgtBeltSimple property editing from code.
Fixed build errors.
Moved main build to Unity 2019.4.12f1.
Fixed variable SgtJovian.Occlusion setting output.
Added SgtFloaringOrbit.Offset setting.
Fixed SgtFloatingFollow component's rotation handling.
Added SgtBlackHole component to Singularity feature.
Removed SgtSingularity component.
Replaced SGT Planet shader with Planet shader.
Added Has Lights setting to Planet shader.
Added Has Water setting to Planet shader.
Added night lights to Planet shader for all rendering pipelines.
Fixed bug with SgtPlanet when disabling SgtAtmosphere component.
Removed PIPELINE tool (material switching is now automatic).
Fixed atmosphere flickering in HDRP.
Added renderer-specific intensity settings to SgtLight.
Added SgtManager component to scenes to auto modify settings for HDRP.
Renamed SgtLight.Intensity to IntensityInSgt.
Improved demo scenes for the Star feature.
Added Flow settings to SGT Star shader.
Added Sunspots settings to SGT Star shader.
Fixed SgtCorona inspector values not updating.
Added support for new InputSystem package.
Rewrote SgtCameraMove component.
Rewrote SgtCameraLook component.
Added SgtDragSource component.
Added SgtDragReceiver component.
Added SgtStarfieldDome component to Starfield feature.
Added Dome demo scene to Starfield feature.
Added Dome / Bias demo scene to Starfield feature.
Fixed flares appearing pink when using prefabs in builds.
Added SgtRing.Occlusion setting.
Fixed SGT Planet shader default water level when using SRP.
Fixed Singularity feature when using single pass instanced VR rendering.
Added SgtBeltCustom.Occlusion setting.
Fixed SgtBeltSimple.Layout settings not showing.
Fixed SgtStarfieldCustom.Layout settings not showing.
Fixed SgtBeltCustom inspector.
Fixed SgtStarfieldCustom error when changing star count.
Fixed SgtBeltCustom error when changing asteroid count.
Improved Lightning feature documentation and tutorial scenes.
Added more lightning textures.
Fixed WebGL error from texture creating components.
Fixed inspector values not updating from texture creating components.
Fixed potential recursive loop from Universe feature components.
Fixed scene objects appearing in prefab mode.
Fixed scene objects appearing when hidden.
Added SgtJovian.CameraOffset setting.
Added SgtTerrainPlanetMaterial.ClampHeights setting.
Added SgtTerrainPlanet LOD smoothing.
Updated Jovian demo scene to include aurora.
Updated lighting in Earth Sized Planet scene.
Updated lighting in Obsidian Planet scene.
Added Obsidian Planet demo scene.
Added SgtTerrainSimplex.Ridged setting.
Added SgtTerrainSimplex.Seed setting.
Added SgtPlanet.Channel setting.
Added SgtTerrainPlanetMaterial.WaterLevel setting.
Added SgtTerrainPlanetMaterial.HeightmapBias setting.
Added SgtFloatingSpawner.RandomizeIndex setting.
Fixed SgtStarfieldInfinite stretch feature.
Fixed some Basic Pack demo scene materials.
Moved SgtOcclusion code to Shared folder.
Added SgtLight.Intensity setting.
Added SgtTerrainPrefabSpawner.Threshold setting.
Added SgtTerrainPrefabSpawner.SharedMaterial setting.
Updated demo scene background RenderQueue and scale for SRP compatibility.
Improved SRP compatibility documentation.
Fixed single pass stereo VR rendering.
Rewrote Spacetime to be easier to use.
Moved main build to Unity 2018.4.13f1.
Added Terrain feature.
Added SgtFloatingParticleSystem component to Universe feature.
Renamed SgtStaticPlanet to SgtPlanet.
Renamed SgtDepthScale to SgtOcclusionScaler.
Renamed SgtDepth to SgtOcclusion.
Removed SgtDepthCamera component.
Removed SgtDepthRaycast component.
Removed Mie scattering from atmosphere inner shader.
Replaced SgtDynamicPlanet with SgtTerrainPlanet.
Implemented custom occlusion calculations for main components.
Removed automatically created child components for all components.
Improved multi-camera rendering code.
Refactored all code.
Fixed SgtStaticPlanet bounds when layering atmosphere and cloudsphere.
Moved SgtDynamicPlanet back to Planet feature.
Updated documentation.
Added asmdef.
Added Universe/Nested Orbits demo scene.
Moved SgtDynamicPlanet back to Terrain feature.
Fixed SgtStaticPlanet polar UV generation.
Removed auto package dependency install (see documentation).
Fixed SRP bug when using Unity 2018.4.
Removed unnecessary package dependencies.
Added Shared/Camera Controls demo scene.
Added Shared/Rigidbody Controls demo scene.
Improved Basic Pack/Planet Surfing demo scene.
Improved Basic Pack/Terrestrial Planet demo scene.
Improved Basic Pack/Terrestrial Planet + Ring demo scene.
Added SgtFloatingSpeedometer.UpdateIn setting.
Moved main build to Unity 2018.4.0f1.
Added new Planet demo scenes.
Added new Universe demo scenes.
Added Eath Sized Planet demo scene.
Added SgtFloatingWarpPin.FloatingCamera setting.
Added SgtFloatingWarpPin.WorldCamera setting.
Added SgtFloatingSpawner.Range setting.
SgtFloatingCamera no longer needs to be attached to a Camera.
SgtFloatingCamera snapping attempt moved from pre-render to LateUpdate.
Moved Terrain features to Planet folder.
Merged SgtMeshDisplacer into SgtPlanet.
Merged SgtPlanetMeshConverter into SgtPlanet.
Renamed SgtPlanet to SgtStaticPlanet.
Rewrote SgtTerrain to be faster and handle larger scale planets.
Renamed SgtTerrain to SgtDynamicPlanet.
Changed SgtCameraMove.MouseSensitivity to modify movement speed.
Merged SgtFloatingPoint into SgtFloatingCamera.
Merged SgtFloatingPoint into SgtFloatingObject.
Merged SgtFloatingSpawnable into SgtFloatingObject.
Removed SgtFloatingLod component.
Removed SgtFloatingOrigin component.
Removed SgtFloatingCamera.Scale setting.
Improved SgtFloatingCamera snap behavior with larger planets.
Added SgtFloatingFollow component.
Fixed SgtJovian error with _MainTex property.
Fixed SgtStarfieldElliptical.StarRadiusBias being 0 by default.
Improved Billboard5 texture resolution.
Improved Billboard6 texture resolution.
Changed SgtInputManager from a component to a normal class.
Updated all demo scenes.
Added Basic Pack/Elliptical Galaxy demo scene.
Added Basic Pack/Spiral Galaxy demo scene.
Added Basic Pack/Nebula demo scene.
Added Starfield/Box demo scene.
Added Starfield/Box Offset demo scene.
Added Starfield/Box Colors demo scene.
Added Starfield/Box Clouds demo scene.
Added Starfield/Box BlendMode demo scene.
Added Starfield/Box PowerRGB demo scene.
Added Starfield/Box ClampSize demo scene.
Added Starfield/Box Layering demo scene.
Added Starfield/Elliptical demo scene.
Added Starfield/Elliptical Symmetry demo scene.
Added Starfield/Elliptical Offset demo scene.
Added Starfield/Elliptical Bias demo scene.
Added Starfield/Elliptical Layering demo scene.
Added Starfield/Spiral demo scene.
Added Starfield/Spiral Rotation demo scene.
Added Starfield/Spiral Arm Count demo scene.
Added Starfield/Spiral Twist demo scene.
Added Starfield/Spiral Thickness Inner demo scene.
Added Starfield/Spiral Thickness Outer demo scene.
Added Starfield/Spiral Layering demo scene.
Added Starfield/Nebula demo scene.
Added Starfield/Nebula Height Source demo scene.
Added Starfield/Nebula Scale Source demo scene.
Added Starfield/Nebula Jitter demo scene.
Added Starfield/Nebula HorizontalBrightness demo scene.
Added Starfield/Nebula Layering demo scene.
Added Starfield/Infinite demo scene.
Added Starfield/Infinite Far demo scene.
Added Starfield/Infinite Warp demo scene.
Added Starfield/Infinite Dust demo scene.
Added Starfield/Infinite Dust Near demo scene.
Added Starfield/Infinite Floating Camera demo scene.
Fixed Accretion Disk billboard flare rendering.
Fixed SgtShadowLayer flickering with SRP.
Fixed SgtDebrisGrid spawning code.
Fixed default SgtStarfieldElliptical.Bias value.
Enabled demo scene billboard Roll To Camera for VR compatibility.
Changed Additive Overlay shader render queue for SRP compatibility.
Added SgtAtmosphere.AmbientColor setting for greater control and SRP compatibility.
Added SgtBelt.AmbientColor setting for greater control and SRP compatibility.
Added SgtCloudsphere.AmbientColor setting for greater control and SRP compatibility.
Added SgtJovian.AmbientColor setting for greater control and SRP compatibility.
Added SgtRing.AmbientColor setting for greater control and SRP compatibility.
Added Rendering Pipeline Switcher tool to root SGT folder.
Added Single-Pass VR support to SgtSingularity.
Added SRP compatibility to SgtSingularity.
Added SgtStarfield.ClampSize feature.
Added VR Stars demo scene to Basic Pack.
Added Water Level demo scene to Basic Pack.
SgtFloatingOrbit no longer notifies of position changes if they didn't occur.
Improved SRP support for components that depend on camera information.
Fixed Planet Pack 1 dependencies.
Added night light support to the Planet shader.
Added new demo scenes for the Debris feature.
Updated Solar System Pack link.
Updated Solar System Pack for better realism.
Added automatic Universe feature support to SgtStarfieldInfinite.
Added SgtCamera.UseOrigin setting for Universe feature compatibility.
Added SgtStarfield.StretchLimit to improve warp effects at high speed.
This is the base class for all starfields, providing a simple interface for generating meshes from a list of stars, as well as the material to render it.
The layout of cells in the texture.
The amount of columns in the texture.
The amount of rows in the texture.
The rects of each cell in the texture.
This component allows you to draw a volumetric atmosphere. The atmosphere is rendered using two materials, one for the surface (inner), and one for the sky (outer).
The outer part of the atmosphere is automatically generated by this component using the OuterMesh you specify.
The inner part of the atmosphere is provided by you (e.g. a normal sphere GameObject), and is specified in the SgtSharedMaterial component that this component automatically adds.
The material used to render this component.
This allows you to set the overall color of the atmosphere.
The Color.rgb values will be multiplied by this.
The radius of the meshes set in the SgtSharedMaterial.
This allows you to set the mesh used to render the atmosphere. This should be a sphere.
This allows you to set the radius of the OuterMesh. If this is incorrectly set then the atmosphere will render incorrectly.
If you have a big object that is both inside and outside of the atmosphere, it can cause a sharp intersection line. Increasing this setting allows you to change the smoothness of this intersection.
This allows you to set how high the atmosphere extends above the surface of the planet in local space.
This allows you to adjust the fog level of the atmosphere on the surface.
This allows you to adjust the fog level of the atmosphere in the sky.
This allows you to control how quickly the sky reaches maximum opacity as the camera enters the atmosphere.
1 = You must go down to ground level before the opacity reaches max.
2 = You must go at least half way down to the surface.
This allows you to set the altitude where atmospheric density reaches its maximum point. The lower you set this, the foggier the horizon will appear when approaching the surface.
This allows you to offset the camera distance in world space when rendering the atmosphere, giving you fine control over the render order.
This setting allows you to increase or decrease how much this atmosphere occludes flares using the SgtOcclusionScaler component.
Should the night side of the atmosphere have different sky values?
The 'Sky' value of the night side.
The transition style between the day and night.
The start point of the day/sunset transition (0 = dark side, 1 = light side).
The end point of the day/sunset transition (0 = dark side, 1 = light side).
The power of the night transition.
This component allows you to generate the SgtAtmosphere.InnerDepthTex and SgtAtmosphere.OuterDepthTex fields.
This allows you to set the color that appears on the horizon.
The base color of the inner texture.
The transition style between the surface and horizon.
The strength of the inner texture transition.
The strength of the inner texture transition.
The base color of the outer texture.
The transition style between the sky and horizon.
The strength of the outer texture transition.
The strength of the outer texture transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAtmosphere component's InnerDepth setting using the exported asset.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAtmosphere component's OuterDepth setting using the exported asset.
This component modifies the SgtAtmosphere.Height based on camera proximity.
The minimum distance between the atmosphere center and the camera position in local space.
The maximum distance between the atmosphere center and the camera position in local space.
The SgtAtmosphere.Height value that will be set when at or below DistanceMin.
The SgtAtmosphere.Height value that will be set when at or above DistanceMax.
This component allows you to generate the SgtAtmosphere.LightingTex field.
The transition style between the day and night.
The start point of the day/sunset transition (0 = dark side, 1 = light side).
The end point of the sunset/night transition (0 = dark side, 1 = light side).
The sharpness of the sunset red channel transition.
The sharpness of the sunset green channel transition.
The sharpness of the sunset blue channel transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAtmosphere component's LightingTex setting using the exported asset.
This component is used to render the SgtAtmosphere component.
This component allows you to generate the SgtAtmosphere.ScatteringTex field.
The transition style between the day and night.
The start point of the day/sunset transition (0 = dark side, 1 = light side).
The end point of the sunset/night transition (0 = dark side, 1 = light side).
The sharpness of the sunset red channel transition.
The sharpness of the sunset green channel transition.
The sharpness of the sunset blue channel transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAtmosphere component's ScatteringTex setting using the exported asset.
This component allows you to render an aurora above a planet. The aurora can be set to procedurally animate in the shader.
The material used to render this component.
This allows you to set the overall color of the aurora.
The Color.rgb values will be multiplied by this.
This allows you to offset the camera distance in world space when rendering the aurora, giving you fine control over the render order.
This allows you to set the random seed used during procedural generation.
The inner radius of the aurora mesh in local space.
The inner radius of the aurora mesh in local space.
The amount of aurora paths/ribbons.
The amount of quads used to build each path.
The minimum length of each aurora path.
The maximum length of each aurora path.
The minimum distance between the pole and the aurora path start point.
The maximum distance between the pole and the aurora path start point.
The probability that the aurora path will begin closer to the pole.
The probability that the aurora path will start on the northern pole.
The amount of waypoints the aurora path will follow based on its length.
The strength of the aurora waypoint twisting.
The strength of the aurora waypoint random displacement.
The sharpness of the fading at the start and ends of the aurora paths.
The amount of times the main texture is tiled based on its length.
The flatness of the aurora path.
The amount of height changes in the aurora path.
The possible colors given to the top half of the aurora path.
The amount of color changes an aurora path can have based on its length.
The minimum opacity multiplier of the aurora path colors.
The amount of alpha changes in the aurora path.
The strength of the aurora path position changes in local space.
The amount of the animation strength changes along the aurora path based on its length.
The maximum angle step between sections of the aurora path.
The amount of the animation angle changes along the aurora path based on its length.
This component allows you to generate the SgtAurora.MainTex field.
The strength of the noise points.
The amount of noise points.
The random seed used when generating this texture.
The transition style between the top and middle.
The transition strength between the top and middle.
The point separating the top from bottom.
The base color of the aurora starting from the bottom.
The transition style between the bottom and top of the aurora.
The strength of the color transition between the bottom and top.
The transition style between the bottom and middle.
The transition strength between the bottom and middle.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAurora component's MainTex setting using the exported asset.
This component is used to render the SgtAurora component.
This component allows you to generate the SgtAurora.NearTex field.
The ease type used for the transition.
The sharpness of the transition.
The start point of the fading.
Should this component also control the aurora's NearRangeRecip setting?
-1 = Don't override.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtAurora component's NearTex setting using the exported asset.
This component allows you to generate procedurally placed quads on the edge of a sphere.
The quads can then be textured using clouds or stars, and will follow the rendering camera, creating a backdrop.
This backdrop is very quick to render, and provides a good alternative to skyboxes because of the vastly reduced memory requirements.
The material used to render this component.
This allows you to set the overall color of the backdrop.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the starfield. If this texture can contains multiple stars then you can specify their location using the Atlas setting.
If the main texture of this material contains multiple textures in an atlas, then you can specify them here.
Should the stars fade out instead of shrink when they reach a certain minimum size on screen?
This allows you to set the random seed used during procedural generation.
The radius of the starfield.
Should more stars be placed near the horizon?
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component is used to render the SgtBackdrop component.
This class stores data for one quad generated by SgtBackdrop, this is typically procedurally generated.
Temp instance used when generating the starfield
The coordinate index in the atlas texture.
Color tint of this quad.
Radius of this quad in local space.
Angle of this quad in degrees.
Position of the quad in local space.
How fast this star pulses.
The pulse position will be offset by this value so they don't all pulse the same.
This component will procedurally generate a mesh that can be used to render stars or clouds in the background..
This allows you to set the random seed used during procedural generation.
The radius of the background mesh.
Should more quads be placed near the horizon?
The amount of quads that will be generated in the background.
The minimum radius of quads in the background.
The maximum radius of quads in the background.
How likely the size picking will pick smaller quads over larger ones (1 = default/linear).
This base class contains the functionality to render an asteroid belt.
The material used to render this component.
This allows you to set the overall color of the belt.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the belt. If this texture can contains multiple asteroids then you can specify their location using the Atlas setting.
If the main texture of this material contains multiple textures in an atlas, then you can specify them here.
The amount of seconds this belt has been animating for.
The animation speed of this belt.
This stores all information about an asteroid in an SgtBelt___ component.
Temp instance used when generating the belt.
The coordinate index in the asteroid texture.
Color tint of this asteroid.
Radius of this asteroid in local space.
Height of this asteroid's orbit in local space.
The base roll angle of this asteroid in radians.
How fast this asteroid rolls in radians per second.
The base angle of this asteroid's orbit in radians.
The speed of this asteroid's orbit in radians.
The distance of this asteroid's orbit in radians.
This component allows you to specify the exact position/size/etc of each asteroid in this asteroid belt.
This allows you to specify how much light the asteroids can block when using light flares.
This allows you to specify the outer radius of the belt when calculating lighting.
The custom asteroids in this belt.
This component allows you to generate the SgtBelt.LightingTex field.
How sharp the incoming light scatters forward.
How sharp the incoming light scatters backward.
The strength of the back scattered light.
The of the perpendicular scattered light.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtBelt component's LightingTex setting using the exported asset.
This component is used to render the SgtBelt component.
This component allows you to generate an asteroid belt with a simple exponential distribution.
This allows you to set the random seed used during procedural generation.
The thickness of the belt in local coordinates.
The higher this value, the less large asteroids will be generated.
The radius of the inner edge of the belt in local coordinates.
The speed of asteroids orbiting on the inner edge of the belt in radians.
The radius of the outer edge of the belt in local coordinates.
The speed of asteroids orbiting on the outer edge of the belt in radians.
The higher this value, the more likely asteroids will spawn on the inner edge of the ring.
How much random speed can be added to each asteroid.
The amount of asteroids generated in the belt.
Each asteroid is given a random color from this gradient.
The maximum amount of angular velocity each asteroid has.
The minimum asteroid radius in local coordinates.
The maximum asteroid radius in local coordinates.
How likely the size picking will pick smaller asteroids over larger ones (1 = default/linear).
This component turns the current GameObject into a billboard that always faces the camera.
This feature can be used with the SpriteRenderer or SgtFlare (Flare feature) components.
If the camera rolls, should this billboard roll with it?
If your billboard is clipping out of view at extreme angles, then enable this.
This component allows you to render a singularity/black hole.
The material used to render this component.
The mesh applied used to render the black hole. This should be a sphere.
The higher you set this, the smaller the spatial distortion will be.
The higher you set this, the more space will bend around the black hole.
This allows you to control the overall size of the hole relative to the pinch.
This allows you to control how sharp/abrupt the transition between space and the event horizon is.
This allows you to control the color of the black hole past the event horizon.
The color of the tint.
This allows you to control how sharp/abrupt the transition between the event horizon and the tinted space is.
This allows you to fade the edges of the black hole. This is useful if you have multiple black holes near each other.
This component is used to render the SgtBlackHole component.
This component monitors the attached Camera for modifications in roll angle, and stores the total change.
The amount of degrees this camera has rolled (used to counteract billboard non-rotation).
A quaternion of the current roll angle.
A matrix of the current roll angle.
This stores all active and enabled instances of this component.
This component allows you to move the current GameObject based on WASD/mouse/finger drags. NOTE: This requires the CwInputManager in your scene to function.
Is this component currently listening for inputs?
How quickly the position goes to the target value (-1 = instant).
If you want movements to apply to Rigidbody.velocity, set it here.
If the target is something like a spaceship, rotate it based on movement?
The speed of the velocity rotation.
The movement speed will be multiplied by this when near to planets.
The movement speed will be multiplied by this when far from planets.
The higher you set this, the faster the SpeedMin value will be reached when approaching planets.
The keys/fingers required to move left/right.
The keys/fingers required to move backward/forward.
The keys/fingers required to move down/up.
This class can be used to easily save & load the state of an object (e.g. transform position) based on the camera rendering state.
The camera associated with this state.
This component allows you to render a sphere around a planet with a cloud cubemap.
The material used to render this component.
This allows you to set the overall color of the cloudsphere.
The Color.rgb values will be multiplied by this.
This allows you to set the cubemap texture applied to the cloudsphere.
This allows you to set the radius of the cloudsphere in local space.
This allows you to offset the camera distance in world space when rendering the cloudsphere, giving you fine control over the render order.
Should the stars fade out if they're intersecting solid geometry?
This allows you to set the mesh used to render the cloudsphere. This should be a sphere.
This allows you to set the radius of the Mesh. If this is incorrectly set then the cloudsphere will render incorrectly.
This component allows you to generate the DepthTex setting for cloudsphere materials.
The rim transition style.
The rim color.
The rim transition sharpness.
The density of the atmosphere.
The strength of the density fading in the upper atmosphere.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtCloudsphere component's DepthTex setting using the exported asset.
This component allows you to generate the LightingTex setting for cloudsphere materials.
The transition style between the day and night.
The start point of the sunset (0 = dark side, 1 = light side).
The end point of the sunset (0 = dark side, 1 = light side).
The sharpness of the sunset red channel transition.
The sharpness of the sunset green channel transition.
The sharpness of the sunset blue channel transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtCloudsphere component's LightingTex setting using the exported asset.
This component is used to render the SgtCloudsphere component.
This component allows you to generate the NearTex setting for cloudsphere materials.
The ease type used for the transition.
The sharpness of the transition.
The start point of the fading.
Should this component also control the starfield's NearRangeRecip setting?
-1 = Don't override.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtCloudsphere component's NearTex setting using the exported asset.
This class contains some useful methods used by this asset.
This event allows you to register a custom occlusion calculation.
Gets the byte offset of a texture channel based on its format.
Channel = 0 = Red.
Channel = 1 = Green.
Channel = 2 = Blue.
Channel = 3 = Alpha.
This component handles a single debris object.
Called when this debris is spawned (if pooling is enabled).
Called when this debris is despawned (if pooling is enabled).
Can this debris be pooled?
The current state of the scaling.
The prefab this was instantiated from.
This gets automatically copied when spawning debris.
The cell this debris was spawned in.
This component allows you to spawn debris prefabs around a target point (e.g. camera), where each debris object must lie inside a grid square, allowing you to evenly distribute debris over the scene.
The transform the debris will spawn around.
None/null = Main Camera.
The shapes the debris will spawn inside.
The distance from the target that debris begins spawning.
The distance from the target that debris gets hidden.
This allows you to set how many cells are in the grid on each axis within the Hide Distance.
How far from the center of each cell the debris can be spawned. This should be decreased to stop debris intersecting.
The maximum expected amount of debris based on the cell size settings.
The minimum scale multiplier of the debris.
The maximum scale multiplier of the debris.
If this is above 0 then small debris are more likely to spawn. If this value is below 0 then big debris are more likely to spawn.
Should the debris be given a random rotation, or inherit from the prefab that spawned it?
This allows you to set the random seed used during procedural generation.
These prefabs are randomly picked from when spawning new debris.
This component allows you to randomly spawn debris around the camera over time.
If this transform is inside the radius then debris will begin spawning.
The shapes the debris will spawn inside.
How quickly the debris shows after it spawns.
The distance from the follower that debris begins spawning.
The distance from the follower that debris gets hidden.
Should all the debris be automatically spawned at the start?
The maximum amount of debris that can be spawned.
The minimum amount of seconds between debris spawns.
The maximum amount of seconds between debris spawns.
The minimum scale multiplier applied to spawned debris.
The maximum scale multiplier applied to spawned debris.
These prefabs are randomly picked from when spawning new debris.
This component is used by all the demo scenes to perform common tasks. Including modifying the current scene to make it look consistent between different rendering pipelines.
If you enable this setting and your project is running with HDRP and your scene contains SgtAtmosphere components with scattering, then their ScatteringHdr settings will be enabled.
This component adds basic Pitch/Yaw controls to the current GameObject (e.g. camera) using mouse or touch controls.
The key that must be held for this component to activate on desktop platforms.
None = Any mouse button.
Fingers that began touching the screen on top of these UI layers will be ignored.
The target pitch angle in degrees.
The speed the pitch changed relative to the mouse/finger drag distance.
The minimum value of the pitch value.
The maximum value of the pitch value.
The target yaw angle in degrees.
The speed the yaw changed relative to the mouse/finger drag distance.
Clamp the yaw value?
The minimum value of the pitch value.
The maximum value of the pitch value.
How quickly the rotation transitions from the current to the target value (-1 = instant).
This component modifies the attached Rigidbody component's drag value based on nearby SgtDragSource components in the scene.
The attached Rigidbody will be given this drag by default.
The allows you to choose which SgtDragSource layers are used.
This component allows you to define a drag source, which can be used to apply drag to Rigidbody components that have the SgtDragReceiver attached.
The drag applied to the drag receivers.
This allows you to specify the shape of this drag volume.
This component rotates the current GameObject to the rendering camera.
If the camera rolls, should this billboard roll with it?
If your billboard is clipping out of view at extreme angles, then enable this.
This stores all active and enabled instances of this component.
All SgtFastBillboards will be updated from here.
This stores all active and enabled instances of this component.
This component allows you to generate a high resolution mesh flare.
The material used to render this component.
This allows you to set the mesh used to render the flare.
Should the flare automatically snap to cameras.
The distance from the camera this flare will be placed in world space.
This allows you to offset the camera distance in world space when rendering the flare, giving you fine control over the render order.
This component allows you to generate the material and texture for an SgtFlare.
The base color will be multiplied by this.
The color transition style.
The sharpness of the red transition.
The sharpness of the green transition.
The sharpness of the blue transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtFlare component's Material setting using the exported asset.
This component allows you to generate the SgtFlare.Mesh field.
The amount of points used to make the flare mesh.
The base radius of the flare in local space.
Deform the flare based on cosine wave?
The strength of the wave in local space.
The amount of wave peaks.
The sharpness of the waves.
The angle offset of the waves.
Deform the flare based on noise?
The strength of the noise in local space.
The amount of noise points.
The angle offset of the noise.
The random seed used for the random noise.
This method allows you to export the generated mesh as an asset.
Once done, you can remove this component, and set the SgtFlare component's Mesh setting using the exported asset.
This component is used to render the SgtFlare component.
This component allows you to adjust the brightness of .
The brightness value when at or below the DistanceMin.
The brightness value when at or above the DistanceMax.
The distance where the BrightnessNear will be used.
The distance where the BrightnessFar will be used.
The calculated brightness value will be output via this event.
This component marks the current GameObject as a camera. This means as soon as the transform.position strays too far from the origin (0,0,0), it will snap back to the origin.
After it snaps back, the SnappedPoint field will be updated with the current position of the SgtFloatingOrigin component.
The maximum camera distance objects can render at when using the SgtFloatingMassive component.
When the transform.position.magnitude exceeds this value, the position will be snapped back to the origin.
Every time this camera's position gets snapped, its position at that time is stored here. This allows other objects to correctly position themselves relative to this.
Called when this camera's position snaps back to the origin (Vector3 = delta).
This method will fill the instance with the first active and enabled SgtFloatingCamera instance in the scene and return true, or return false.
This method converts the specified world space position into a universal SgtPosition.
This method converts the specified universal SgtPosition into a world space position.
This method converts the specified universal SgtPosition into a world space position.
If the current Transform.position has strayed too far from the origin, this method will then call Snap.
This method will reset the current Transform to 0,0,0 then update all SgtFloatingObjects in the scene.
This component makes the current SgtPoint follow the Target SgtPoint.
This is useful because you can't parent/child SgtPoint components like SgtFloatingCamera and SgtFloatingObject.
This allows you to specify the SgtFloatingPoint this component will follow.
How quickly this point follows the target.
-1 = instant.
Should this transform's rotation also match that of the target?
This allows you to specify a positional offset relative to the Target.
This allows you to specify a rotational offset relative to the Target.
This component will rotate the current GameObject toward the SgtFloatingOrigin point. This makes directional lights compatible with the Universe feature.
This stores all active and enabled instances of this component.
This component allows you to spawn a prefab as a child of the current GameObject when the floating camera gets within the specified range.
The prefab that will be spawned.
If the camera is closer than this distance, then the LOD will disappear.
If the camera is farther than this distance, then the LOD will disappear.
This will be set while the LOD is within range.
This allows you to get the spawned prefab clone.
This component works like SgtFloatingObject, but it will scale the object toward the camera if it's too far away to render.
This setting allows you to adjust the per-axis size of this object.
The base scale of this object.
This component turns a normal GameObject + Transform into one that works with the Universe feature.
Keep in mind the Transform.position value will be altered based on camera movement, so certain components may not work correctly without modification.
For example, if you make this Transform.position between two positions, then those positions will be incorrect when the scene origin snaps to a new position when using the Universe feature.
To correctly handle this scenario, you must hook into the either this component's OnSnap event, or the static SgtFloatingCamera.OnPositionChanged event, and offset your position values from the given Vector3 delta.
This allows you to set the random seed used during procedural generation. If this object is spawned from an SgtFloatingSpawner___ component, then this will automatically be set.
If this object is spawned from an SgtFloatingSpawner___ component, then it will be given a seed and this event will be invoked.
int = Seed.
This event is called every Update with the current distance to the camera.
This method allows you to reset the Position, which will then be calculated in Start, or when you manually call the DerivePosition method.
You should use this if your object is part of a prefab, and you want to spawn it using Transform.position values.
This method will calculate the Position based on the current Transform.position value relative to the current SgtFloatingCamera.
You can call this method to invoke the OnSpawn method.
This component will orbit the attached SgtFloatingPoint around the parent SgtFloatingPoint.
The radius of the orbit in meters.
How squashed the orbit is.
The local rotation of the orbit in degrees.
The local offset of the orbit in meters.
The current position along the orbit in degrees.
The orbit speed.
The center orbit point. NOTE: This should be null/None if it will be spawned by SgtFloatingSpawnerOrbit.
This component draws an orbit in 3D space.
The orbit that will be rendered by this component.
The material of the orbit.
The thickness of the visual ring in local space.
The amount of points used to draw the orbit.
The color of the orbit ring as it goes around the orbit.
This component updates the position of the attached ParticleSystem component when the origin snaps with the Universe feature.
This component wraps SgtPosition into a component, and defines a single point in the Universe.
Normal transform position coordinates are stored using floats (Vector3), but SgtPosition coordinates are stored using a long and a double pair.
The long is used to specify the current grid cell, and the double is used to specify the high precision relative offset to the grid cell.
Combined, these values allow simulation of the whole observable universe.
The position wrapped by this component.
Whenever the Position values are modified, this gets called. This is useful for components that depend on this position being known at all times (e.g. SgtFloatingOrbit).
This method will invoke the OnPositionChanged event.
This method will apply the current Position to the Transform.Position, in case they go out of sync.
This method allows you to change the whole Position state, and it will automatically call the PositionChanged method if the position is different.
This component should modify SgtFloatingObject to work with Rigidbodies that have interpolation to eliminate stuttering from origin shifts. But for some reason it doesn't do anything?
All prefabs spawned from SgtFloatingLod and SgtFloatingSpawner___ will be attached to this GameObject.
This stores all active and enabled instances of this component.
This component scales the current SgtFloatingObject based on its distance to the SgtFloatingOrigin.
This scaling allows you to see the object from a greater distance than usual, which is very useful for star/planet/etc billboards you need to see from a distance.
If you want a different Transform to be scaled, you can specify it here.
The base scale of the object.
The final scale will be multiplied by this.
If the distance between the camera and this object is beyond this value, this object will be scaled to 0 and be invisible.
The SgtFloatingObject component alongside this component.
This is the base class for all Universe spawners, providing a useful methods for spawning and handling prefabs.
The camera must be within this range for this spawner to activate.
If you want to define prefabs externally, then you can use the SgtSpawnList component with a matching Category name.
If you aren't using a spawn list category, or just want to augment the spawn list, then define the prefabs you want to spawn here.
If you disable this then the spawned object will use the same prefab as the spawn index.
The SgtFloatingObject component alongside this component.
This component will automatically spawn prefabs in orbit around the attached SgtFloatingPoint.
The amount of prefabs that will be spawned.
The maximum degrees an orbit can tilt.
The maximum amount an orbit can be squashed.
The minimum distance away the prefabs can spawn.
The maximum distance away the prefabs can spawn in meters.
This component will automatically spawn prefabs in a ring around the attached SgtFloatingPoint.
The amount of prefabs that will be spawned.
The minimum distance away the prefabs can spawn.
The maximum distance away the prefabs can spawn in meters.
This component will automatically spawn prefabs in a circle around the attached SgtFloatingPoint.
The amount of prefabs that will be spawned.
This component will spawn prefabs within this radius in world space.
The higher this value, the more likely the spawned objects will be pushed to the edge of the radius.
This allows you to set how much orbital velocity the spawned objects get if they have a Rigidbody attached.
This component monitors the specified SgtFloatingCamera or SgtFloatingObject point for position changes, and outputs the speed of those changes to the OnString event.
The point whose speed will be monitored.
The format of the speed text.
This allows you to control where in the game loop the speed will be calculated.
Each time the speed updates this event will fire, which you can link to update UI text.
This component marks the attached LeanFloatingPoint component as a warpable target point. This allows you to pick the target using the SgtWarpPin component.
The shorthand name for this warp target.
The distance from this SgtFloatingPoint we should warp to, to prevent you warping too close.
This stores all active and enabled instances of this component.
This is the base class for all warp styles.
The point that will be warped.
Allows you to warp to the target object.
Allows you to warp to the target point with the specified separation distance.
This component allows you to warp to the target when clicking a button.
The point that will be warped to.
The warp effect that will be used.
This component moves Rect above the currently picked SgtFloatingTarget. You can tap/click the screen to update the picked target.
Fingers that began touching the screen on top of these UI layers will be ignored.
The maximum distance between the tap/click point at the SgtWarpTarget in scaled screen space.
The currently picked target.
The parent rect of the pin.
The main rect of the pin that will be placed on the screen on top of the CurrentTarget.
The name of the pin.
The group that will control hide/show of the pin.
The warp component that will be used.
Hide the pin if we're within warping distance?
This component will smoothly warp to the target, where the speed will slow down near the start of the travel, and near the end.
Seconds it takes to complete a warp.
Warp smoothstep iterations.
Currently warping?
Current warp progress in seconds.
Start position of the warp.
Target position of the warp.
This component allows you to render a galaxy based on a deformed sphere mesh with multiple textures that are blended together.
The material used to render this component.
The sphere mesh used to render the galaxy.
The radius of the nebula in local space.
If you want the nebula to be round then set this to 0, if you want it to be more like a galaxy then increase this.
This component is used to render the SgtGalaxy component.
This component applies force to the attached Rigidbody based on nearby SgtGravitySource components.
This component allows you to define a gravity source, which can be used to attract Rigidbodies with the SgtGravityReceiver attached.
The mass of this gravity source.
If you enable this then the Mass setting will be automatically copied from the attached Rigidbody.
This component allows you to render volumetric jovian (gas giant) planets.
The material used to render this component.
This allows you to set the overall color of the jovian.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the jovian.
This allows you to set the flow texture applied to the jovian.
This allows you to offset the camera distance in world space when rendering the jovian, giving you fine control over the render order.
This setting allows you to increase or decrease how much this atmosphere occludes flares using the SgtOcclusionScaler component.
This allows you to control how thick the atmosphere is when the camera is inside its radius.
This allows you to set the mesh used to render the jovian. This should be a sphere.
This allows you to set the radius of the Mesh. If this is incorrectly set then the jovian will render incorrectly.
This allows you to set the radius of the jovian in local space.
This allows you to set the radius of the jovian in local space when using distance calculations. Distance calculations normally tell you how far from the surface of a planet you are, but since a jovian isn't solid, you may want to customize this based on your project.
This component allows you to generate the DepthTex setting for jovian materials.
The rim transition style.
The rim transition sharpness.
The rim color.
The density of the atmosphere.
The strength of the density fading in the upper atmosphere.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtJovian component's DepthTex setting using the exported asset.
This component allows you to generate the LightingTex setting for jovian materials.
The transition style between the day and night.
The start point of the sunset (0 = dark side, 1 = light side).
The end point of the sunset (0 = dark side, 1 = light side).
The sharpness of the sunset red channel transition.
The sharpness of the sunset green channel transition.
The sharpness of the sunset blue channel transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtJovian component's LightingTex setting using the exported asset.
This component is used to render the SgtJovian component.
This component allows you to generate the ScatteringTex setting for cloudsphere materials.
The transition style between the day and night.
The start point of the sunset (0 = dark side, 1 = light side).
The end point of the sunset (0 = dark side, 1 = light side).
The sharpness of the sunset red channel transition.
The sharpness of the sunset green channel transition.
The sharpness of the sunset blue channel transition.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtJovian component's ScatteringTex setting using the exported asset.
This struct allows you to define a length or distance in the Universe. Using one value can be difficult to visualize, so the specified value is multiplied by the specified galactic scale (e.g. AU), allowing you to more easily specify large distances.
This component allows you to add a gravitational lensing effect to your scene, as seen around black holes, and other dense bodies.
The lens effect works similar to reflection probes, and uses a cubemap as a source for the texture data.
This means it renders very fast, works consistently across the screen, and can simulate lensing in any direction.
The material used to render this component.
The mesh used to render the lens effect. This should be a sphere.
This allows you to set the width & height of each face in the cubemap this component renders.
This allows you to set the world space distance where the specified resolution will be used. Each time the distance doubles, the resolution will be halved.
0 = Ignore distance, and use a fixed resolution.
This allows you to control how often the cubemap texture updates in seconds.
-1 = Manual only.
0 = Every frame.
2 = Every two seconds.
This allows you to control how the edge of the effect fades away into the normal scene. There will usually be some difference between the actual scene and the spatially distorted scene rendered from the cubemap, and this can hide that transition.
This allows you control how far from the outer edge the spatial distortion begins.
This allows you control the strength of the spatial distortion at the event horizon. Higher values will cause the light to bend around, allowing you to see backwards.
This allows you to set the size of the black hole disc.
This allows you to control the thickness of the black hole disc (event horizon).
This property gives you the Camera alongside this component.
This component is used to render the SgtLens component.
The lighting system built into Unity isn't suitable for all scenarios, so this component can be used to extend it with a custom lighting system for specific components that support this.
If the Light component alongside this component is directional, but it's constantly rotated toward the camera to give the illusion of it being a point light, then you should enable this setting.
If you enable this setting, SGT components will use the sibling Light.intensity value multiplied by the Brightness value.
The brightness value of this light as seen by SGT components.
This component will procedurally change the Intensity of the attached Light to simulate flickering.
The minimum Multiplier value.
The maximum Multiplier value.
The current animation position.
The current animation speed.
This component handles rendering of lightning spawned from the SgtLightningSpawner component.
The lightning spawner this belongs to. If this is null then this GameObject will automatically be destroyed.
The maximum amount of seconds this lightning has been active for.
The maximum amount of seconds this lightning can be active for.
This component allows you to spawn animated lightning sprites around a planet.
The material used to render this component.
The minimum delay between lightning spawns.
The maximum delay between lightning spawns.
The minimum life of each spawned lightning.
The maximum life of each spawned lightning.
The radius of the spawned lightning mesh in local coordinates.
The size of the lightning in degrees.
The amount of rows and columns in the lightning mesh.
When lightning is spawned, its base color will be randomly picked from this gradient.
The lightning color.rgb values are multiplied by this, allowing you to quickly adjust the overall brightness.
The random sprite used by the lightning.
This component points the current light toward the rendering camera, giving you the illusion that it's a point light. This is useful for distant lights that you want to cast shadows.
This component allows you to render a nebula or galaxy based on a deformed sphere mesh with multiple textures that are blended together.
The material used to render this component.
The sphere mesh used to render the nebula.
The radius of the nebula in local space.
The frequency of the displacement noise.
The maximum height displacement applied to the nebula mesh when deformed.
If you want the nebula to be round then set this to 0, if you want it to be more like a galaxy then increase this.
This method causes the nebula mesh to update based on the current settings. You should call this after you finish modifying them.
This component is used to render the SgtNebula component.
This class allows you to calculate how much light is occluded between two 3D points.
This method performs the calculations. The eye and tgt arguments store the position in .xyz, and the radius in .w, both in world space.
This component scales the current GameObject based on optical thickness between the current camera and the current position.
This is done using the SgtOcclusion.Calculate method, which works using Physics.Raycast, and custom occlusion checks.
You can add your own custom occlusion checks by hooking into the SgtHelper.OnCalculateOcclusion event.
The layers that will be sampled when calculating the occlusion.
This allows you to set the maximum scale when there is no depth.
This allows you to set the radius of the object that will be scaled (e.g. light flare). This changes how it get occluded by objects that pass in front.
Raycasts begin to break down beyond a certain distance depending on your scene scale, and this allows you to adjust that distance if required.
This component allows you to render a planet that has been displaced with a heightmap, and has a dynamic water level.
The sphere mesh used to render the planet.
If you want the generated mesh to have a matching collider, you can specify it here.
The radius of the planet in local space.
The material used to render the planet. For best results, this should use the SGT Planet shader.
If you want to apply a shared material (e.g. atmosphere) to this terrain, then specify it here.
Should the planet cast shadows?
Should the planet receive shadows?
The current water level.
0 = Radius.
1 = Radius + Displacement.
Should the planet mesh be displaced using the heightmap in the planet material?
The maximum height displacement applied to the planet mesh when the heightmap alpha value is 1.
If you enable this then the water will not rise, instead the terrain will shrink down.
This method causes the planet mesh to update based on the current settings. You should call this after you finish modifying them.
This component can be added alongside the SgtPlanet component to give it an animated water surface texture.
The color of shallow water.
The color of deep water.
The way the color transitions between shallow and deep.
This allows you to push the color toward the shallow or deep end.
The scale of the depth.
This method allows you to export the generated texture as an asset.
This component can be added alongside the SgtPlanet component to give it an animated water surface texture.
The generated water texture will be based on this texture.
The strength of the normal map.
The speed of the water animation.
This component is automatically generated by SGT components that implement GameObject pooling (e.g. SgtTerrainFace).
The name of the type this pool manages.
The pooled elements in this pool.
This stores all active and enabled instances of this component.
This class stores a coordinate in the Universe, and provides methods to manipulate them.
When the LocalX/Y/Z values exceed this value, the Global/X/Y/Z values will be modified to account for it, creating a grid system
The universe is 4.4e+26~ meters in radius
A long stores up to +- 9.2e+18~
Divide them, and you get 47696652.0723
Thus the below value allows you to simulate a universe that is larger than the current observable universe
The position in meters along the X axis, relative to the current global cell position.
The position in meters along the Y axis, relative to the current global cell position.
The position in meters along the Z axis, relative to the current global cell position.
The current grid cell along the X axis. Each grid cell is equal to 50000000 meters.
The current grid cell along the Y axis. Each grid cell is equal to 50000000 meters.
The current grid cell along the Z axis. Each grid cell is equal to 50000000 meters.
This component allows you to switch between a list of prefabs from UI button events.
The speed the prefabs will switch.
The prefab index that will be displayed.
The prefabs that can be switched between.
This method decrements Index by one, and wraps around the prefab count.
This method increments Index by one, and wraps around the prefab count.
This component is the basis for all procedural components in SGT.
This allows you to control when this component will be generated.
The seed used for automatic generation.
This method allows you to manually generate this component with the specified seed.
This component adds force the current GameObject in a random direction, with a random speed.
If you want to specify a force direction, set it here.
Minimum degrees per second.
Maximum degrees per second.
This component rotates the current GameObject along a random axis, with a random speed.
The default scale of your object.
The minimum multiplication of the BaseScale.
The maximum multiplication of the BaseScale.
This component rotates the current GameObject along a random axis, with a random speed.
Minimum degrees per second.
Maximum degrees per second.
This component allows you to procedurally generate the SpriteRenderer.color setting.
A color will be randomly picked from this gradient.
This component rotates the current GameObject along a random axis, with a random speed.
Minimum degrees per second.
Maximum degrees per second.
This component allows you to render a series of randomly rotated disks around a star that make the corona look volumetric and detailed.
The material used to render this component.
This allows you to set the overall color of the starfield.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the prominence.
This allows you to offset the camera distance in world space when rendering the jovian, giving you fine control over the render order.
This allows you to set the random seed used during procedural generation.
The amount of planes used to build the prominence.
The amount of quads used to build each plane.
The inner radius of the prominence planes in local coordinates.
The outer radius of the prominence planes in local coordinates.
This component is used to render the SgtProminence component.
This class wraps MaterialPropertyBlock to allow for the removal of specific properties.
This component rotates the current GameObject.
This component rotates the current GameObject.
The target local translation.
The GameObject layers we will raycast against.
The radius of the raycast, to prevent surface penetration by cameras.
This component allows you to render a ring (e.g. planetary ring, accretion disk).
This ring is split in half, to improve depth sorting behavior when placed around a planet.
The material used to render this component.
This allows you to set the overall color of the ring.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the starfield. If this texture can contains multiple stars then you can specify their location using the Atlas setting.
The radius of the inner edge of the ring in local space.
The radius of the outer edge of the ring in local space.
Should the ring be split into two parts to improve depth sorting with planets?
This allows you to set the draw order sorting point distance of the ring in local space.
This can be used to improve depth sorting when the ring is around a transparent jovian or atmosphere. This value should be similar to the RadiusOuter value, perhaps larger depending on the size of your planet.
This component allows you to generate the SgtRing.LightingTex field.
How sharp the incoming light scatters forward.
How sharp the incoming light scatters backward.
The strength of the back scattered light.
The of the perpendicular scattered light.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtRing component's LightingTex setting using the exported asset.
This component allows you to generate the SgtRing.MainTex field based on a simple RGB texture of a ring.
The source ring texture that will be filtered.
The format of the generated texture.
The sharpness of the light/dark transition.
This allows you to control the brightness.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtRing component's MainTex setting using the exported asset.
This component is used to render the SgtRing component.
This component allows you to generate the NearTex for the SgtRing component's material.
The ease type used for the transition.
The sharpness of the transition.
The start point of the fading.
Should this component also control the ring's NearRangeRecip setting?
-1 = Don't override.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtRing component's NearTex setting using the exported asset.
This component allows you to add shadows cast from an SgtShadow___ component to any opaque renderer in your scene.
The radius of this shadow receiver.
The renderers you want the shadows to be applied to.
This component allows you to cast a ring shadow from the current GameObject.
The texture of the shadow (left = inside, right = outside).
The inner radius of the ring casting this shadow (auto set if Ring is set).
The outer radius of the ring casting this shadow (auto set if Ring is set).
This component allows you to generate a blurred SgtShadowRing.Texture based on a normal texture.
The source ring texture that will be filtered.
The format of the generated texture.
The amount of blur iterations.
Overwrite the RGB channels with the alpha?
Invert the alpha channel?
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtShadowRing component's Texture setting using the exported asset.
This component allows you to cast a sphere shadow from the current GameObject.
The sharpness of the sunset red channel transition.
The power of the sunset green channel transition.
The power of the sunset blue channel transition.
The outer radius of the sphere in local space.
This is the base class for all volumetric shapes. These can be used to define regions where effects are visible.
Returns a 0..1 value, where 1 is fully inside
This component allows you to define a box shape that can be used by other components to perform actions confined to the volume.
The min/max size of the box.
The transition style between minimum and maximum density.
How quickly the density increases when inside the sphere.
This component allows you to group multiple SgtShape___ components and treat them as a single large volume.
The shapes associated with this group.
This component allows you to define a sphere shape that can be used by other components to perform actions confined to the volume.
The radius of this sphere in local space.
If this is set, then any point within Radius will have maximum density, and it will fall off to zero within the height range.
The transition style between minimum and maximum density.
How quickly the density increases when inside the sphere.
This component allows you to define a torus shape that can be used by other components to perform actions confined to the volume.
The radius of this torus in local coordinates.
The radial thickness of the torus in local space.
The transition style between minimum and maximum density.
How quickly the density increases when inside the torus.
This component stores a Material and a list of Renderers, and maintains that all renderers use the material as long as they are all part of this component.
The material that will be applied to all renderers.
This component makes the current gameObject orbit around its parent in a basic circle or ellipse shape.
The radius of the orbit in local coordinates.
How squashed the orbit is.
The local position offset of the orbit.
The local rotation offset of the orbit in degrees.
The current position along the orbit in degrees.
The orbit speed.
This component scales the current Transform based on its distance to the camera.
This scaling allows you to see the object from a greater distance than usual, which is very useful for star/planet/etc billboards you need to see from a distance.
The base scale of the object.
Scale is multiplied by this when at DistanceMin.
The distance where the scaling begins.
The distance where the scaling stops.
This component allows you to render a grid that can be deformed by SgtSpacetimeWell components.
The Material used to render all the spacetime meshes. This should use the Space Graphics Toolkit/Spacetime material.
The spacetime data collected by this component will be rendered to these Renderers.
The maximum amount of SgtSpacetimeWell components with the Gaussian distribution that can be rendered by this spacetime.
The maximum amount of SgtSpacetimeWell components with the Ripple distribution that can be rendered by this spacetime.
The maximum amount of SgtSpacetimeWell components with the Twist distribution that can be rendered by this spacetime.
The maximum amount of SgtSpacetimeWell components with the Pinch distribution that can be rendered by this spacetime.
Filter all the wells to require the same layer at this GameObject.
Filter all the wells to require the same tag at this GameObject.
Filter all the wells to require a name that contains this.
This tells you which wells this spacetime is currently rendering based on the current Require settings.
This will immediately apply the Material to all Renderers if you've changed any.
If you manually modified the Material, then you can call this method so they will be updated at the end of the frame.
If you manually modified the Renderers list, then you can call this method so they will be updated at the end of the frame.
This allows you create a new GameObject with the SgtSpacetime component attached.
This allows you create a new GameObject with the SgtSpacetime component attached.
This component can generate a plane grid mesh suitable for use with the SgtSpacetime component.
The size of the grid along the X axis.
The size of the grid along the Z axis.
The amount of quads along the X axis.
The amount of quads along the Z axis.
Should the mesh be centered, or begin at local 0,0?
This method allows you to export the generated mesh as an asset.
Once done, you can remove this component, and set the MeshFilter component's Mesh setting using the exported asset.
This allows you create a new GameObject with the SgtSpacetimeMesh component attached.
This allows you create a new GameObject with the SgtSpacetimeMesh component attached.
This component allows you to deform SgtSpacetime grids.
The method used to deform the spacetime.
The radius of this spacetime well.
The well will modify the spacetime positions by this amount.
The overall effect of the well will be multiplied by this.
Should the Strength get multiplied by the Opacity?
The frequency of the ripple.
The frequency offset.
The frequency offset speed per second.
The size of the twist hole.
The power of the twist hole.
This stores all active and enabled instances of this component.
This returns the Strength value depending on the Combine and Opacity settings.
This allows you create a new GameObject with the SgtSpacetimeWell component attached.
This allows you create a new GameObject with the SgtSpacetimeWell component attached.
This component allows you to create a list of SgtFloatingObject prefabs that are associated with a specific Category name.
This allows you to easily manage what objects get spawned from each type of spawner.
The type of prefabs these are (e.g. Planet).
The prefabs belonging to this spawn list.
This stores all active and enabled instances of this component.
This is the base class for all starfields that store star corner vertices the same point/location and are stretched out in the vertex shader, allowing billboarding in view space, and dynamic resizing.
The material used to render this component.
This allows you to set the overall color of the starfield.
The Color.rgb values will be multiplied by this.
This allows you to set the texture applied to the starfield. If this texture can contains multiple stars then you can specify their location using the Atlas setting.
If the main texture of this material contains multiple textures in an atlas, then you can specify them here.
Should the stars fade out instead of shrink when they reach a certain minimum size on screen?
Should the stars fade out if they're intersecting solid geometry?
Should the stars stretch if an observer moves?
The vector of the stretching.
The scale of the stretching relative to the velocity.
When warping with the Universe feature, the camera velocity can get too large, this allows you to limit it.
This component allows you to render a starfield with a distribution of a box.
This allows you to set the random seed used during procedural generation.
The +- size of the starfield.
How far from the center the distribution begins.
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component allows you to specify the exact position/size/etc of each star in this starfield.
The stars that will be rendered by this starfield.
This component allows you to render a starfield with a dome like distribution.
This allows you to set the random seed used during procedural generation.
The radius of the starfield.
This allows you to control if the stars should cluster near the horizon, or near the azimuth.
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component allows you to render a starfield with a distribution like an elliptical galaxy.
This allows you to set the random seed used during procedural generation.
The radius of the starfield.
Should more stars be placed near the horizon?
How far from the center the distribution begins.
Invert the distribution?
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component allows you to generate the SgtStarfield.FarTex field.
The transition style.
The sharpness of the transition.
Should this component also control the starfield's FarRangeRadius setting?
-1 = Don't override.
Should this component also control the starfield's FarRangeRecip setting?
-1 = Don't override.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtStarfield component's FarTex setting using the exported asset.
This component allows you to render a starfield that repeats forever.
This allows you to set the random seed used during procedural generation.
The size of the starfield in local space.
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component is used to render the SgtStarfield component.
This component allows you to generate the SgtStarfield.NearTex field.
The transition style.
The sharpness of the transition.
The start point of the fading.
Should this component also control the starfield's NearRangeRecip setting?
-1 = Don't override.
This method allows you to export the generated texture as an asset.
Once done, you can remove this component, and set the SgtStarfieldInfinite component's NearTex setting using the exported asset.
This component allows you to render a nebula as a starfield from a single picture.
This allows you to set the random seed used during procedural generation.
This texture used to color the nebula particles.
This brightness of the sampled SourceTex pixel for a particle to be spawned.
The amount of times a nebula point is randomly sampled, before the brightest sample is used.
This allows you to randomly offset each nebula particle position.
The calculation used to find the height offset of a particle in the nebula.
The calculation used to find the scale modified of each particle in the nebula.
The size of the generated nebula.
The brightness of the nebula when viewed from the side (good for galaxies).
The relationship between the Brightness and HorizontalBrightness relative to the viewing angle.
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
This allows you to control how much the underlying nebula pixel color influences the generated star color.
0 = StarColors gradient will be used directly.
1 = Colors will be multiplied together.
Should the star color luminosity be boosted?
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This component allows you to generate a starfield in a spiral pattern.
This allows you to set the random seed used during procedural generation.
The radius of the starfield.
The amount of spiral arms.
The amount each arm twists.
This allows you to set the thickness of the star distribution at the center of the spiral.
This allows you to set the thickness of the star distribution at the edge of the spiral.
This allows you to push stars away from the spiral, giving you a smoother distribution.
The amount of stars that will be generated in the starfield.
Each star is given a random color from this gradient.
The minimum radius of stars in the starfield.
The maximum radius of stars in the starfield.
How likely the size picking will pick smaller stars over larger ones (1 = default/linear).
The minimum animation speed of the pulsing.
The maximum animation speed of the pulsing.
This class stores information about a single star inside a starfield. These can either be manually populated using a custom starfield, or they're procedurally generated.
The coordinate index in the asteroid texture.
Color tint of this star.
Radius of this star in local space.
Angle in degrees.
Local position of this star relative to the starfield.
How fast this star pulses.
The pulse position will be offset by this value so they don't all pulse the same.
This component allows you to create a sphere mesh that will dynamically increase in detail as the camera (or other GameObject) approaches the surface.
The distance between the center and edge of the planet in local space before it's deformed.
When at the surface of the planet, how big should each triangle be?
The base resolution of the planet before LOD is used.
The higher this value, the more triangles will be in view.
If you enable this then the mesh will automatically update in edit mode.
The LOD will be based on the distance to this Transform.
None = Main Camera.
This allows you to control which areas certain terrain features appear on the mesh.
This event tells you when a mesh surface is scheduled to update, allowing you prepare data for this new configuration.
This event tells you when the terrain has finished updating.
This event tells you when a mesh surface should render, allowing you specify a custom material.
int = Render layer.
This method will cause the whole terrain mesh to be rebuilt.
This method returns the nearest SgtTerrain to the specified world point.
This method will snap the specified position to the surface of the terrain in local space.
This method tells you the LOD level where triangles are closest to the specified triangle size.
This method allows you to force the mesh to finish updating immediately.
This object can be used to convert a splat map texture into area data used by the SgtTerrainPlanet component.
The texture used to define the areas.
The splat map layers that will be extracted from the source textures.
This allows you to get how many splat maps are contained in the array data.
This tells you how many pixels are in each array layer.
This allows you to get the extracted splat data.
This component allows you to clamp the heights of the attached SgtTerrain to be within a specific range.
This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.
Terrain heights below this value will be clamped.
Terrain heights above this value will be clamped.
If you don't want the clamping to be abrupt, you can increase the thickness where the clamp transitions.
This controls the shape of the Thickness transition.
This component generates colliders for the current SgtTerrain, allowing you to use normal physics.
The colliders use the MeshCollider component, and are generated at a fixed resolution after the visual mesh for the specified ChunkSize is generated.
The terrain will be split into this many cells on each axis.
The radius in chunks around the camera that will have colliders.
1 = 3x3 chunks.
2 = 5x5 chunks.
3 = 7x7 chunks.
The width & height of the generated collider in quads. The higher you set this, the higher the collider quality. Setting this too high may make the colliders slow to generate.
The amount of frames between each collider generation. If you want higher performance you should set this higher. If you want quicker collider generation you should set this lower.
This component works like SgtTerrainHeightmap, but the heightmap will apply to one small area of the planet. This is useful if you want to add a specific feature to your planet at a specific location (e.g. a mountain).
The heightmap texture used to displace the mesh.
This allows you to choose which color channel from the heightmap texture will be used.
This allows you to control the maximum height displacement applied to the terrain.
This allows you to specify the local angle on the planet where the feature should appear in degrees.
0,0,0 = The feature will appear on the local -Z axis side.
This allows you to specify the scale of the feature in local space.
This component allows you to deform the attached SgtTerrain with a heightmap using equirectangular cylindrical projection.
The heightmap texture used to displace the mesh.
This allows you to choose which color channel from the heightmap texture will be used.
This allows you to control the maximum height displacement applied to the terrain.
This component allows you to glue the current Transform to the specified SgtTerrain. If you don't specify one, then the nearest one will be used.
The terrain this object is attached to.
None/null = Nearest.
This allows you to move the object up based on the surface normal in world space.
The surface normal will be calculated using this sample radius in world space. Larger values = Smoother.
This allows you to control where in the game loop the object position will be snapped.
This component allows you to create dynamic mesh LOD oceans suitable for use with the SGT / Terrain Ocean shader.
This allows you to specify the terrain used for the planet surface. This height data is written to the ocean meshed for depth information.
Invert the ocean mesh to draw the ocean underwater?
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the ocean material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the ocean material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the ocean material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This component allows you to render the SgtTerrain component using the SGT Planet shader.
Should the ocean surface texture be animated?
The generated water texture will be based on this texture.
The speed of the water animation.
The speed of the water animation.
Should the animated texture be applied to the first detail layer?
Should the animated texture be applied to the second detail layer?
Should the animated texture be applied to the third detail layer?
This component allows you to create dynamic mesh LOD planets suitable for use with the SGT / Terrain Planet shader.
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the planet material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the planet material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This allows you to bake detail texture tiling into the terrain mesh itself. This is superior to using the planet material's detail tiling setting, because it will avoid floating precision issues when extreme UV tiling is used.
This component allows you to render the SgtTerrain component using the SGT Planet shader.
The planet material that will be rendered.
Should the planet cast shadows?
Should the planet receive shadows?
Normals bend incorrectly on high detail planets, so it's a good idea to fade them out. This allows you to set the camera distance at which the normals begin to fade out in local space.
This allows you to specify the terrain used for the water surface. This is used to control where the beaches appear, if you enable that material feature.
This component allows you to spawn objects on the attached SgtTerrain using a splatmap.
This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.
If the prefabs are set to spawn in a specific area, this allows you to specify how far into the area you must travel before prefabs begin spawning.
The maximum amount of prefabs that can spawn per chunk.
The terrain will be split into this many cells on each axis.
The radius in chunks around the camera that will have prefabs.
1 = 3x3 chunks.
2 = 5x5 chunks.
3 = 7x7 chunks.
How should the spawned prefabs be rotated?
If your terrain has an atmosphere/corona and your spawned objects are large enough to be covered by it, then specify its SgtSharedMaterial here.
The prefabs that will be spawned.
This component allows you to render the SgtTerrain component using the specified SgtShadowLayer.
By default, only Unity's built-in shadows will be cast on terrains, and this allows you to cast shadow from rings and planets on this planet.
The shared material that will be rendered.
This component allows you to render the SgtTerrain component using the specified SgtSharedMaterial.
Components like SgtAtmosphere give you a shared material.
The shared material that will be rendered.
This component allows you to deform the attached SgtTerrain with procedural simplex noise.
This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.
The amount of peaks and valleys across the mesh.
The maximum +- displacement of the first octave.
Use ridged simplex noise?
The random noise seed.
The amount of noise layers.
This component can add sine wave heights to your terrain. This is mostly used for debugging the terrain or learning how to implement your own height generators.
This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.
The amount of peaks and valleys across the mesh.
The maximum +- displacement of the first octave.
The amount of noise layers.
This class contains the core classes and methods used to construct the SgtTerrain mesh.
This component swaps the planet's atmosphere material when the camera goes underwater.
The main ocean applied to the planet. This is used for the radius check to see if the camera is underwater.
The terrain material renderer. This component swaps its shared material based on the camera position.
The material applied to the terrain when the camera is under the water.
This component allows you to create simple thrusters that can apply forces to Rigidbodies based on their position. You can also use sprites to change the graphics.
How active is this thruster? 0 for off, 1 for max power, -1 for max reverse, etc.
The rigidbody you want to apply the thruster forces to
The type of force we want to apply to the Rigidbody.
The force mode used when adding force to the Rigidbody.
The maximum amount of force applied to the rigidbody (when the throttle is -1 or 1).
Create a child GameObject with a thruster attached
This component allows you to control the specified thrusters with the specified control axes.
Is this component currently listening for inputs?
This allows you to specify each thruster group, each of which is controlled separately.
This component allows you to create simple thrusters that can apply forces to Rigidbodies based on their position. You can also use sprites to change the graphics
The rotation offset in degrees.
This component allows you to create simple thrusters that can apply forces to Rigidbodies based on their position. You can also use sprites to change the graphics
The thruster the scale will be based on.
The speed at which the scale reaches its target value.
The scale value that's applied by default.
The scale value that's added when the throttle is 1.
The amount the ThrottleScale flickers over time.
The offset of the flicker animation.
The speed of the flicker animation.
Thank you for using Space Graphics Toolkit ❤️
Why does each feature require so many components?
Which versions of Unity are supported?
Does this work on mobile/console/WebGL/etc?