Space Graphics Toolkit


DOCUMENTATION

Thank you for using Space Graphics Toolkit ❤️

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.


Features

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.



Packs

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.




Required Packages

NOTE  Space Graphics Toolkit requires the Burst package to be manually installed if you want to use the Terrain, Nebula, or Galaxy features.

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!



How do I upgrade?

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.

NOTE  There are occasionally major updates to SGT that require you to rebuild parts of your scene. You should check the update Change Log to see if this is the case, and decide if you really want to upgrade.


Where do I get more packs?

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.


[FREE] Alien Worlds Pack

This pack contains a selection of realistic looking planets with an alien theme.

You can download it from HERE.

NOTE  This pack requires the full Space Graphics Toolkit asset to function.


[FREE] Galaxy Pack

This pack contains a variety of galaxies.

You can download it from HERE.

NOTE  This pack requires the full Space Graphics Toolkit asset to function.


[FREE] Nebula Pack

This pack contains a variety of nebulae.

You can download it from HERE.

NOTE  This pack requires the full Space Graphics Toolkit asset to function.


[FREE] Solar System Pack

This pack contains all major solar system bodies, including the Moon and multiple versions of The Sun.

You can download it from HERE.

NOTE  This pack requires the full Space Graphics Toolkit asset to function.


[PAID] Space Graphics Planets

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.

NOTE  This is a standalone asset, so it does NOT require SGT.
NOTE  If you already have SGT then this package will automatically be half price on the store!



Why does each feature require so many components?

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.



How do I use this from C#?

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.



Which versions of Unity are supported?

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.

NOTE  The asset store may have versions of this asset for older versions of Unity (e.g. Unity 2018), but these versions are no longer maintained and are likely missing the latest SGT features and bug fixes.

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.



Is URP/HDRP supported?

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.


Better Shaders

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.



Lights

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.

NOTE  If your project targets one specific rendering pipeline, then this component isn't necessary.


Depth Mode (Standard)

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.



Depth Texture & Opaque Texture (URP)

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.



Volume (HDRP)

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.



Atmosphere Scattering HDR (Standard (HDR) + URP (HDR))

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.

NOTE  This setting is disabled in all the example scenes, so you must manually enable it if desired.
NOTE  This setting is automatically enabled in HDRP, which always uses HDR.


Atmosphere Brightness (HDRP)

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.

NOTE  These are just example values you can start with, the exact values these should be depend on the look you're trying to achieve, the overall brightness of your scene, the post effects you have applied, etc.


Black Holes (URP)

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.




Is VR supported?

Yes, this asset has been developed and tested in VR, and supports both multi-pass & single-pass rendering modes.

NOTE  Some features of SGT will need modification to look good in VR. For example, many of the demo scenes uses static star backgrounds (e.g. SgtBackdrop), which you can replace with fully 3D ones with the SgtStarfieldElliptical component.

You can see the VR Stars demo scene for an example of how starfields can be set up to create an immersive scene.



Does this work on mobile/console/WebGL/etc?

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.



Known Issues


Shader Warnings

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!



Depth Buffer Precision (OpenGL + OpenGL ES)

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.



Planet Motion Blur (HDRP)

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.



Massive Planet + Atmosphere + Ocean Edge Artefacts (HDRP)

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.




What Examples Are Included?

This is a list of the example scenes and a description of what it shows.

Corona

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.

Atmosphere

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.

Sunset

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.

Scattering

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.

Customize

This shows you how to connect UI elements to atmosphere settings, allowing you to more easily see what settings change what visuals.

Aurora

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.

Backdrop

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.

PowerRGB

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.

ClampSizeMin

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.

Customize

This shows you how to control the star settings from UI sliders.

Pulse

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.

Belt

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.

Lighting

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.

Colors

This shows you how the SgtBeltSimple component''s AsteroidColors setting can be used to create a color gradient of different possible asteroid colors.

Additive

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.

PowerRGB

This shows you how the belt material''s POWER RGB setting can be enabled, making it more suitable for colored stars.

Custom

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.

Sprite Billboard Flare

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.

Overlay

This shows you how to make a more impressive billboard flare using a second layer.

Depth

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.

Pointer

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.

Debris Spawner

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.

Shape

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.

Debris Grid

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.

Shape

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.

Flares

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.

Jovian

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.

Rim

This shows you how the SgtJovian.Rim__ settings can be used to control the outer edge color of the gas giant.

Lighting

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.

Sunset

This shows you how the SgtJovianLightingTex.SunsetSharpnessR/G/B settings can be used to control the sunset colors.

Scattering

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.

Flow

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.

Lightning Spawner

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.

Order

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.

Sequence

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.

Lightning

This shows you how the animated lightning can look with a properly designed texture.

Planet

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.

Displace

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.

Detail

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.

Secondary

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.

Water

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.

Clamp

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.

Gradient

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.

Texture

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.

Coast

This shows you how the planet shader's Coast Sharpness setting can be used to adjust the transition between land and sea.

Emission

This shows you how the planet shader's Emission setting can be used to make the water glow, making it look like lava.

Atmosphere

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.

Collider

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.

Prominence

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.

Fade Edge

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.

Clip Near

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.

Distortion

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.

Detail

This shows you how the prominence material''s DETAIL setting can be enabled, enhancing the prominence base texture''s detail.

Accretion Disk

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.

Animated Noise

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.

Planetary Ring

This shows you how a different ring texture can be used, making it suitable as a planetary ring.

Lighting

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.

Scattering

This shows you how the ring material''s LIGHTING SCATTERING setting can be enabled, adding light scattering through the ring.

Planet Shadow

This shows you how the SgtShadowSphere component can be added to your planet, causing it to automatically cast shadows on rings.

Ring Shadow

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.

Detail

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.

Near Fade

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.

Customize

This shows you how to control the SgtRing.RadiusInner + RadiusOuter settings, allowing you to control the ring size at runtime.

Stars

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.

Clouds

This shows you how the SgtBackgroundMesh component can have larger quads and different material with a cloud texture to make a background of clouds.

Camera Controls

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.

Rigidbody Controls

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.

Procedural Spin + Scale

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.

Newtonian Gravity

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.

Planet Gravity

This shows you how to combine the Procedural Spin + Scale and Newtonian Gravity demo scenes.

Simple Orbit

This shows you how the SgtSimpleOrbit component can be used to make GameObjects orbit each other.

Shadow Layer

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.

Lens

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.

Warp Outer

This shows you how the SgtLens component''s WarpOuter setting can adjust the voerall size of the gravitational lens size.

Warp Strength

This shows you how the SgtLens component''s WarpStrength setting can adjust the maximum angle light can bend around.

Hole Size

This shows you how the SgtLens component''s HoleSize setting can adjust the size of the event horizon.

Hole Edge

This shows you how the SgtLens component''s HoleEdge setting can adjust the thickness of the event horizon.

Black Hole

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.

Spacetime

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.

Gaussian Well

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.

Orbit

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.

Ripple Well

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.

Animation

This shows you how the ripple can be animated. This is done using the SgtSpacetimeWell component''s OffsetSpeed setting.

Twist Well

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.

Animation

This shows you how the twist can be animated. This is done using the SgtSpacetimeWell component''s OffsetSpeed setting.

Pinch Well

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.

Styles

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.

Star Shader

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.

Flow

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.

Sunspots

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.

Rim

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.

Box

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.

Offset

This shows you how the SgtStarfieldBox component''s Offset component can be used to change the starfield distribution.

Colors

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.

Clouds

This shows you how the StarRadiusMin/Max, MainTex, and OverrideBrightness settings can be adjusted to create clouds instead of stars.

Soft

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.

PowerRGB

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.

ClampSizeMin

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.

Layering

This shows you how multiple starfields can be combined with different settings, giving a more interesting look.

Elliptical

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.

Symmetry

This shows you how the Symmetry setting can be used to flatten the star distribution into a disc.

Offset

This shows you how the Offset setting can be used to push stars away from the center.

Bias

This shows you how the Bias setting can be used to change the probability stars appear closer or farther away from the center.

Layering

This shows you how multiple starfields can be combined with different settings, giving a more interesting look.

Spiral

This shows you how the SgtStarfieldSpiral component can be used to procedurally generate and render a starfield in the shape of a spiral galaxy.

Rotation

This shows you how the SgtRotate component can be used to automatically rotate the spiral galaxy.

ArmCount

This shows you how the ArmCount setting can be used to change the amount of spiral arms.

Twist

This shows you how the Twist setting can be used to change the spiral arm twist rate.

ThicknessInner

This shows you how the ThicknessInner setting can be used to change the spiral arm thickness at the center.

ThicknessOuter

This shows you how the ThicknessOuter setting can be used to change the spiral arm thickness away from the center.

Layering

This shows you how multiple starfields can be combined with different settings, giving a more interesting look.

Nebula

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.

HeightSource

This shows you how the HeightSource setting can be used to change how the stars are offset from the local XZ plane.

ScaleSource

This shows you how the ScaleSource setting can be used to change how the stars are sized based on their underlying color.

Jitter

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.

HorizontalBrightness

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.

Layering

This shows you how multiple starfields can be combined with different settings, giving a more interesting look.

Infinite

This shows you how the SgtStarfieldInfinite component can be used to make infinitely repeating stars around the camera.

Far

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.

Warp

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.

Dust

This shows you how the settings can be changed to make infinitely repeating dust.

Dust Near

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.

Floating Camera

This shows you how SgtStarfieldInfinite automatically works with the Universe feature's SgtFloatingCamera component. See the Universe feature for more information.

Dome

This shows you how the SgtStarfieldDome component can be used to procedurally generate and render a starfield in the shape of a dome.

Bias

This shows you how the Bias setting can be used to place more or less stars near the horizon.

Custom

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.

Pulse

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.

Multiply

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.

Terrain Planet

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.

Atmosphere

This shows you how the SgtTerrainSharedMaterial component can be used to render an atmosphere on top of the terrain.

Heightmap

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.

Simplex

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.

Collider

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.

Spawner

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.

Areas

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.

Feature

This shows you how the SgtTerrainFeature component can be used to deform a specific area of the planet using a custom heightmap texture.

Terrain Ocean

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.

Atmosphere

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.

Depth Color

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.

Detail

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.

Animation

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.

Waves

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.

Shore

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.

Underwater

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.

Underwater Atmosphere

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.

Basic Thruster

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.

Controls

This shows you how the SgtThrusterControls component can be used to set the SgtThruster.Throttle value using input axes.

Camera

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.

Floating Camera

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).

Floating Object

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.

Floating Speedometer

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.

Floating Orbit

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.

Floating Orbit Visual

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.

Floating Spawner (Sphere)

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.

Floating Spawner (Ring)

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.

Floating Spawner (Orbit)

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.

Floating Root

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.

Floating Warp

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.

Floating Scaler

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.

Star Cluster

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.

Nested Spawner

This shows you how the SgtFloatingSpawner___ component can be nested, allowing the stars to spawn planets when you get close enough.

Nested Orbits

This shows you how the SgtFloatingSpawner___ component can be nested, allowing the stars to spawn planets when you get close enough.

Third Person

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.

Floating Massive

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).

Astrophysical Jet

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.

Earth Sized Planet

This shows you how the Terrain and Universe features can be combined to render a planet with the same radius as Earth.

Elliptical Galaxy

This shows you how to make a nebula scene by combining the Starfield Spiral and Backdrop features.

Gravitational Waves

This shows you how the Spacetime and Singularity can be combined to create an animated gravitational wave ripple effect

Jovian

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.

Nebula

This shows you how to make a nebula scene by combining the Starfield Nebula, Billboard and Backdrop features.

Obsidian Planet

This shows you how the Earth Sized Planet demo scene can be modified to create a different style of planet.

Planet Surfing

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.

Space Probe

This shows you how the SgtThruster, SgtThrusterScale, and SgtThrusterRoll components can be combined to make a simple flickering thruster effect.

Spiral Galaxy

This shows you how to make a nebula scene by combining the Starfield Spiral and Backdrop features.

Storm Planet

This shows you how the SgtLightningSpawner component can procedurally spawn animated lightning around your planets.

Vortex

This shows you how the Prominence feature can be used to create an animated vortex effect.

VR Stars

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.

Water Level

This shows you how the SgtStaticPlanet component's WaterHeight value can be controlled from a UI slider.



Atmosphere

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.


Atmosphere Shader

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).

NOTE  The SgtAtmosphereDepthTex component can be used to generate this at runtime, and also export it during edit time.

Outer Depth Tex

The DepthTex applied to the outer mesh (sky).

NOTE  The SgtAtmosphereDepthTex component can be used to generate this at runtime, and also export it during edit time.

LIGHTING

This allows the atmosphere to receive light and shadows using the SGT custom lighting model.

NOTE  This feature requires your main scene light(s) to have the SgtLight component attached.

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.

NOTE  The SgtAtmosphereLightingTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  These values cannot be set to 0.
NOTE  If you want light to back-scatter, then you can set at least one the values to negative (e.g. -2.0).

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.

NOTE  The SgtAtmosphereScatteringTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  This will be forced on when using HDRP.



Aurora

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.


Aurora Shader

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.

NOTE  The SgtAuroraMainTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  The SgtAuroraNearTex component can be used to generate this at runtime, and also export it during edit time.

ANIMATION

This allows the aurora ribbons to animate over time.

ANIMATION / Anim Speed

This allows you to set how fast the aurora animates.




Backdrop

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.


Backdrop Shader

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.




Belt

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.


Belt Shader

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.

NOTE  This feature requires your main scene light(s) to have the SgtLight component attached.

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.

NOTE  The SgtBeltLightingTex component can be used to generate this at runtime, and also export it during edit time.



Billboard

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.


Sprite Billboard Flares

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.



Add a Billboard

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.

NOTE  Because the SgtBillboard component takes over the GameObject's rotation, you shouldn't have any components on this GameObject that rely on the rotation (e.g. directional light).


Make it Glow

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.



Make it Glow Even More

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.

NOTE  Your parent GameObject already has the SgtBillboard component that controls the rotation, so your second layer doesn't need it.


Make it Glow Less

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.




Cloudsphere

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.


Cloudsphere Shader

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.

NOTE  The SgtCloudsphereDepthTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  The SgtCloudsphereNearTex component can be used to calculate this value.

NEAR FADE / Near Tex

The lookup table for the fade gradient.

NOTE  The SgtCloudsphereNearTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  This texture should be seamless, with the detail stored in the alpha channel.

LIGHTING

This allows the cloudsphere to receive light and shadows using the SGT custom lighting model.

NOTE  This feature requires your main scene light(s) to have the SgtLight component attached.

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.

NOTE  The SgtCloudsphereLightingTex component can be used to generate this at runtime, and also export it during edit time.



Debris

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.


Debris Spawner

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.



Debris Grid

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.




Flare

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.


Flare Shader

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.

NOTE  You cannot use OneMinusSrcColor blending with HDR camera rendering, or HDRP.

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.

NOTE  The SgtFlareMainTex component can be used to generate this at runtime, and also export it during edit time.



Galaxy

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.


Galaxy Shader

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.

NOTE  This texture should be circular with a black background and black edges.

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.

NOTE  This should be seamless.

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.

NOTE  This should be seamless.

DUST / Tiling

The dust texture will be tiled around the galaxy this many times.

NOTE  This should be a whole number/integer.

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.




Jovian

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.


Jovian Shader

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.

NOTE  Enabling this may change the way other transparent objects in or near your jovian render.

Depth Tex

The lookup table for the optical depth gradient.

NOTE  The SgtJovianDepthTex component can be used to generate this at runtime, and also export it during edit time.

Noise Tex (A)

The flow texture will be offset by this.

NOTE  The Noise3D_Alpha texture that comes with SGT can be used here.

LIGHTING

This allows the jovian to receive light and shadows using the SGT custom lighting model.

NOTE  This feature requires your main scene light(s) to have the SgtLight component attached.

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.

NOTE  The SgtJovianLightingTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  These values cannot be set to 0.
NOTE  If you want light to back-scatter, then you can set at least one the values to negative (e.g. -2.0).

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.

NOTE  The SgtJovianScatteringTex component can be used to generate this at runtime, and also export it during edit time.

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.




Lightning

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.


Texture Format

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.

NOTE  For best results the Red channel (shape), should be thinner than the Green and Blue channels, otherwise you might get visual artifacts around the edges of your lightning shape as it animates.



Nebula

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.


Nebula Shader

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.

NOTE  This texture should be seamless.

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.

NOTE  This should be seamless.

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.




Planet

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.


Planet Shader

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.

NOTE  This texture will be used to modify the planet mesh if you enable displacement.

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.

NOTE  These albedo textures must be 'normalized' so that gray (0.5,0.5,0.5 / 128,128,128) is the default color. This means pixels above 0.5/128 will brighten the texture, and pixels below 0.5/128 will darken it.

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.

NOTE  This requires the planet material to be rendered using the SgtPlanet component.
NOTE  This requires your main scene light to have the SgtLight component attached to it.

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.

NOTE To control the water color you should add the SgtPlanetWaterGradient component alongside your SgtPlanet component.
NOTE To control the water texture you should add the SgtPlanetWaterTexture component alongside your SgtPlanet component.

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.



SgtPlanet Component

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.

NOTE  This component bakes the water level into the mesh, so it can be expensive to change this in game. It's especially expensive if you specify a MeshCollider.

For further information I recommend you go through the demo scenes in the Planet feature folder.



SgtPlanetWaterGradient Component

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.



SgtPlanetWaterTexture Component

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.




Prominence

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.


Prominence Shader

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)

NOTE  This should be a seamless texture, with the displacement stored in the alpha channel.

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.

NOTE  This should be a seamless texture, with the detail stored in the alpha channel.



Ring

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.


Ring Shader

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.

NOTE  The SgtRingNearTex component can be used to calculate this value.

NEAR FADE / Near Tex

The lookup table for the fade gradient.

NOTE  The SgtRingNearTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  This should be a seamless texture.
NOTE  If Mode = Color, then the detail should be stored in the RGBA channels.
NOTE  If Mode = Alpha, then the detail should be stored in the alpha channel.

LIGHTING

This allows the ring to receive light and shadows using the SGT custom lighting model.

NOTE  This feature requires your main scene light(s) to have the SgtLight component attached.

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.

NOTE  The SgtRingLightingTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  These values cannot be set to 0.
NOTE  If you want light to back-scatter, then you can set at least one the values to negative (e.g. -2.0).

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.

NOTE  The SgtRingScatteringTex component can be used to generate this at runtime, and also export it during edit time.



Singularity

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.


Black Hole

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).

NOTE  If you're using URP, then you must go to your RenderPipelineAsset settings, and enable the Opaque Texture rendering.


Lens

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.




Spacetime

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.


Step 1 - Make a Spacetime

METHOD 1 Create a new GameObject, and add the SgtSpacetime component to it.
METHOD 2 Right click in your Hierarchy tab, and select: Space Graphics Toolkit > Spacetime
METHOD 3 From the menu bar, select: GameObject > Space Graphics Toolkit > Spacetime

You should now see the SgtSpacetime component in your inspector tab.



Step 2 - Make a Mesh

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:

METHOD 1 Create a new GameObject, and add the SgtSpacetimeMesh component to it.
METHOD 2 Right click in your Hierarchy tab, and select: Space Graphics Toolkit > Spacetime Mesh
METHOD 3 From the menu bar, select: GameObject > Space Graphics Toolkit > Spacetime Mesh

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.

NOTE  If you've manually set up a mesh using a MeshFilter and MeshRenderer, then make sure you drag and drop it into the SgtSpacetime component's Renderers list.


Step 3 - Add Wells

To make the spacetime effect display curvature, you need to add gravitational wells. To do this:

METHOD 1 Create a new GameObject, and add the SgtSpacetimeWell component to it.
METHOD 2 Right click in your Hierarchy tab, and select: Space Graphics Toolkit > Spacetime Well
METHOD 3 From the menu bar, select: GameObject > Space Graphics Toolkit > Spacetime Well

You should now see the SgtSpacetimeWell component in your inspector tab.



Step 4 - Done!

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.

NOTE  If you can't see any change to the spacetime from your well, try adjusting the well's Radius and Strength settings.


Spacetime Shader

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.




Star

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.


Star Shader

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.

NOTE This texture should use equirectangular (cylindrical) projection, and have Wrap Mode: U axis = Repeat, V axis = Clamp.

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.

NOTE This texture should use equirectangular (cylindrical) projection, and have Wrap Mode: U axis = Repeat, V axis = Clamp.

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.

NOTE This texture should use equirectangular (cylindrical) projection, and have Wrap Mode: U axis = Repeat, V axis = Clamp.

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.




Starfield

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.


Starfield Shader

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.

NOTE  You cannot use OneMinusSrcColor blending with HDR camera rendering, or HDRP.

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.

NOTE  The SgtStarfieldNearTex component can be used to generate this at runtime, and also export it during edit time.

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.

NOTE  The SgtStarfieldFarTex component can be used to generate this at runtime, and also export it during edit time.



Terrain

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.


Basic Setup

Begin by creating a terrain planet.

METHOD 1 Right click the Hierarchy tab, and select: Space Graphics Toolkit > Terrain Planet.
METHOD 2 Click the menu bar option: GameObject > Space Graphics Toolkit > Terrain Planet.
METHOD 3 Manually create a new GameObject, and add the Sgt Terrain Planet and Sgt Terrain Planet Material components.

Your scene should now contain a selected GameObject with the SgtTerrainPlanet and SgtTerrainPlanetMaterial components.

You can now set the SgtTerrainPlanetMaterial component's Material setting.

NOTE  This should be a material that uses the SGT / Terrain Planet shader. You can use one of the example materials for this.


Terrain Planet Shader

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.

NOTE  The tiling factors for this setting are based on the SgtTerrainPlanet component's BakedDetailTilingA/B/C settings.

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.

NOTE  This must be a positive integer.


SGT Terrain Ocean Shader

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.

NOTE  This material should be rendered using the SgtTerrainOceanMaterial component, NOT the normal SgtTerrainPlanetMaterial component used for the normal terrain.
NOTE  The ocean rendering required a camera Depth Texture to work. This can be done by adding the SgtDepthTextureMode component to your camera(s), and setting the DepthMode to Depth, or similar.

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.

NOTE  If you're using URP, you must enable the Depth Texture setting in your pipeline settings asset.

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.

NOTE  If you're using URP, you must enable the Opaque Texture setting in your pipeline settings asset.

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.



Heightmap

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.



Atmosphere

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.



Procedural Heights

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.



Surface Colliders

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.



Procedural Prefab Spawning

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.



Areas

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.



Optimization

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.




Thruster

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.


Step 1 - Add a Thruster

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.



Step 2 - Add a Visual

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.



Step 3 - Rotate The Visual

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.



Step 4 - Scale The Visual

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.

NOTE  By default the Throttle value is 0, which means the SgtThrusterScale component will make the scale 0,0,0. To test what different thrust values look like, set the Throttle value to 1.


Step 5 - Done!

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.




Universe

The Universe feature allows you create massive scenes by shifting the scene origin.


What is 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.



Warning!

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.



Basic Setup

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.

NOTE  You cannot nest SgtFloatingObject and SgtFloatingCamera components (e.g. parent & child). If you want one to follow the other then you must separate them, and use the SgtFloatingFollow component to connect them again. While it's technically possible to support this, it makes the code a lot more complicated and will result in reduced performance.


Handling Snaps

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.



High Precision Positions

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.



Spawning Hierarchy

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.



Massive Objects

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.

NOTE  This component cannot work with the Rigidbody component, or any other component that manually modifies the Transform settings.
NOTE  This component has more overhead than SgtFloatingObject, so you should only use this feature for truly massive objects in your scene that cannot be rendered properly with SgtFloatingObject.
NOTE  This component takes over the Transform settings to position it relative to the camera, so you cannot perform in-game logic based on this position. If you need to find the actual position of the massive object you must read its Position data from the SgtFloatingMassive component.







Assets

Here's a list of all my other assets, please check them out!

You can also view this list on my Asset Store page.

Lean Touch

Lean Touch

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+

Lean Touch+

Lean Touch+ is an extension to the popular Lean Touch asset, adding many more example scenes.


Lean Localization

Lean Localization

Lean Localization is a localization library that's designed to be as simple to use as possible for both designers, and programmers.


Lean Pool

Lean Pool

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.


Lean Transition

Lean Transition

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

Lean GUI

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

Lean GUI Shapes

Lean GUI Shapes allows you to quickly add lines, rounded boxes, polygons, and much more to your GUI!


Lean Texture

Lean Texture

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+

Lean Texture+

Lean Texture+ is an extension to Lean Texture, adding many new types of texture modification tools!


CW Spaceships - Build & Destroy

Spaceships - Build & Destroy

Build your dream spaceship, and then have fun destroying it!


Modular Backgrounds

Modular Backgrounds

Unlock a universe of visual possibilities with Modular Backgrounds. Simply drag and drop these graphics into the background of your scenes.


Paint in 3D

Paint in 3D

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 in 2D

Paint in 2D

Paint all your sprites with Paint in 2D. With incredible performance on mobile, WebGL, and much more!


Paint in Editor

Paint in Editor

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

FLOW

FLOW allows you to add large scale interactive fluids to your scene - all highly optimized using GPU acceleration.


Destructible 2D

Destructible 2D

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!


Space Graphics Toolkit

Space Graphics Toolkit

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.


Space Graphics Planets

Space Graphics Planets

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).


Volumetric Audio

Volumetric Audio

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.






Versions

4.2.5

Updated shaders to latest version.
Added Sphere Mask settings to all shaders/materials.



4.2.4

Updated shaders to latest version.



4.2.3

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.



4.2.2

Fixed potential compile issue with SgtFloatingOrbit component.



4.2.1

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).



4.2.0

Updated CW/Common code to latest version.
Updated shaders to latest version.



4.1.5

Moved main build to Unity 2021.3.0f1.
Updated shaders to latest version.
Fixed SgtBelt lighting disappearing when overlapping position with light.



4.1.4

Updated shaders to latest version.
Added Fade Bound setting to Terrain Ocean shader's baked detail setting.



4.1.3

Fixed Terrain Planet shader's night light angle.
Fixed Starfield shader warning.
Fixed Backdrop shader warning.



4.1.2

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.



4.1.1

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.



4.1.0

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).



4.0.9

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.



4.0.8

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.



4.0.7

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.



4.0.6

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.



4.0.5

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.



4.0.4

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.



4.0.3

Improved SgtRing depth sorting.
Fixed SgtOcclusionScaler against jovians.
Fixed SgtOcclusionScaler against atmospheres.



4.0.2

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.



4.0.1

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.



4.0.0

NOTE  This is a massive update. To update you must first back up your project, delete the root SpaceGraphicsToolkit folder, then install the new version.

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.



3.9.13

Fixed SgtOcclusionScaler not working on more distant light sources.



3.9.12

Fixed shader error when updating from older versions of SGT.



3.9.11

Fixed SgtTerrainCollider with odd Resolution values.
Fixed SgtTerrainPrefabSpawner with odd Resolution values.
Fixed possible shader errors in URP.
Fixed SgtBelt___ inspectors not appearing.



3.9.10

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.



3.9.9

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.



3.9.8

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.



3.9.7

Fixed SgtStarfield and other components blocking scene shadows.
Added Starfield / Custom demo scene.
Added Starfield / Belt demo scene.



3.9.6

Fixed SgtCorona error when viewing inspector.



3.9.5

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.



3.9.4

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.



3.9.3

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.



3.9.2

Fixed SgtLight gc alloc.
Fixed SgtLight point light attenuation in URP.
Fixed SgtLight point light attenuation in HDRP.



3.9.1

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.

NOTE  You will have to re-create your planet detail texture settings.


3.9.0

NOTE  This is a huge update. Back up your project files before installing.

Fixed scenarios where SgtTerrainCollider could cause gaps.
Fixed scenarios where SgtTerrainPrefabSpawner could cause gaps.
Fixed SgtStarfieldInfinite.Pulse setting.
Rewrote Accretion shader for better HDRP compatibility.
Rewrote Atmosphere shader for better HDRP compatibility.
Rewrote Aurora shader for better HDRP compatibility.
Rewrote Backdrop shader for better HDRP compatibility.
Rewrote Belt shader for better HDRP compatibility.
Rewrote Billboard shader for better HDRP compatibility.
Rewrote Cloudsphere shader for better HDRP compatibility.
Rewrote Corona shader for better HDRP compatibility.
Rewrote Flare shader for better HDRP compatibility.
Rewrote Jovian shader for better HDRP compatibility.
Rewrote Lightning shader for better HDRP compatibility.
Rewrote Prominence shader for better HDRP compatibility.
Rewrote Ring shader for better HDRP compatibility.
Rewrote Spacetime shader for better HDRP compatibility.
Rewrote Star shader for better HDRP compatibility.
Rewrote Starfield shader for better HDRP compatibility.
Rewrote Thruster shader for better HDRP compatibility.
Added Basic Pack / Continuum demo scene.
Added SgtCameraPivot component.
Added SgtAtmosphere.ScatteringHdr setting for HDR rendering.
Added SgtAtmosphere.InnerOffset setting.
Added SgtAtmosphere.AmbientBrightness setting.
Added SgtAtmosphere.MaxLights setting.
Added SgtAtmosphere.MaxSphereShadows setting.
Added SgtBelt___.AmbientBrightness setting.
Added SgtBelt___.MaxLights setting.
Added SgtBelt___.MaxSphereShadows setting.
Added SgtCloudsphere.AmbientBrightness setting.
Added SgtCloudsphere.MaxLights setting.
Added SgtCloudsphere.MaxSphereShadows setting.
Added SgtCorona.InnerOffset setting.
Added SgtJovian.AmbientBrightness setting.
Added SgtJovian.MaxLights setting.
Added SgtJovian.MaxSphereShadows setting.
Added SgtRing.AmbientBrightness setting.
Added SgtRing.MaxLights setting.
Added SgtRing.MaxSphereShadows setting.
Added SgtSpacetime.MaxGaussianWells setting.
Added SgtSpacetime.MaxRippleWells setting.
Added SgtSpacetime.MaxTwistWells setting.
Added SgtSpacetime.MaxPinchWells setting.
Added SgtSpacetimeWell.Distribution = Pinch setting.
Added SgtSpacetimeWell.Opacity setting.
Added SgtSpacetimeWell.Combine setting.
Added Spacetime / Pinch Well demo scene.
Added Spacetime / Styles demo scene.
Allowed touch controls to be inverse of mouse controls.
Updated all demo scenes for linear color space.
Updated all shaders to use local keywords.



3.8.6

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.



3.8.5

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.



3.8.4

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.



3.8.3

Improved compatibility when upgrading from older versions.



3.8.2

Fixed SgtStarfieldInfinite render issue in HDRP.
Fixed pink materials when reimporting with SRP.
Simplified hierarchy of all demo scenes.



3.8.1

Fixed media pack links in documentation.
Fixed SgtBeltSimple property editing from code.
Fixed build errors.



3.8.0

NOTE  This is a huge update. Back up your project files before installing.

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.



3.7.11

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.



3.7.10

Added SgtRing.Occlusion setting.
Fixed SGT Planet shader default water level when using SRP.
Fixed Singularity feature when using single pass instanced VR rendering.



3.7.9

Added SgtBeltCustom.Occlusion setting.
Fixed SgtBeltSimple.Layout settings not showing.
Fixed SgtStarfieldCustom.Layout settings not showing.
Fixed SgtBeltCustom inspector.



3.7.8

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.



3.7.7

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.



3.7.6

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.



3.7.5

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.



3.7.4

NOTE  This is a massive update. Please back up your project, delete the old SGT folder, then install the new version.

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.



3.7.3

Fixed SgtStaticPlanet bounds when layering atmosphere and cloudsphere.
Moved SgtDynamicPlanet back to Planet feature.



3.7.2

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).



3.7.1

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.



3.7.0

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.



3.6.9

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.



3.6.8

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.



3.6.7

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.



3.6.6

Updated documentation.
Added SgtSimpleOrbit.
Added SgtThrusterControls.



3.6.5

Updated documentation.
Improved Debris demo scenes and documentation.



3.6.4

Added night light support to the Planet shader.
Added new demo scenes for the Debris feature.
Updated Solar System Pack link.



3.6.3

Fixed shadow casting calculations.
Improved component consistency.
Redesigned documentation.



3.6.2

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.







Components

SgtAtlas

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.


LayoutType
Layout

The layout of cells in the texture.



int
LayoutColumns

The amount of columns in the texture.



int
LayoutRows

The amount of rows in the texture.



List<Rect>
LayoutRects

The rects of each cell in the texture.




SgtAtmosphere

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.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Atmosphere shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the atmosphere.



float
Brightness

The Color.rgb values will be multiplied by this.



float
InnerMeshRadius

The radius of the meshes set in the SgtSharedMaterial.



Mesh
OuterMesh

This allows you to set the mesh used to render the atmosphere. This should be a sphere.



float
OuterMeshRadius

This allows you to set the radius of the OuterMesh. If this is incorrectly set then the atmosphere will render incorrectly.



float
OuterSoftness

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.



float
Height

This allows you to set how high the atmosphere extends above the surface of the planet in local space.



float
InnerFog

This allows you to adjust the fog level of the atmosphere on the surface.



float
OuterFog

This allows you to adjust the fog level of the atmosphere in the sky.



float
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.



float
Middle

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.



float
CameraOffset

This allows you to offset the camera distance in world space when rendering the atmosphere, giving you fine control over the render order.



float
OcclusionPower

This setting allows you to increase or decrease how much this atmosphere occludes flares using the SgtOcclusionScaler component.



bool
Night

Should the night side of the atmosphere have different sky values?



float
NightSky

The 'Sky' value of the night side.



SgtEase.Type
NightEase

The transition style between the day and night.



float
NightStart

The start point of the day/sunset transition (0 = dark side, 1 = light side).



float
NightEnd

The end point of the day/sunset transition (0 = dark side, 1 = light side).



float
NightPower

The power of the night transition.




SgtAtmosphereDepthTex

This component allows you to generate the SgtAtmosphere.InnerDepthTex and SgtAtmosphere.OuterDepthTex fields.


Color
HorizonColor

This allows you to set the color that appears on the horizon.



Color
InnerColor

The base color of the inner texture.



SgtEase.Type
InnerEase

The transition style between the surface and horizon.



float
InnerColorSharpness

The strength of the inner texture transition.



float
InnerAlphaSharpness

The strength of the inner texture transition.



Color
OuterColor

The base color of the outer texture.



SgtEase.Type
OuterEase

The transition style between the sky and horizon.



float
OuterColorSharpness

The strength of the outer texture transition.



float
OuterAlphaSharpness

The strength of the outer texture transition.



void
ExportInnerTexture

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.



void
ExportOuterTexture

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.




SgtAtmosphereHeight

This component modifies the SgtAtmosphere.Height based on camera proximity.


float
DistanceMin

The minimum distance between the atmosphere center and the camera position in local space.



float
DistanceMax

The maximum distance between the atmosphere center and the camera position in local space.



float
HeightClose

The SgtAtmosphere.Height value that will be set when at or below DistanceMin.



float
HeightFar

The SgtAtmosphere.Height value that will be set when at or above DistanceMax.




SgtAtmosphereLightingTex

This component allows you to generate the SgtAtmosphere.LightingTex field.


SgtEase.Type
SunsetEase

The transition style between the day and night.



float
SunsetStart

The start point of the day/sunset transition (0 = dark side, 1 = light side).



float
SunsetEnd

The end point of the sunset/night transition (0 = dark side, 1 = light side).



float
SunsetSharpnessR

The sharpness of the sunset red channel transition.



float
SunsetSharpnessG

The sharpness of the sunset green channel transition.



float
SunsetSharpnessB

The sharpness of the sunset blue channel transition.



void
ExportTexture

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.




SgtAtmosphereModel

This component is used to render the SgtAtmosphere component.

NOTE  This component is automatically created and managed.


SgtAtmosphereScatteringTex

This component allows you to generate the SgtAtmosphere.ScatteringTex field.


SgtEase.Type
SunsetEase

The transition style between the day and night.



float
SunsetStart

The start point of the day/sunset transition (0 = dark side, 1 = light side).



float
SunsetEnd

The end point of the sunset/night transition (0 = dark side, 1 = light side).



float
SunsetSharpnessR

The sharpness of the sunset red channel transition.



float
SunsetSharpnessG

The sharpness of the sunset green channel transition.



float
SunsetSharpnessB

The sharpness of the sunset blue channel transition.



void
ExportTexture

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.




SgtAtmosphereSoil


float
DistanceMin

The minimum distance between the atmosphere center and the camera position in local space.



float
DistanceMax

The maximum distance between the atmosphere center and the camera position in local space.



float
HeightClose

The SgtAtmosphere.Height value that will be set when at or below DistanceMin.



float
HeightFar

The SgtAtmosphere.Height value that will be set when at or above DistanceMax.




SgtAurora

This component allows you to render an aurora above a planet. The aurora can be set to procedurally animate in the shader.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Aurora shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the aurora.



float
Brightness

The Color.rgb values will be multiplied by this.



float
CameraOffset

This allows you to offset the camera distance in world space when rendering the aurora, giving you fine control over the render order.



int
Seed

This allows you to set the random seed used during procedural generation.



float
RadiusMin

The inner radius of the aurora mesh in local space.



float
RadiusMax

The inner radius of the aurora mesh in local space.



int
PathCount

The amount of aurora paths/ribbons.



int
PathDetail

The amount of quads used to build each path.



float
PathLengthMin

The minimum length of each aurora path.



float
PathLengthMax

The maximum length of each aurora path.



float
StartMin

The minimum distance between the pole and the aurora path start point.



float
StartMax

The maximum distance between the pole and the aurora path start point.



float
StartBias

The probability that the aurora path will begin closer to the pole.



float
StartTop

The probability that the aurora path will start on the northern pole.



int
PointDetail

The amount of waypoints the aurora path will follow based on its length.



float
PointSpiral

The strength of the aurora waypoint twisting.



float
PointJitter

The strength of the aurora waypoint random displacement.



float
TrailEdgeFade

The sharpness of the fading at the start and ends of the aurora paths.



float
TrailTile

The amount of times the main texture is tiled based on its length.



float
TrailHeights

The flatness of the aurora path.



int
TrailHeightsDetail

The amount of height changes in the aurora path.



Gradient
Colors

The possible colors given to the top half of the aurora path.



int
ColorsDetail

The amount of color changes an aurora path can have based on its length.



float
ColorsAlpha

The minimum opacity multiplier of the aurora path colors.



float
ColorsAlphaBias

The amount of alpha changes in the aurora path.



float
AnimStrength

The strength of the aurora path position changes in local space.



int
AnimStrengthDetail

The amount of the animation strength changes along the aurora path based on its length.



float
AnimAngle

The maximum angle step between sections of the aurora path.



int
AnimAngleDetail

The amount of the animation angle changes along the aurora path based on its length.




SgtAuroraMainTex

This component allows you to generate the SgtAurora.MainTex field.


float
NoiseStrength

The strength of the noise points.



int
NoisePoints

The amount of noise points.



int
NoiseSeed

The random seed used when generating this texture.



SgtEase.Type
TopEase

The transition style between the top and middle.



float
TopSharpness

The transition strength between the top and middle.



float
MiddlePoint

The point separating the top from bottom.



Color
MiddleColor

The base color of the aurora starting from the bottom.



SgtEase.Type
MiddleEase

The transition style between the bottom and top of the aurora.



float
MiddleSharpness

The strength of the color transition between the bottom and top.



SgtEase.Type
BottomEase

The transition style between the bottom and middle.



float
BottomSharpness

The transition strength between the bottom and middle.



void
ExportTexture

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.




SgtAuroraModel

This component is used to render the SgtAurora component.

NOTE  This component is automatically created and managed.


SgtAuroraNearTex

This component allows you to generate the SgtAurora.NearTex field.


SgtEase.Type
Ease

The ease type used for the transition.



float
Sharpness

The sharpness of the transition.



float
Offset

The start point of the fading.



float
OverrideRange

Should this component also control the aurora's NearRangeRecip setting?

-1 = Don't override.



void
ExportTexture

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.




SgtBackdrop

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.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Backdrop shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the backdrop.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

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.



SgtAtlas
Atlas

If the main texture of this material contains multiple textures in an atlas, then you can specify them here.



float
ClampSizeMin

Should the stars fade out instead of shrink when they reach a certain minimum size on screen?



int
Seed

This allows you to set the random seed used during procedural generation.



float
Radius

The radius of the starfield.



float
Squash

Should more stars be placed near the horizon?



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.

NOTE  Your SourceMaterial must have PULSE enabled for this setting to be used.


float
StarPulseSpeedMax

The maximum animation speed of the pulsing.

NOTE  Your SourceMaterial must have PULSE enabled for this setting to be used.



SgtBackdropModel

This component is used to render the SgtBackdrop component.

NOTE  This component is automatically created and managed.


SgtBackdropQuad

This class stores data for one quad generated by SgtBackdrop, this is typically procedurally generated.


static SgtBackdropQuad
Temp

Temp instance used when generating the starfield



int
Variant

The coordinate index in the atlas texture.



Color
Color

Color tint of this quad.



float
Radius

Radius of this quad in local space.



float
Angle

Angle of this quad in degrees.



Vector3
Position

Position of the quad in local space.



float
PulseSpeed

How fast this star pulses.

NOTE  This requires the starfield material's PULSE setting to be enabled.


float
PulseOffset

The pulse position will be offset by this value so they don't all pulse the same.

NOTE  This requires the starfield material's PULSE setting to be enabled.



SgtBackgroundMesh

This component will procedurally generate a mesh that can be used to render stars or clouds in the background..


int
Seed

This allows you to set the random seed used during procedural generation.



float
Radius

The radius of the background mesh.



float
Squash

Should more quads be placed near the horizon?



int
QuadCount

The amount of quads that will be generated in the background.



float
QuadRadiusMin

The minimum radius of quads in the background.



float
QuadRadiusMax

The maximum radius of quads in the background.



float
QuadRadiusBias

How likely the size picking will pick smaller quads over larger ones (1 = default/linear).




SgtBelt

This base class contains the functionality to render an asteroid belt.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Belt shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the belt.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

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.



SgtAtlas
Atlas

If the main texture of this material contains multiple textures in an atlas, then you can specify them here.



float
OrbitOffset

The amount of seconds this belt has been animating for.



float
OrbitSpeed

The animation speed of this belt.




SgtBeltAsteroid

This stores all information about an asteroid in an SgtBelt___ component.


static SgtBeltAsteroid
Temp

Temp instance used when generating the belt.



int
Variant

The coordinate index in the asteroid texture.



Color
Color

Color tint of this asteroid.



float
Radius

Radius of this asteroid in local space.



float
Height

Height of this asteroid's orbit in local space.



float
Angle

The base roll angle of this asteroid in radians.



float
Spin

How fast this asteroid rolls in radians per second.



float
OrbitAngle

The base angle of this asteroid's orbit in radians.



float
OrbitSpeed

The speed of this asteroid's orbit in radians.



float
OrbitDistance

The distance of this asteroid's orbit in radians.




SgtBeltCustom SgtBelt

This component allows you to specify the exact position/size/etc of each asteroid in this asteroid belt.


float
Occlusion

This allows you to specify how much light the asteroids can block when using light flares.



float
OuterRadius

This allows you to specify the outer radius of the belt when calculating lighting.



List<SgtBeltAsteroid>
Asteroids

The custom asteroids in this belt.

NOTE  If you modify this then you must then call the DirtyMesh method.



SgtBeltLightingTex

This component allows you to generate the SgtBelt.LightingTex field.


float
FrontPower

How sharp the incoming light scatters forward.



float
BackPower

How sharp the incoming light scatters backward.



float
BackStrength

The strength of the back scattered light.



float
BaseStrength

The of the perpendicular scattered light.



void
ExportTexture

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.




SgtBeltModel

This component is used to render the SgtBelt component.

NOTE  This component is automatically created and managed.


SgtBeltSimple SgtBelt

This component allows you to generate an asteroid belt with a simple exponential distribution.


int
Seed

This allows you to set the random seed used during procedural generation.



float
Thickness

The thickness of the belt in local coordinates.



float
ThicknessBias

The higher this value, the less large asteroids will be generated.



float
InnerRadius

The radius of the inner edge of the belt in local coordinates.



float
InnerSpeed

The speed of asteroids orbiting on the inner edge of the belt in radians.



float
OuterRadius

The radius of the outer edge of the belt in local coordinates.



float
OuterSpeed

The speed of asteroids orbiting on the outer edge of the belt in radians.



float
RadiusBias

The higher this value, the more likely asteroids will spawn on the inner edge of the ring.



float
SpeedSpread

How much random speed can be added to each asteroid.



int
AsteroidCount

The amount of asteroids generated in the belt.



Gradient
AsteroidColors

Each asteroid is given a random color from this gradient.



float
AsteroidSpin

The maximum amount of angular velocity each asteroid has.



float
AsteroidRadiusMin

The minimum asteroid radius in local coordinates.



float
AsteroidRadiusMax

The maximum asteroid radius in local coordinates.



float
AsteroidRadiusBias

How likely the size picking will pick smaller asteroids over larger ones (1 = default/linear).




SgtBillboard

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.


bool
RollWithCamera

If the camera rolls, should this billboard roll with it?



bool
AvoidClipping

If your billboard is clipping out of view at extreme angles, then enable this.




SgtBlackHole

This component allows you to render a singularity/black hole.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/BlackHole shader. You cannot use a normal shader.


Mesh
Mesh

The mesh applied used to render the black hole. This should be a sphere.



float
Pinch

The higher you set this, the smaller the spatial distortion will be.



float
Warp

The higher you set this, the more space will bend around the black hole.



float
HoleSize

This allows you to control the overall size of the hole relative to the pinch.



float
HoleSharpness

This allows you to control how sharp/abrupt the transition between space and the event horizon is.



Color
HoleColor

This allows you to control the color of the black hole past the event horizon.



Color
TintColor

The color of the tint.



float
TintSharpness

This allows you to control how sharp/abrupt the transition between the event horizon and the tinted space is.



float
FadePower

This allows you to fade the edges of the black hole. This is useful if you have multiple black holes near each other.




SgtBlackHoleModel

This component is used to render the SgtBlackHole component.

NOTE  This component is automatically created and managed.


SgtCamera

This component monitors the attached Camera for modifications in roll angle, and stores the total change.


float
RollAngle

The amount of degrees this camera has rolled (used to counteract billboard non-rotation).



Quaternion
RollQuaternion

A quaternion of the current roll angle.



Matrix4x4
RollMatrix

A matrix of the current roll angle.



static LinkedList<SgtCamera>
Instances

This stores all active and enabled instances of this component.




SgtCameraMove

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.


bool
Listen

Is this component currently listening for inputs?



float
Damping

How quickly the position goes to the target value (-1 = instant).



Rigidbody
Target

If you want movements to apply to Rigidbody.velocity, set it here.



RotationType
TargetRotation

If the target is something like a spaceship, rotate it based on movement?



float
TargetDamping

The speed of the velocity rotation.



float
SpeedMin

The movement speed will be multiplied by this when near to planets.



float
SpeedMax

The movement speed will be multiplied by this when far from planets.



float
SpeedRange

The higher you set this, the faster the SpeedMin value will be reached when approaching planets.



float
SpeedWheel



CwInputManager.Axis
HorizontalControls

The keys/fingers required to move left/right.



CwInputManager.Axis
DepthControls

The keys/fingers required to move backward/forward.



CwInputManager.Axis
VerticalControls

The keys/fingers required to move down/up.




SgtCameraPath

This component moves the camera at the start of the scene.



SgtCameraState

This class can be used to easily save & load the state of an object (e.g. transform position) based on the camera rendering state.


Camera
Camera

The camera associated with this state.




SgtCloudsphere

This component allows you to render a sphere around a planet with a cloud cubemap.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Cloudsphere shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the cloudsphere.



float
Brightness

The Color.rgb values will be multiplied by this.



Cubemap
MainTex

This allows you to set the cubemap texture applied to the cloudsphere.



float
Radius

This allows you to set the radius of the cloudsphere in local space.



float
CameraOffset

This allows you to offset the camera distance in world space when rendering the cloudsphere, giving you fine control over the render order.



float
Softness

Should the stars fade out if they're intersecting solid geometry?



Mesh
Mesh

This allows you to set the mesh used to render the cloudsphere. This should be a sphere.



float
MeshRadius

This allows you to set the radius of the Mesh. If this is incorrectly set then the cloudsphere will render incorrectly.




SgtCloudsphereDepthTex

This component allows you to generate the DepthTex setting for cloudsphere materials.


SgtEase.Type
RimEase

The rim transition style.



Color
RimColor

The rim color.



float
RimPower

The rim transition sharpness.



float
AlphaDensity

The density of the atmosphere.



float
AlphaFade

The strength of the density fading in the upper atmosphere.



void
ExportTexture

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.




SgtCloudsphereLightingTex

This component allows you to generate the LightingTex setting for cloudsphere materials.


SgtEase.Type
SunsetEase

The transition style between the day and night.



float
SunsetStart

The start point of the sunset (0 = dark side, 1 = light side).



float
SunsetEnd

The end point of the sunset (0 = dark side, 1 = light side).



float
SunsetSharpnessR

The sharpness of the sunset red channel transition.



float
SunsetSharpnessG

The sharpness of the sunset green channel transition.



float
SunsetSharpnessB

The sharpness of the sunset blue channel transition.



void
ExportTexture

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.




SgtCloudsphereModel

This component is used to render the SgtCloudsphere component.

NOTE  This component is automatically created and managed.


SgtCloudsphereNearTex

This component allows you to generate the NearTex setting for cloudsphere materials.


SgtEase.Type
Ease

The ease type used for the transition.



float
Sharpness

The sharpness of the transition.



float
Offset

The start point of the fading.



float
OverrideRange

Should this component also control the starfield's NearRangeRecip setting?

-1 = Don't override.



void
ExportTexture

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.




SgtCommon

This class contains some useful methods used by this asset.


static event OcclusionDelegate
OnCalculateOcclusion

This event allows you to register a custom occlusion calculation.



static int
GetOffset
TextureFormat format, int channel

Gets the byte offset of a texture channel based on its format.

Channel = 0 = Red.

Channel = 1 = Green.

Channel = 2 = Blue.

Channel = 3 = Alpha.




SgtDebris

This component handles a single debris object.


event System.Action
OnSpawn

Called when this debris is spawned (if pooling is enabled).



event System.Action
OnDespawn

Called when this debris is despawned (if pooling is enabled).



bool
Pool

Can this debris be pooled?



StateType
State

The current state of the scaling.



SgtDebris
Prefab

The prefab this was instantiated from.



Vector3
Scale

This gets automatically copied when spawning debris.



SgtLong3
Cell

The cell this debris was spawned in.




SgtDebrisGrid

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.


Transform
Target

The transform the debris will spawn around.

None/null = Main Camera.



SgtShapeGroup
SpawnInside

The shapes the debris will spawn inside.



float
ShowDistance

The distance from the target that debris begins spawning.



float
HideDistance

The distance from the target that debris gets hidden.



int
CellCount

This allows you to set how many cells are in the grid on each axis within the Hide Distance.



float
CellNoise

How far from the center of each cell the debris can be spawned. This should be decreased to stop debris intersecting.



float
DebrisCountTarget

The maximum expected amount of debris based on the cell size settings.



float
ScaleMin

The minimum scale multiplier of the debris.



float
ScaleMax

The maximum scale multiplier of the debris.



float
ScaleBias

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.



bool
RandomRotation

Should the debris be given a random rotation, or inherit from the prefab that spawned it?



int
Seed

This allows you to set the random seed used during procedural generation.



List<SgtDebris>
Prefabs

These prefabs are randomly picked from when spawning new debris.




SgtDebrisSpawner

This component allows you to randomly spawn debris around the camera over time.


Transform
Target

If this transform is inside the radius then debris will begin spawning.



SgtShapeGroup
SpawnInside

The shapes the debris will spawn inside.



float
ShowSpeed

How quickly the debris shows after it spawns.



float
ShowDistance

The distance from the follower that debris begins spawning.



float
HideDistance

The distance from the follower that debris gets hidden.



bool
SpawnOnAwake

Should all the debris be automatically spawned at the start?



int
SpawnLimit

The maximum amount of debris that can be spawned.



float
SpawnRateMin

The minimum amount of seconds between debris spawns.



float
SpawnRateMax

The maximum amount of seconds between debris spawns.



float
SpawnScaleMin

The minimum scale multiplier applied to spawned debris.



float
SpawnScaleMax

The maximum scale multiplier applied to spawned debris.



List<SgtDebris>
Prefabs

These prefabs are randomly picked from when spawning new debris.




SgtDemo

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.


bool
ForceScatteringHdrInHDRP

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.




SgtDragPitchYaw

This component adds basic Pitch/Yaw controls to the current GameObject (e.g. camera) using mouse or touch controls.


KeyCode
Key

The key that must be held for this component to activate on desktop platforms.

None = Any mouse button.



LayerMask
GuiLayers

Fingers that began touching the screen on top of these UI layers will be ignored.



float
Pitch

The target pitch angle in degrees.



float
PitchSensitivity

The speed the pitch changed relative to the mouse/finger drag distance.



float
PitchMin

The minimum value of the pitch value.



float
PitchMax

The maximum value of the pitch value.



float
Yaw

The target yaw angle in degrees.



float
YawSensitivity

The speed the yaw changed relative to the mouse/finger drag distance.



bool
YawClamp

Clamp the yaw value?



float
YawMin

The minimum value of the pitch value.



float
YawMax

The maximum value of the pitch value.



float
Damping

How quickly the rotation transitions from the current to the target value (-1 = instant).




SgtDragReceiver

This component modifies the attached Rigidbody component's drag value based on nearby SgtDragSource components in the scene.


float
Drag

The attached Rigidbody will be given this drag by default.



LayerMask
Layers

The allows you to choose which SgtDragSource layers are used.




SgtDragSource

This component allows you to define a drag source, which can be used to apply drag to Rigidbody components that have the SgtDragReceiver attached.


float
Drag

The drag applied to the drag receivers.



SgtShape
Shape

This allows you to specify the shape of this drag volume.




SgtEase

This class handles ease types used for various SGT features like atmosphere color falloff.



SgtFastBillboard

This component rotates the current GameObject to the rendering camera.


bool
RollWithCamera

If the camera rolls, should this billboard roll with it?



bool
AvoidClipping

If your billboard is clipping out of view at extreme angles, then enable this.



static LinkedList<SgtFastBillboard>
Instances

This stores all active and enabled instances of this component.




SgtFastBillboardManager

All SgtFastBillboards will be updated from here.


static LinkedList<SgtFastBillboardManager>
Instances

This stores all active and enabled instances of this component.




SgtFlare

This component allows you to generate a high resolution mesh flare.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Flare shader. You cannot use a normal shader.


Mesh
Mesh

This allows you to set the mesh used to render the flare.



bool
FollowCameras

Should the flare automatically snap to cameras.



float
FollowDistance

The distance from the camera this flare will be placed in world space.



float
CameraOffset

This allows you to offset the camera distance in world space when rendering the flare, giving you fine control over the render order.




SgtFlareMainTex

This component allows you to generate the material and texture for an SgtFlare.


Color
Color

The base color will be multiplied by this.



SgtEase.Type
Ease

The color transition style.



float
SharpnessR

The sharpness of the red transition.



float
SharpnessG

The sharpness of the green transition.



float
SharpnessB

The sharpness of the blue transition.



void
ExportTexture

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.




SgtFlareMesh

This component allows you to generate the SgtFlare.Mesh field.


int
Detail

The amount of points used to make the flare mesh.



float
Radius

The base radius of the flare in local space.



bool
Wave

Deform the flare based on cosine wave?



float
WaveStrength

The strength of the wave in local space.



int
WavePoints

The amount of wave peaks.



float
WavePower

The sharpness of the waves.



float
WavePhase

The angle offset of the waves.



bool
Noise

Deform the flare based on noise?



float
NoiseStrength

The strength of the noise in local space.



int
NoisePoints

The amount of noise points.



float
NoisePhase

The angle offset of the noise.



int
NoiseSeed

The random seed used for the random noise.



void
ExportMesh

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.




SgtFlareModel

This component is used to render the SgtFlare component.

NOTE  This component is automatically created and managed.


SgtFloatingBrightness

This component allows you to adjust the brightness of .


float
BrightnessNear

The brightness value when at or below the DistanceMin.



float
BrightnessFar

The brightness value when at or above the DistanceMax.



SgtLength
DistanceMin

The distance where the BrightnessNear will be used.



SgtLength
DistanceMax

The distance where the BrightnessFar will be used.



FloatEvent
OnBrightness

The calculated brightness value will be output via this event.




SgtFloatingCamera SgtFloatingPoint

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.


double
MassiveDistance

The maximum camera distance objects can render at when using the SgtFloatingMassive component.

NOTE  This should be lower than the Main Camera's Clipping Planes / Far setting.


float
SnapDistance

When the transform.position.magnitude exceeds this value, the position will be snapped back to the origin.



SgtPosition
SnappedPoint

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.

NOTE  This requires you to use the SgtFloatingOrigin component.


static event System.Action<SgtFloatingCamera, Vector3>
OnSnap

Called when this camera's position snaps back to the origin (Vector3 = delta).



static bool
TryGetInstance
ref SgtFloatingCamera instance

This method will fill the instance with the first active and enabled SgtFloatingCamera instance in the scene and return true, or return false.



SgtPosition
GetPosition
Vector3 worldPosition

This method converts the specified world space position into a universal SgtPosition.



Vector3
CalculatePosition
SgtPosition input

This method converts the specified universal SgtPosition into a world space position.



Vector3
CalculatePosition
ref SgtPosition input

This method converts the specified universal SgtPosition into a world space position.



void
TrySnap

If the current Transform.position has strayed too far from the origin, this method will then call Snap.



void
Snap

This method will reset the current Transform to 0,0,0 then update all SgtFloatingObjects in the scene.




SgtFloatingFollow

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.


SgtFloatingPoint
Target

This allows you to specify the SgtFloatingPoint this component will follow.



float
Damping

How quickly this point follows the target.

-1 = instant.



bool
Rotate

Should this transform's rotation also match that of the target?



Vector3
LocalPosition

This allows you to specify a positional offset relative to the Target.



Vector3
LocalRotation

This allows you to specify a rotational offset relative to the Target.




SgtFloatingLight

This component will rotate the current GameObject toward the SgtFloatingOrigin point. This makes directional lights compatible with the Universe feature.


static LinkedList<SgtFloatingLight>
Instances

This stores all active and enabled instances of this component.




SgtFloatingLod

This component allows you to spawn a prefab as a child of the current GameObject when the floating camera gets within the specified range.


GameObject
Prefab

The prefab that will be spawned.



SgtLength
DistanceMin

If the camera is closer than this distance, then the LOD will disappear.



SgtLength
DistanceMax

If the camera is farther than this distance, then the LOD will disappear.



bool
Spawned

This will be set while the LOD is within range.



GameObject
Clone

This allows you to get the spawned prefab clone.




SgtFloatingMassive SgtFloatingObject

This component works like SgtFloatingObject, but it will scale the object toward the camera if it's too far away to render.

NOTE  This component scales based on the SgtFloatingCamera component's MassiveDistance setting.
NOTE  This component overrides the Transform component settings, and will not react to any manual changes made to it.

Vector3
Scale

This setting allows you to adjust the per-axis size of this object.



SgtLength
Size

The base scale of this object.




SgtFloatingObject SgtFloatingPoint

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.


int
Seed

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.



event System.Action<int>
OnSpawn

If this object is spawned from an SgtFloatingSpawner___ component, then it will be given a seed and this event will be invoked.

int = Seed.



event System.Action<double>
OnDistance

This event is called every Update with the current distance to the camera.



void
ResetPosition

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.



void
DerivePosition

This method will calculate the Position based on the current Transform.position value relative to the current SgtFloatingCamera.



void
InvokeOnSpawn

You can call this method to invoke the OnSpawn method.

NOTE  This should only be called from an SgtFloatingSpawner___ component.



SgtFloatingOrbit

This component will orbit the attached SgtFloatingPoint around the parent SgtFloatingPoint.


SgtLength
Radius

The radius of the orbit in meters.



float
Oblateness

How squashed the orbit is.



Vector3
Tilt

The local rotation of the orbit in degrees.



Vector3
Offset

The local offset of the orbit in meters.



double
Angle

The current position along the orbit in degrees.



double
DegreesPerSecond

The orbit speed.



SgtFloatingPoint
ParentPoint

The center orbit point. NOTE: This should be null/None if it will be spawned by SgtFloatingSpawnerOrbit.




SgtFloatingOrbitVisual

This component draws an orbit in 3D space.


SgtFloatingOrbit
Orbit

The orbit that will be rendered by this component.



Material
Material

The material of the orbit.



SgtLength
Thickness

The thickness of the visual ring in local space.



int
Points

The amount of points used to draw the orbit.



Gradient
Colors

The color of the orbit ring as it goes around the orbit.




SgtFloatingParticleSystem

This component updates the position of the attached ParticleSystem component when the origin snaps with the Universe feature.



SgtFloatingPoint

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.


SgtPosition
Position

The position wrapped by this component.



event System.Action
OnPositionChanged

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).



void
NotifyPositionChanged

This method will invoke the OnPositionChanged event.



void
ApplyPosition

This method will apply the current Position to the Transform.Position, in case they go out of sync.



void
SetPosition
SgtPosition newPosition

This method allows you to change the whole Position state, and it will automatically call the PositionChanged method if the position is different.




SgtFloatingRigidbody SgtFloatingObject

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?



SgtFloatingRoot

All prefabs spawned from SgtFloatingLod and SgtFloatingSpawner___ will be attached to this GameObject.


static LinkedList<SgtFloatingRoot>
Instances

This stores all active and enabled instances of this component.




SgtFloatingScaler

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.


Transform
Target

If you want a different Transform to be scaled, you can specify it here.



Vector3
Scale

The base scale of the object.



double
Multiplier

The final scale will be multiplied by this.



SgtLength
Range

If the distance between the camera and this object is beyond this value, this object will be scaled to 0 and be invisible.



SgtFloatingObject
CachedObject

The SgtFloatingObject component alongside this component.




SgtFloatingSpawner

This is the base class for all Universe spawners, providing a useful methods for spawning and handling prefabs.


SgtLength
Range

The camera must be within this range for this spawner to activate.



string
Category

If you want to define prefabs externally, then you can use the SgtSpawnList component with a matching Category name.



List<SgtFloatingObject>
Prefabs

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.



bool
RandomizeIndex

If you disable this then the spawned object will use the same prefab as the spawn index.



SgtFloatingObject
CachedObject

The SgtFloatingObject component alongside this component.




SgtFloatingSpawnerOrbit SgtFloatingSpawner

This component will automatically spawn prefabs in orbit around the attached SgtFloatingPoint.


int
Count

The amount of prefabs that will be spawned.



float
TiltMax

The maximum degrees an orbit can tilt.



float
OblatenessMax

The maximum amount an orbit can be squashed.



SgtLength
RadiusMin

The minimum distance away the prefabs can spawn.



SgtLength
RadiusMax

The maximum distance away the prefabs can spawn in meters.




SgtFloatingSpawnerRing SgtFloatingSpawner

This component will automatically spawn prefabs in a ring around the attached SgtFloatingPoint.


int
Count

The amount of prefabs that will be spawned.



SgtLength
RadiusMin

The minimum distance away the prefabs can spawn.



SgtLength
RadiusMax

The maximum distance away the prefabs can spawn in meters.




SgtFloatingSpawnerSphere SgtFloatingSpawner

This component will automatically spawn prefabs in a circle around the attached SgtFloatingPoint.


int
Count

The amount of prefabs that will be spawned.



SgtLength
Radius

This component will spawn prefabs within this radius in world space.



float
Offset

The higher this value, the more likely the spawned objects will be pushed to the edge of the radius.



float
VelocityScale

This allows you to set how much orbital velocity the spawned objects get if they have a Rigidbody attached.




SgtFloatingSpeedometer

This component monitors the specified SgtFloatingCamera or SgtFloatingObject point for position changes, and outputs the speed of those changes to the OnString event.


SgtFloatingPoint
Point

The point whose speed will be monitored.



string
Format

The format of the speed text.



UpdateType
UpdateIn

This allows you to control where in the game loop the speed will be calculated.



StringEvent
OnString

Each time the speed updates this event will fire, which you can link to update UI text.




SgtFloatingTarget

This component marks the attached LeanFloatingPoint component as a warpable target point. This allows you to pick the target using the SgtWarpPin component.


string
WarpName

The shorthand name for this warp target.



SgtLength
WarpDistance

The distance from this SgtFloatingPoint we should warp to, to prevent you warping too close.



static LinkedList<SgtFloatingTarget>
Instances

This stores all active and enabled instances of this component.




SgtFloatingWarp

This is the base class for all warp styles.


SgtFloatingPoint
Point

The point that will be warped.



void
WarpTo
SgtFloatingTarget target

Allows you to warp to the target object.



void
WarpTo
SgtPosition position, double distance

Allows you to warp to the target point with the specified separation distance.




SgtFloatingWarpButton

This component allows you to warp to the target when clicking a button.

NOTE  The button's OnClick event must be linked to the Click method.

SgtFloatingTarget
Target

The point that will be warped to.



SgtFloatingWarp
Warp

The warp effect that will be used.




SgtFloatingWarpPin

This component moves Rect above the currently picked SgtFloatingTarget. You can tap/click the screen to update the picked target.


LayerMask
GuiLayers

Fingers that began touching the screen on top of these UI layers will be ignored.



float
PickDistance

The maximum distance between the tap/click point at the SgtWarpTarget in scaled screen space.



SgtFloatingTarget
CurrentTarget

The currently picked target.



RectTransform
Parent

The parent rect of the pin.



RectTransform
Rect

The main rect of the pin that will be placed on the screen on top of the CurrentTarget.



Text
Title

The name of the pin.



CanvasGroup
Group

The group that will control hide/show of the pin.



SgtFloatingWarp
Warp

The warp component that will be used.



bool
HideIfTooClose

Hide the pin if we're within warping distance?




SgtFloatingWarpSmoothstep SgtFloatingWarp

This component will smoothly warp to the target, where the speed will slow down near the start of the travel, and near the end.


double
WarpTime

Seconds it takes to complete a warp.



int
Smoothness

Warp smoothstep iterations.



bool
Warping

Currently warping?



double
Progress

Current warp progress in seconds.



SgtPosition
StartPosition

Start position of the warp.



SgtPosition
TargetPosition

Target position of the warp.




SgtGalaxy

This component allows you to render a galaxy based on a deformed sphere mesh with multiple textures that are blended together.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Galaxy shader. You cannot use a normal shader.


Mesh
SourceMesh

The sphere mesh used to render the galaxy.

NOTE  This should be a sphere mesh.


float
Radius

The radius of the nebula in local space.



float
Flattening

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.




SgtGalaxyModel

This component is used to render the SgtGalaxy component.

NOTE  This component is automatically created and managed.


SgtGravityReceiver

This component applies force to the attached Rigidbody based on nearby SgtGravitySource components.



SgtGravitySource

This component allows you to define a gravity source, which can be used to attract Rigidbodies with the SgtGravityReceiver attached.


float
Mass

The mass of this gravity source.



bool
AutoSetMass

If you enable this then the Mass setting will be automatically copied from the attached Rigidbody.




SgtJovian

This component allows you to render volumetric jovian (gas giant) planets.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Jovian shader. You cannot use a normal shader.
NOTE  If you modify the settings of this material in a build, you must manually call the SyncMaterial method.


Color
Color

This allows you to set the overall color of the jovian.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

This allows you to set the texture applied to the jovian.



Texture
FlowTex

This allows you to set the flow texture applied to the jovian.

NOTE  This is only used if the specified SourceMaterial enables FLOW.


float
CameraOffset

This allows you to offset the camera distance in world space when rendering the jovian, giving you fine control over the render order.



float
OcclusionPower

This setting allows you to increase or decrease how much this atmosphere occludes flares using the SgtOcclusionScaler component.



float
Sky

This allows you to control how thick the atmosphere is when the camera is inside its radius.



Mesh
Mesh

This allows you to set the mesh used to render the jovian. This should be a sphere.



float
MeshRadius

This allows you to set the radius of the Mesh. If this is incorrectly set then the jovian will render incorrectly.



float
Radius

This allows you to set the radius of the jovian in local space.



float
DistanceRadius

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.




SgtJovianDepthTex

This component allows you to generate the DepthTex setting for jovian materials.


SgtEase.Type
RimEase

The rim transition style.



float
RimPower

The rim transition sharpness.



Color
RimColor

The rim color.



float
AlphaDensity

The density of the atmosphere.



float
AlphaFade

The strength of the density fading in the upper atmosphere.



void
ExportTexture

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.




SgtJovianLightingTex

This component allows you to generate the LightingTex setting for jovian materials.


SgtEase.Type
SunsetEase

The transition style between the day and night.



float
SunsetStart

The start point of the sunset (0 = dark side, 1 = light side).



float
SunsetEnd

The end point of the sunset (0 = dark side, 1 = light side).



float
SunsetSharpnessR

The sharpness of the sunset red channel transition.



float
SunsetSharpnessG

The sharpness of the sunset green channel transition.



float
SunsetSharpnessB

The sharpness of the sunset blue channel transition.



void
ExportTexture

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.




SgtJovianModel

This component is used to render the SgtJovian component.

NOTE  This component is automatically created and managed.


SgtJovianScatteringTex

This component allows you to generate the ScatteringTex setting for cloudsphere materials.


SgtEase.Type
SunsetEase

The transition style between the day and night.



float
SunsetStart

The start point of the sunset (0 = dark side, 1 = light side).



float
SunsetEnd

The end point of the sunset (0 = dark side, 1 = light side).



float
SunsetSharpnessR

The sharpness of the sunset red channel transition.



float
SunsetSharpnessG

The sharpness of the sunset green channel transition.



float
SunsetSharpnessB

The sharpness of the sunset blue channel transition.



void
ExportTexture

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.




SgtLength

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.



SgtLens

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.

NOTE  Updating the cubemap texture can be expensive, and the effect won't work so well if you have rendered objects to the lens center.

Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Lens shader. You cannot use a normal shader.


Mesh
Mesh

The mesh used to render the lens effect. This should be a sphere.



int
Resolution

This allows you to set the width & height of each face in the cubemap this component renders.

NOTE  The higher you set this, the higher the visual quality, but the more expensive the texture updates will be.


float
Range

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.



float
Interval

This allows you to control how often the cubemap texture updates in seconds.

-1 = Manual only.

0 = Every frame.

2 = Every two seconds.



float
FadeOuter

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.



float
WarpOuter

This allows you control how far from the outer edge the spatial distortion begins.



float
WarpStrength

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.



float
HoleSize

This allows you to set the size of the black hole disc.



float
HoleEdge

This allows you to control the thickness of the black hole disc (event horizon).



Camera
CachedCamera

This property gives you the Camera alongside this component.




SgtLensModel

This component is used to render the SgtLens component.

NOTE  This component is automatically created and managed.


SgtLight

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.


bool
TreatAsPoint

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.



bool
UseLightIntensity

If you enable this setting, SGT components will use the sibling Light.intensity value multiplied by the Brightness value.



float
Brightness

The brightness value of this light as seen by SGT components.

NOTE  If you enable the UseLightIntensity setting, then this value will be multiplied by the sibling Light.intensity value.



SgtLightFlicker

This component will procedurally change the Intensity of the attached Light to simulate flickering.


float
MultiplierMin

The minimum Multiplier value.



float
MultiplierMax

The maximum Multiplier value.



float
Offset

The current animation position.



float
Speed

The current animation speed.




SgtLightning

This component handles rendering of lightning spawned from the SgtLightningSpawner component.


SgtLightningSpawner
LightningSpawner

The lightning spawner this belongs to. If this is null then this GameObject will automatically be destroyed.



float
Age

The maximum amount of seconds this lightning has been active for.



float
Life

The maximum amount of seconds this lightning can be active for.




SgtLightningSpawner

This component allows you to spawn animated lightning sprites around a planet.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Lightning shader. You cannot use a normal shader.


float
DelayMin

The minimum delay between lightning spawns.



float
DelayMax

The maximum delay between lightning spawns.



float
LifeMin

The minimum life of each spawned lightning.



float
LifeMax

The maximum life of each spawned lightning.



float
Radius

The radius of the spawned lightning mesh in local coordinates.



float
Size

The size of the lightning in degrees.



int
Detail

The amount of rows and columns in the lightning mesh.



Gradient
Colors

When lightning is spawned, its base color will be randomly picked from this gradient.



float
Brightness

The lightning color.rgb values are multiplied by this, allowing you to quickly adjust the overall brightness.



List<Sprite>
Sprites

The random sprite used by the lightning.




SgtLightPointer

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.



SgtLong3

This implements Vector3 using the long data type.



SgtLongBounds

This implements Bounds using the long data type.



SgtLongRect

This implements a Rect using the long data type.



SgtNebula

This component allows you to render a nebula or galaxy based on a deformed sphere mesh with multiple textures that are blended together.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Nebula shader. You cannot use a normal shader.


Mesh
SourceMesh

The sphere mesh used to render the nebula.

NOTE  This should be a sphere mesh.


float
Radius

The radius of the nebula in local space.



float
Frequency

The frequency of the displacement noise.



float
Displacement

The maximum height displacement applied to the nebula mesh when deformed.



float
Flattening

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.



void
Rebuild

This method causes the nebula mesh to update based on the current settings. You should call this after you finish modifying them.




SgtNebulaModel

This component is used to render the SgtNebula component.

NOTE  This component is automatically created and managed.


SgtOcclusion

This class allows you to calculate how much light is occluded between two 3D points.


static float
Calculate
int layers, Vector4 eye, Vector4 tgt, float maxRaycastDistance

This method performs the calculations. The eye and tgt arguments store the position in .xyz, and the radius in .w, both in world space.




SgtOcclusionScaler

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.


LayerMask
Layers

The layers that will be sampled when calculating the occlusion.



Vector3
MaxScale

This allows you to set the maximum scale when there is no depth.



float
Radius

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.



float
MaxRaycastDistance

Raycasts begin to break down beyond a certain distance depending on your scene scale, and this allows you to adjust that distance if required.




SgtPlanet

This component allows you to render a planet that has been displaced with a heightmap, and has a dynamic water level.


Mesh
Mesh

The sphere mesh used to render the planet.



MeshCollider
MeshCollider

If you want the generated mesh to have a matching collider, you can specify it here.



float
Radius

The radius of the planet in local space.



Material
Material

The material used to render the planet. For best results, this should use the SGT Planet shader.



SgtSharedMaterial
SharedMaterial

If you want to apply a shared material (e.g. atmosphere) to this terrain, then specify it here.



bool
CastShadows

Should the planet cast shadows?



bool
ReceiveShadows

Should the planet receive shadows?



float
WaterLevel

The current water level.

0 = Radius.

1 = Radius + Displacement.



bool
Displace

Should the planet mesh be displaced using the heightmap in the planet material?



float
Displacement

The maximum height displacement applied to the planet mesh when the heightmap alpha value is 1.



bool
ClampWater

If you enable this then the water will not rise, instead the terrain will shrink down.



void
Rebuild

This method causes the planet mesh to update based on the current settings. You should call this after you finish modifying them.




SgtPlanetWaterGradient

This component can be added alongside the SgtPlanet component to give it an animated water surface texture.


Color
Shallow

The color of shallow water.



Color
Deep

The color of deep water.



SgtEase.Type
Ease

The way the color transitions between shallow and deep.



float
Sharpness

This allows you to push the color toward the shallow or deep end.



float
Scale

The scale of the depth.



void
ExportTexture

This method allows you to export the generated texture as an asset.




SgtPlanetWaterTexture

This component can be added alongside the SgtPlanet component to give it an animated water surface texture.


Texture
BaseTexture

The generated water texture will be based on this texture.

NOTE  This should be a normal map.


float
Strength

The strength of the normal map.



float
Speed

The speed of the water animation.




SgtPoolClass<T>

This class can be used to pool normal C# classes.



SgtPoolComponent

This component is automatically generated by SGT components that implement GameObject pooling (e.g. SgtTerrainFace).


string
TypeName

The name of the type this pool manages.



List<Component>
Elements

The pooled elements in this pool.



static LinkedList<SgtPoolComponent>
Instances

This stores all active and enabled instances of this component.




SgtPosition

This class stores a coordinate in the Universe, and provides methods to manipulate them.


static readonly double
CELL_SIZE

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



double
LocalX

The position in meters along the X axis, relative to the current global cell position.



double
LocalY

The position in meters along the Y axis, relative to the current global cell position.



double
LocalZ

The position in meters along the Z axis, relative to the current global cell position.



long
GlobalX

The current grid cell along the X axis. Each grid cell is equal to 50000000 meters.



long
GlobalY

The current grid cell along the Y axis. Each grid cell is equal to 50000000 meters.



long
GlobalZ

The current grid cell along the Z axis. Each grid cell is equal to 50000000 meters.




SgtPrefabSwitcher

This component allows you to switch between a list of prefabs from UI button events.


float
Speed

The speed the prefabs will switch.



int
Index

The prefab index that will be displayed.



List<Transform>
Prefabs

The prefabs that can be switched between.



void
SwitchToPrev

This method decrements Index by one, and wraps around the prefab count.



void
SwitchToNext

This method increments Index by one, and wraps around the prefab count.




SgtProcedural

This component is the basis for all procedural components in SGT.


GenerateType
Generate

This allows you to control when this component will be generated.



int
Seed

The seed used for automatic generation.



void
GenerateWith
int seed

This method allows you to manually generate this component with the specified seed.




SgtProceduralForce SgtProcedural

This component adds force the current GameObject in a random direction, with a random speed.


Vector3
Direction

If you want to specify a force direction, set it here.



float
SpeedMin

Minimum degrees per second.



float
SpeedMax

Maximum degrees per second.




SgtProceduralScale SgtProcedural

This component rotates the current GameObject along a random axis, with a random speed.


Vector3
BaseScale

The default scale of your object.



float
ScaleMultiplierMin

The minimum multiplication of the BaseScale.



float
ScaleMultiplierMax

The maximum multiplication of the BaseScale.




SgtProceduralSpin SgtProcedural

This component rotates the current GameObject along a random axis, with a random speed.


float
SpeedMin

Minimum degrees per second.



float
SpeedMax

Maximum degrees per second.




SgtProceduralTint SgtProcedural

This component allows you to procedurally generate the SpriteRenderer.color setting.


Gradient
Colors

A color will be randomly picked from this gradient.




SgtProceduralTorque SgtProcedural

This component rotates the current GameObject along a random axis, with a random speed.


float
SpeedMin

Minimum degrees per second.



float
SpeedMax

Maximum degrees per second.




SgtProminence

This component allows you to render a series of randomly rotated disks around a star that make the corona look volumetric and detailed.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Prominence shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the starfield.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

This allows you to set the texture applied to the prominence.



float
CameraOffset

This allows you to offset the camera distance in world space when rendering the jovian, giving you fine control over the render order.



int
Seed

This allows you to set the random seed used during procedural generation.



int
PlaneCount

The amount of planes used to build the prominence.



int
PlaneDetail

The amount of quads used to build each plane.



float
RadiusMin

The inner radius of the prominence planes in local coordinates.



float
RadiusMax

The outer radius of the prominence planes in local coordinates.




SgtProminenceModel

This component is used to render the SgtProminence component.

NOTE  This component is automatically created and managed.


SgtProperties

This class wraps MaterialPropertyBlock to allow for the removal of specific properties.



SgtProximityDrag

This component rotates the current GameObject.


float
DistanceMin



float
DistanceMax



float
DragMin



float
DragMax



float
AngularDragMin



float
AngularDragMax




SgtRaycastTranslate

This component rotates the current GameObject.


Vector3
LocalTarget

The target local translation.



LayerMask
Layers

The GameObject layers we will raycast against.



float
Radius

The radius of the raycast, to prevent surface penetration by cameras.




SgtRenderQueue

This allows you to specify the render queue for a material.



SgtRing

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.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Ring shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the ring.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

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.



float
RadiusInner

The radius of the inner edge of the ring in local space.



float
RadiusOuter

The radius of the outer edge of the ring in local space.



bool
Split

Should the ring be split into two parts to improve depth sorting with planets?



float
SortDistance

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.




SgtRingLightingTex

This component allows you to generate the SgtRing.LightingTex field.


float
FrontPower

How sharp the incoming light scatters forward.



float
BackPower

How sharp the incoming light scatters backward.



float
BackStrength

The strength of the back scattered light.



float
BaseStrength

The of the perpendicular scattered light.



void
ExportTexture

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.




SgtRingMainTexFilter

This component allows you to generate the SgtRing.MainTex field based on a simple RGB texture of a ring.


Texture2D
Source

The source ring texture that will be filtered.



TextureFormat
Format

The format of the generated texture.



float
Power

The sharpness of the light/dark transition.



float
Exposure

This allows you to control the brightness.



void
ExportTexture

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.




SgtRingModel

This component is used to render the SgtRing component.

NOTE  This component is automatically created and managed.


SgtRingNearTex

This component allows you to generate the NearTex for the SgtRing component's material.


SgtEase.Type
Ease

The ease type used for the transition.



float
Sharpness

The sharpness of the transition.



float
Offset

The start point of the fading.



float
OverrideRange

Should this component also control the ring's NearRangeRecip setting?

-1 = Don't override.



void
ExportTexture

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.




SgtShadow

This base class handles calculation of a shadow matrix and shadow texture.



SgtShadowLayer

This component allows you to add shadows cast from an SgtShadow___ component to any opaque renderer in your scene.


float
Radius

The radius of this shadow receiver.



List<MeshRenderer>
Renderers

The renderers you want the shadows to be applied to.




SgtShadowRing SgtShadow

This component allows you to cast a ring shadow from the current GameObject.


Texture
Texture

The texture of the shadow (left = inside, right = outside).



float
RadiusMin

The inner radius of the ring casting this shadow (auto set if Ring is set).



float
RadiusMax

The outer radius of the ring casting this shadow (auto set if Ring is set).




SgtShadowRingFilter

This component allows you to generate a blurred SgtShadowRing.Texture based on a normal texture.


Texture2D
Source

The source ring texture that will be filtered.



TextureFormat
Format

The format of the generated texture.



int
Iterations

The amount of blur iterations.



bool
ShareRGB

Overwrite the RGB channels with the alpha?



bool
Invert

Invert the alpha channel?



void
ExportTexture

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.




SgtShadowSphere SgtShadow

This component allows you to cast a sphere shadow from the current GameObject.


float
SharpnessR

The sharpness of the sunset red channel transition.



float
SharpnessG

The power of the sunset green channel transition.



float
SharpnessB

The power of the sunset blue channel transition.



float
RadiusMax

The outer radius of the sphere in local space.




SgtShape

This is the base class for all volumetric shapes. These can be used to define regions where effects are visible.


float
GetDensity
Vector3 worldPoint

Returns a 0..1 value, where 1 is fully inside




SgtShapeBox SgtShape

This component allows you to define a box shape that can be used by other components to perform actions confined to the volume.


Vector3
Extents

The min/max size of the box.



SgtEase.Type
Ease

The transition style between minimum and maximum density.



float
Sharpness

How quickly the density increases when inside the sphere.




SgtShapeGroup

This component allows you to group multiple SgtShape___ components and treat them as a single large volume.


List<SgtShape>
Shapes

The shapes associated with this group.




SgtShapeSphere SgtShape

This component allows you to define a sphere shape that can be used by other components to perform actions confined to the volume.


float
Radius

The radius of this sphere in local space.



float
Height

If this is set, then any point within Radius will have maximum density, and it will fall off to zero within the height range.



SgtEase.Type
Ease

The transition style between minimum and maximum density.



float
Sharpness

How quickly the density increases when inside the sphere.




SgtShapeTorus SgtShape

This component allows you to define a torus shape that can be used by other components to perform actions confined to the volume.


float
Radius

The radius of this torus in local coordinates.



float
Thickness

The radial thickness of the torus in local space.



SgtEase.Type
Ease

The transition style between minimum and maximum density.



float
Sharpness

How quickly the density increases when inside the torus.




SgtSharedMaterial

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.


Material
Material

The material that will be applied to all renderers.




SgtSimpleOrbit

This component makes the current gameObject orbit around its parent in a basic circle or ellipse shape.


float
Radius

The radius of the orbit in local coordinates.



Vector2
Scale

How squashed the orbit is.



Vector3
Offset

The local position offset of the orbit.



Vector3
Tilt

The local rotation offset of the orbit in degrees.



float
Angle

The current position along the orbit in degrees.



float
DegreesPerSecond

The orbit speed.




SgtSimpleScaler

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.


Vector3
Scale

The base scale of the object.



float
Multiplier

Scale is multiplied by this when at DistanceMin.



float
DistanceMin

The distance where the scaling begins.



float
DistanceMax

The distance where the scaling stops.




SgtSpacetime

This component allows you to render a grid that can be deformed by SgtSpacetimeWell components.


Material
Material

The Material used to render all the spacetime meshes. This should use the Space Graphics Toolkit/Spacetime material.



List<Renderer>
Renderers

The spacetime data collected by this component will be rendered to these Renderers.

NOTE  If you modify this list you should call the DirtyRenderers or ApplyMaterialToRenderers method.


int
MaxGaussianWells

The maximum amount of SgtSpacetimeWell components with the Gaussian distribution that can be rendered by this spacetime.



int
MaxRippleWells

The maximum amount of SgtSpacetimeWell components with the Ripple distribution that can be rendered by this spacetime.



int
MaxTwistWells

The maximum amount of SgtSpacetimeWell components with the Twist distribution that can be rendered by this spacetime.



int
MaxPinchWells

The maximum amount of SgtSpacetimeWell components with the Pinch distribution that can be rendered by this spacetime.



bool
RequireSameLayer

Filter all the wells to require the same layer at this GameObject.



bool
RequireSameTag

Filter all the wells to require the same tag at this GameObject.



string
RequireNameContains

Filter all the wells to require a name that contains this.



List<SgtSpacetimeWell>
Wells

This tells you which wells this spacetime is currently rendering based on the current Require settings.



void
ApplyMaterialToRenderers

This will immediately apply the Material to all Renderers if you've changed any.



void
DirtyMaterial

If you manually modified the Material, then you can call this method so they will be updated at the end of the frame.

NOTE  This will automatically be called when modifying the Material property.


void
DirtyRenderers

If you manually modified the Renderers list, then you can call this method so they will be updated at the end of the frame.



static SgtSpacetime
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the SgtSpacetime component attached.



static SgtSpacetime
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the SgtSpacetime component attached.




SgtSpacetimeMesh

This component can generate a plane grid mesh suitable for use with the SgtSpacetime component.

NOTE  For maximum performance it's recommended that you manually use the ExportMesh context menu option of this component to turn this mesh into an asset. You can then remove this component and use the exported mesh.

float
SizeX

The size of the grid along the X axis.



float
SizeZ

The size of the grid along the Z axis.



int
QuadsX

The amount of quads along the X axis.



int
QuadsZ

The amount of quads along the Z axis.



bool
Center

Should the mesh be centered, or begin at local 0,0?



void
ExportMesh

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.



static SgtSpacetimeMesh
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the SgtSpacetimeMesh component attached.



static SgtSpacetimeMesh
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the SgtSpacetimeMesh component attached.




SgtSpacetimeWell

This component allows you to deform SgtSpacetime grids.


DistributionType
Distribution

The method used to deform the spacetime.



float
Radius

The radius of this spacetime well.



float
Strength

The well will modify the spacetime positions by this amount.



float
Opacity

The overall effect of the well will be multiplied by this.



bool
Combine

Should the Strength get multiplied by the Opacity?



float
Frequency

The frequency of the ripple.



float
Offset

The frequency offset.



float
OffsetSpeed

The frequency offset speed per second.



float
HoleSize

The size of the twist hole.



float
HolePower

The power of the twist hole.



static LinkedList<SgtSpacetimeWell>
Instances

This stores all active and enabled instances of this component.



float
FinalStrength

This returns the Strength value depending on the Combine and Opacity settings.



static SgtSpacetimeWell
Create
int layer = 0, Transform parent = null

This allows you create a new GameObject with the SgtSpacetimeWell component attached.



static SgtSpacetimeWell
Create
int layer, Transform parent, Vector3 localPosition, Quaternion localRotation, Vector3 localScale

This allows you create a new GameObject with the SgtSpacetimeWell component attached.




SgtSpawnList

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.


string
Category

The type of prefabs these are (e.g. Planet).



List<SgtFloatingObject>
Prefabs

The prefabs belonging to this spawn list.



static LinkedList<SgtSpawnList>
Instances

This stores all active and enabled instances of this component.




SgtStarfield

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.


Material
SourceMaterial

The material used to render this component.

NOTE  This material must use the Space Graphics Toolkit/Starfield shader. You cannot use a normal shader.


Color
Color

This allows you to set the overall color of the starfield.



float
Brightness

The Color.rgb values will be multiplied by this.



Texture
MainTex

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.



SgtAtlas
Atlas

If the main texture of this material contains multiple textures in an atlas, then you can specify them here.



float
ClampSizeMin

Should the stars fade out instead of shrink when they reach a certain minimum size on screen?



float
Softness

Should the stars fade out if they're intersecting solid geometry?



bool
Stretch

Should the stars stretch if an observer moves?



Vector3
StretchVector

The vector of the stretching.



float
StretchScale

The scale of the stretching relative to the velocity.



float
StretchLimit

When warping with the Universe feature, the camera velocity can get too large, this allows you to limit it.




SgtStarfieldBox SgtStarfield

This component allows you to render a starfield with a distribution of a box.


int
Seed

This allows you to set the random seed used during procedural generation.



Vector3
Extents

The +- size of the starfield.



float
Offset

How far from the center the distribution begins.



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.

NOTE  Your SourceMaterial must have PULSE enabled for this setting to be used.


float
StarPulseSpeedMax

The maximum animation speed of the pulsing.

NOTE  Your SourceMaterial must have PULSE enabled for this setting to be used.



SgtStarfieldCustom SgtStarfield

This component allows you to specify the exact position/size/etc of each star in this starfield.


List<SgtStarfieldStar>
Stars

The stars that will be rendered by this starfield.

NOTE  If you modify this then you must then call the DirtyMesh method.



SgtStarfieldDome SgtStarfield

This component allows you to render a starfield with a dome like distribution.


int
Seed

This allows you to set the random seed used during procedural generation.



float
Radius

The radius of the starfield.



float
Bias

This allows you to control if the stars should cluster near the horizon, or near the azimuth.



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.



float
StarPulseSpeedMax

The maximum animation speed of the pulsing.




SgtStarfieldElliptical SgtStarfield

This component allows you to render a starfield with a distribution like an elliptical galaxy.


int
Seed

This allows you to set the random seed used during procedural generation.



float
Radius

The radius of the starfield.



float
Symmetry

Should more stars be placed near the horizon?



float
Offset

How far from the center the distribution begins.



float
Bias

Invert the distribution?



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.



float
StarPulseSpeedMax

The maximum animation speed of the pulsing.




SgtStarfieldFarTex

This component allows you to generate the SgtStarfield.FarTex field.


SgtEase.Type
Ease

The transition style.



float
Sharpness

The sharpness of the transition.



float
OverrideRadius

Should this component also control the starfield's FarRangeRadius setting?

-1 = Don't override.



float
OverrideRange

Should this component also control the starfield's FarRangeRecip setting?

-1 = Don't override.



void
ExportTexture

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.




SgtStarfieldInfinite SgtStarfield

This component allows you to render a starfield that repeats forever.


int
Seed

This allows you to set the random seed used during procedural generation.



Vector3
Size

The size of the starfield in local space.



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.



float
StarPulseSpeedMax

The maximum animation speed of the pulsing.




SgtStarfieldModel

This component is used to render the SgtStarfield component.

NOTE  This component is automatically created and managed.


SgtStarfieldNearTex

This component allows you to generate the SgtStarfield.NearTex field.


SgtEase.Type
Ease

The transition style.



float
Sharpness

The sharpness of the transition.



float
Offset

The start point of the fading.



float
OverrideRange

Should this component also control the starfield's NearRangeRecip setting?

-1 = Don't override.



void
ExportTexture

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.




SgtStarfieldNebula SgtStarfield

This component allows you to render a nebula as a starfield from a single picture.


int
Seed

This allows you to set the random seed used during procedural generation.



Texture
SourceTex

This texture used to color the nebula particles.



float
Threshold

This brightness of the sampled SourceTex pixel for a particle to be spawned.



int
Samples

The amount of times a nebula point is randomly sampled, before the brightest sample is used.



float
Jitter

This allows you to randomly offset each nebula particle position.



SourceType
HeightSource

The calculation used to find the height offset of a particle in the nebula.



SourceType
ScaleSource

The calculation used to find the scale modified of each particle in the nebula.



Vector3
Size

The size of the generated nebula.



float
HorizontalBrightness

The brightness of the nebula when viewed from the side (good for galaxies).



float
HorizontalPower

The relationship between the Brightness and HorizontalBrightness relative to the viewing angle.



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarTint

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.



float
StarBoost

Should the star color luminosity be boosted?



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.



float
StarPulseSpeedMax

The maximum animation speed of the pulsing.




SgtStarfieldSpiral SgtStarfield

This component allows you to generate a starfield in a spiral pattern.


int
Seed

This allows you to set the random seed used during procedural generation.



float
Radius

The radius of the starfield.



int
ArmCount

The amount of spiral arms.



float
Twist

The amount each arm twists.



float
ThicknessInner

This allows you to set the thickness of the star distribution at the center of the spiral.



float
ThicknessOuter

This allows you to set the thickness of the star distribution at the edge of the spiral.



float
ThicknessPower

This allows you to push stars away from the spiral, giving you a smoother distribution.



int
StarCount

The amount of stars that will be generated in the starfield.



Gradient
StarColors

Each star is given a random color from this gradient.



float
StarRadiusMin

The minimum radius of stars in the starfield.



float
StarRadiusMax

The maximum radius of stars in the starfield.



float
StarRadiusBias

How likely the size picking will pick smaller stars over larger ones (1 = default/linear).



float
StarPulseSpeedMin

The minimum animation speed of the pulsing.



float
StarPulseSpeedMax

The maximum animation speed of the pulsing.




SgtStarfieldStar

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.


int
Variant

The coordinate index in the asteroid texture.



Color
Color

Color tint of this star.



float
Radius

Radius of this star in local space.



float
Angle

Angle in degrees.



Vector3
Position

Local position of this star relative to the starfield.



float
PulseSpeed

How fast this star pulses.

NOTE  This requires the starfield material's PULSE setting to be enabled.


float
PulseOffset

The pulse position will be offset by this value so they don't all pulse the same.

NOTE  This requires the starfield material's PULSE setting to be enabled.



SgtTerrain

This component allows you to create a sphere mesh that will dynamically increase in detail as the camera (or other GameObject) approaches the surface.

NOTE  You must use one of the SgtTerrain___Material components to actually render the mesh.

double
Radius

The distance between the center and edge of the planet in local space before it's deformed.



double
SmallestTriangleSize

When at the surface of the planet, how big should each triangle be?

NOTE  This is an approximation. The final size of the triangle will depend on your planet radius, and will be a power of two.


long
Resolution

The base resolution of the planet before LOD is used.



double
Detail

The higher this value, the more triangles will be in view.



bool
AutoPreview

If you enable this then the mesh will automatically update in edit mode.

NOTE  Enabling this may cause your editor to run slow.


Transform
Observer

The LOD will be based on the distance to this Transform.

None = Main Camera.



SgtTerrainAreas
Areas

This allows you to control which areas certain terrain features appear on the mesh.



event System.Action<SgtTerrainQuad>
OnScheduleQuad

This event tells you when a mesh surface is scheduled to update, allowing you prepare data for this new configuration.



event System.Action
OnSwap

This event tells you when the terrain has finished updating.



event System.Action<Camera, SgtTerrainQuad, Matrix4x4, int>
OnDrawQuad

This event tells you when a mesh surface should render, allowing you specify a custom material.

int = Render layer.



void
MarkAsDirty

This method will cause the whole terrain mesh to be rebuilt.



static SgtTerrain
FindNearest
Vector3 worldPosition

This method returns the nearest SgtTerrain to the specified world point.



double3
GetLocalPoint
double3 localPoint

This method will snap the specified position to the surface of the terrain in local space.



int
GetDepth
double triangleSize

This method tells you the LOD level where triangles are closest to the specified triangle size.



void
Complete

This method allows you to force the mesh to finish updating immediately.

NOTE  This may be slow.



SgtTerrainAreas

This object can be used to convert a splat map texture into area data used by the SgtTerrainPlanet component.


Texture2D
Texture

The texture used to define the areas.

NOTE  This texture should be uncompressed.
NOTE  This texture should be readable.


List<Splat>
Splats

The splat map layers that will be extracted from the source textures.



int
SplatCount

This allows you to get how many splat maps are contained in the array data.



int2
Size

This tells you how many pixels are in each array layer.



NativeArray<float>
Weights

This allows you to get the extracted splat data.

NOTE  This array size will be LayerCount * Size.x * Size.Y * SplatCount.



SgtTerrainClamp

This component allows you to clamp the heights of the attached SgtTerrain to be within a specific range.


int
Area

This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.



double
Minimum

Terrain heights below this value will be clamped.



double
Maximum

Terrain heights above this value will be clamped.



double
Thickness

If you don't want the clamping to be abrupt, you can increase the thickness where the clamp transitions.



double
Power

This controls the shape of the Thickness transition.




SgtTerrainCollider

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.

NOTE  Collider generation is slow, so you should keep the Resolution as low as possible.

long
Resolution

The terrain will be split into this many cells on each axis.



int
Radius

The radius in chunks around the camera that will have colliders.

1 = 3x3 chunks.

2 = 5x5 chunks.

3 = 7x7 chunks.



int
Detail

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.



int
Delay

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.




SgtTerrainFeature

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).


Texture2D
Heightmap

The heightmap texture used to displace the mesh.



ChannelType
Channel

This allows you to choose which color channel from the heightmap texture will be used.

NOTE  If your texture uses a 1 byte per channel format like Alpha8/R8, then this setting will be ignored.


double
Displacement

This allows you to control the maximum height displacement applied to the terrain.



Vector3
Rotation

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.



float
Scale

This allows you to specify the scale of the feature in local space.




SgtTerrainHeightmap

This component allows you to deform the attached SgtTerrain with a heightmap using equirectangular cylindrical projection.


Texture2D
Heightmap

The heightmap texture used to displace the mesh.

NOTE  This should use the equirectangular cylindrical projection.


ChannelType
Channel

This allows you to choose which color channel from the heightmap texture will be used.

NOTE  If your texture uses a 1 byte per channel format like Alpha8/R8, then this setting will be ignored.


double
Displacement

This allows you to control the maximum height displacement applied to the terrain.




SgtTerrainObject

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.


SgtTerrain
Terrain

The terrain this object is attached to.

None/null = Nearest.



float
Offset

This allows you to move the object up based on the surface normal in world space.



float
Radius

The surface normal will be calculated using this sample radius in world space. Larger values = Smoother.



SnapType
SnapIn

This allows you to control where in the game loop the object position will be snapped.




SgtTerrainOcean SgtTerrain

This component allows you to create dynamic mesh LOD oceans suitable for use with the SGT / Terrain Ocean shader.


SgtTerrain
Ground

This allows you to specify the terrain used for the planet surface. This height data is written to the ocean meshed for depth information.



bool
Invert

Invert the ocean mesh to draw the ocean underwater?



int
BakedDetailTilingA

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.



int
BakedDetailTilingB

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.



int
BakedDetailTilingC

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.




SgtTerrainOceanMaterial SgtTerrainPlanetMaterial

This component allows you to render the SgtTerrain component using the SGT Planet shader.


bool
Animate

Should the ocean surface texture be animated?



Texture
BaseTexture

The generated water texture will be based on this texture.

NOTE  This should be a normal map.


float
Strength

The speed of the water animation.



float
Speed

The speed of the water animation.



bool
DetailA

Should the animated texture be applied to the first detail layer?



bool
DetailB

Should the animated texture be applied to the second detail layer?



bool
DetailC

Should the animated texture be applied to the third detail layer?




SgtTerrainPlanet SgtTerrain

This component allows you to create dynamic mesh LOD planets suitable for use with the SGT / Terrain Planet shader.


int
BakedDetailTilingA

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.



int
BakedDetailTilingB

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.



int
BakedDetailTilingC

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.




SgtTerrainPlanetMaterial

This component allows you to render the SgtTerrain component using the SGT Planet shader.


Material
Material

The planet material that will be rendered.



bool
CastShadows

Should the planet cast shadows?



bool
ReceiveShadows

Should the planet receive shadows?



double
NormalFadeRange

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.



SgtTerrain
Water

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.




SgtTerrainPrefabSpawner

This component allows you to spawn objects on the attached SgtTerrain using a splatmap.


int
Area

This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.



float
Threshold

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.



int
Limit

The maximum amount of prefabs that can spawn per chunk.



long
Resolution

The terrain will be split into this many cells on each axis.



int
Radius

The radius in chunks around the camera that will have prefabs.

1 = 3x3 chunks.

2 = 5x5 chunks.

3 = 7x7 chunks.



RotateType
Rotate

How should the spawned prefabs be rotated?



SgtSharedMaterial
SharedMaterial

If your terrain has an atmosphere/corona and your spawned objects are large enough to be covered by it, then specify its SgtSharedMaterial here.



List<Transform>
Prefabs

The prefabs that will be spawned.




SgtTerrainShadowLayer

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.


SgtShadowLayer
ShadowLayer

The shared material that will be rendered.




SgtTerrainSharedMaterial

This component allows you to render the SgtTerrain component using the specified SgtSharedMaterial.

Components like SgtAtmosphere give you a shared material.


SgtSharedMaterial
SharedMaterial

The shared material that will be rendered.




SgtTerrainSimplex

This component allows you to deform the attached SgtTerrain with procedural simplex noise.


int
Area

This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.



double
Frequency

The amount of peaks and valleys across the mesh.



double
Amplitude

The maximum +- displacement of the first octave.

NOTE  The final displacement may be greater than this range when using multiple octaves.


bool
Ridged

Use ridged simplex noise?



int
Seed

The random noise seed.



int
Octaves

The amount of noise layers.




SgtTerrainSine

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.


int
Area

This allows you to control where this biome appears based on the SgtTerrain component's Areas splatmap.



double
Frequency

The amount of peaks and valleys across the mesh.



double
Amplitude

The maximum +- displacement of the first octave.

NOTE  The final displacement may be greater than this range when using multiple octaves.


int
Octaves

The amount of noise layers.




SgtTerrainTopology

This class contains the core classes and methods used to construct the SgtTerrain mesh.



SgtTerrainUnderwater

This component swaps the planet's atmosphere material when the camera goes underwater.


SgtTerrainOcean
Ocean

The main ocean applied to the planet. This is used for the radius check to see if the camera is underwater.



SgtTerrainSharedMaterial
TerrainMaterial

The terrain material renderer. This component swaps its shared material based on the camera position.



SgtSharedMaterial
UnderMaterial

The material applied to the terrain when the camera is under the water.




SgtThruster

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.


float
Throttle

How active is this thruster? 0 for off, 1 for max power, -1 for max reverse, etc.



Rigidbody
Body

The rigidbody you want to apply the thruster forces to



bool
ForceAtPosition

The type of force we want to apply to the Rigidbody.



ForceMode
ForceMode

The force mode used when adding force to the Rigidbody.



float
ForceMagnitude

The maximum amount of force applied to the rigidbody (when the throttle is -1 or 1).



static SgtThruster
Create
int layer = 0, Transform parent = null

Create a child GameObject with a thruster attached




SgtThrusterControls

This component allows you to control the specified thrusters with the specified control axes.


bool
Listen

Is this component currently listening for inputs?



List<ThrusterGroup>
Groups

This allows you to specify each thruster group, each of which is controlled separately.




SgtThrusterRoll

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


Vector3
Rotation

The rotation offset in degrees.




SgtThrusterScale

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


SgtThruster
Thruster

The thruster the scale will be based on.



float
Damping

The speed at which the scale reaches its target value.



Vector3
BaseScale

The scale value that's applied by default.



Vector3
ThrottleScale

The scale value that's added when the throttle is 1.



float
Flicker

The amount the ThrottleScale flickers over time.



float
FlickerOffset

The offset of the flicker animation.



float
FlickerSpeed

The speed of the flicker animation.




Index

Thank you for using Space Graphics Toolkit ❤️

Required Packages

How do I upgrade?

Where do I get more packs?

Why does each feature require so many components?

How do I use this from C#?

Which versions of Unity are supported?

Is URP/HDRP supported?

Is VR supported?

Does this work on mobile/console/WebGL/etc?

Known Issues

What Examples Are Included?

Atmosphere

Aurora

Backdrop

Belt

Billboard

Cloudsphere

Debris

Flare

Galaxy

Jovian

Lightning

Nebula

Planet

Prominence

Ring

Singularity

Spacetime

Star

Starfield

Terrain

Thruster

Universe



Assets

Lean Touch

Lean Touch+

Lean Localization

Lean Pool

Lean Transition

Lean GUI

Lean GUI Shapes

Lean Texture

Lean Texture+

Spaceships - Build & Destroy

Modular Backgrounds

Paint in 3D

Paint in 2D

Paint in Editor

FLOW

Destructible 2D

Space Graphics Toolkit

Space Graphics Planets

Volumetric Audio



Versions

4.2.5

4.2.4

4.2.3

4.2.2

4.2.1

4.2.0

4.1.5

4.1.4

4.1.3

4.1.2

4.1.1

4.1.0

4.0.9

4.0.8

4.0.7

4.0.6

4.0.5

4.0.4

4.0.3

4.0.2

4.0.1

4.0.0

3.9.13

3.9.12

3.9.11

3.9.10

3.9.9

3.9.8

3.9.7

3.9.6

3.9.5

3.9.4

3.9.3

3.9.2

3.9.1

3.9.0

3.8.6

3.8.5

3.8.4

3.8.3

3.8.2

3.8.1

3.8.0

3.7.11

3.7.10

3.7.9

3.7.8

3.7.7

3.7.6

3.7.5

3.7.4

3.7.3

3.7.2

3.7.1

3.7.0

3.6.9

3.6.8

3.6.7

3.6.6

3.6.5

3.6.4

3.6.3

3.6.2



Components

SgtAtlas

SgtAtmosphere

SgtAtmosphereDepthTex

SgtAtmosphereHeight

SgtAtmosphereLightingTex

SgtAtmosphereModel

SgtAtmosphereScatteringTex

SgtAtmosphereSoil

SgtAurora

SgtAuroraMainTex

SgtAuroraModel

SgtAuroraNearTex

SgtBackdrop

SgtBackdropModel

SgtBackdropQuad

SgtBackgroundMesh

SgtBelt

SgtBeltAsteroid

SgtBeltCustom

SgtBeltLightingTex

SgtBeltModel

SgtBeltSimple

SgtBillboard

SgtBlackHole

SgtBlackHoleModel

SgtCamera

SgtCameraMove

SgtCameraPath

SgtCameraState

SgtCloudsphere

SgtCloudsphereDepthTex

SgtCloudsphereLightingTex

SgtCloudsphereModel

SgtCloudsphereNearTex

SgtCommon

SgtDebris

SgtDebrisGrid

SgtDebrisSpawner

SgtDemo

SgtDragPitchYaw

SgtDragReceiver

SgtDragSource

SgtEase

SgtFastBillboard

SgtFastBillboardManager

SgtFlare

SgtFlareMainTex

SgtFlareMesh

SgtFlareModel

SgtFloatingBrightness

SgtFloatingCamera

SgtFloatingFollow

SgtFloatingLight

SgtFloatingLod

SgtFloatingMassive

SgtFloatingObject

SgtFloatingOrbit

SgtFloatingOrbitVisual

SgtFloatingParticleSystem

SgtFloatingPoint

SgtFloatingRigidbody

SgtFloatingRoot

SgtFloatingScaler

SgtFloatingSpawner

SgtFloatingSpawnerOrbit

SgtFloatingSpawnerRing

SgtFloatingSpawnerSphere

SgtFloatingSpeedometer

SgtFloatingTarget

SgtFloatingWarp

SgtFloatingWarpButton

SgtFloatingWarpPin

SgtFloatingWarpSmoothstep

SgtGalaxy

SgtGalaxyModel

SgtGravityReceiver

SgtGravitySource

SgtJovian

SgtJovianDepthTex

SgtJovianLightingTex

SgtJovianModel

SgtJovianScatteringTex

SgtLength

SgtLens

SgtLensModel

SgtLight

SgtLightFlicker

SgtLightning

SgtLightningSpawner

SgtLightPointer

SgtLong3

SgtLongBounds

SgtLongRect

SgtNebula

SgtNebulaModel

SgtOcclusion

SgtOcclusionScaler

SgtPlanet

SgtPlanetWaterGradient

SgtPlanetWaterTexture

SgtPoolClass<T>

SgtPoolComponent

SgtPosition

SgtPrefabSwitcher

SgtProcedural

SgtProceduralForce

SgtProceduralScale

SgtProceduralSpin

SgtProceduralTint

SgtProceduralTorque

SgtProminence

SgtProminenceModel

SgtProperties

SgtProximityDrag

SgtRaycastTranslate

SgtRenderQueue

SgtRing

SgtRingLightingTex

SgtRingMainTexFilter

SgtRingModel

SgtRingNearTex

SgtShadow

SgtShadowLayer

SgtShadowRing

SgtShadowRingFilter

SgtShadowSphere

SgtShape

SgtShapeBox

SgtShapeGroup

SgtShapeSphere

SgtShapeTorus

SgtSharedMaterial

SgtSimpleOrbit

SgtSimpleScaler

SgtSpacetime

SgtSpacetimeMesh

SgtSpacetimeWell

SgtSpawnList

SgtStarfield

SgtStarfieldBox

SgtStarfieldCustom

SgtStarfieldDome

SgtStarfieldElliptical

SgtStarfieldFarTex

SgtStarfieldInfinite

SgtStarfieldModel

SgtStarfieldNearTex

SgtStarfieldNebula

SgtStarfieldSpiral

SgtStarfieldStar

SgtTerrain

SgtTerrainAreas

SgtTerrainClamp

SgtTerrainCollider

SgtTerrainFeature

SgtTerrainHeightmap

SgtTerrainObject

SgtTerrainOcean

SgtTerrainOceanMaterial

SgtTerrainPlanet

SgtTerrainPlanetMaterial

SgtTerrainPrefabSpawner

SgtTerrainShadowLayer

SgtTerrainSharedMaterial

SgtTerrainSimplex

SgtTerrainSine

SgtTerrainTopology

SgtTerrainUnderwater

SgtThruster

SgtThrusterControls

SgtThrusterRoll

SgtThrusterScale