Space Graphics Toolkit

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 Accretion folder contains components and shaders allowing you to add animated accretion discs to your scene.



Packs

Pack folders contain mostly media and example scenes for a group of SGT features. For example, the Alien Worlds Pack contains a selection of alien planet textures, materials, and demo scenes.

NOTE  If you've purchased the Planet Pack, then you can read its READ ME in the Space Graphics Toolkit/Packs/Planet Pack folder.



Required Packages

NOTE  Space Graphics Toolkit requires the Burst, Mathematics, and Collections packages.

To install them, open the Package Manager window.

Then find the Burst package, and click Install.

Installing the Burst package alone should automatically install both Mathematics and Collections, so you should now be done.



How do I upgrade?

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.



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


[FREE] Star Pack

This pack contains a variety of stars, nebulae, and galaxies.

You can download it from HERE.

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


[PAID] Planet Pack

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.



Why does each feature require so many components?

Many SGT features are rendered using a combination of components. For example, the Accretion feature (animated accretion disc) is rendered using the SgtAccretion, SgtAccretionMesh, and SgtAccretionNearTex 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 click the context menu button (gear icon) at the top right of these components, you'll notice you have the option to Export Mesh, Export Texture, or similar. For example, the SgtAccretionMesh component's context menu has the Export Mesh option. This allows you to save the generated accretion disc mesh as an asset, so you can now remove this component, and drag and drop your saved mesh into the SgtAccretion component's Mesh setting.

Doing this allows you to improve performance of your scene, because the SgtAccretionMesh component no longer has to generate a new mesh each time you add an accretion disc to your scene. The downside of course is that you can no longer adjust the mesh settings, so it may not be suitable for your project if you need to be able to control the generation settings in game.

For more information about which components can export what meshes/textures/etc, look at the documentation specific to the feature you're interested in.



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.

The biggest difference is that editing an inspector setting will automatically update the component state, whereas doing this from code won't. This is because the settings are fields, and so the component doesn't know the value changed.

It would be possible to automatically update the components using a property, but I didn't want to introduce performance issues if you need to update many settings at the same time, or increase complexity of the code using some kind of dirty marking system.

Therefore, to change component settings and update them, you can either:

Method 1 Call the SetXXX method that automatically updates the component state. For example, the SgtAtmosphere component has the SetColor method, which can be used instead of setting the Color field directly. Keep in mind that this instantly updates the component, so you shouldn't use multiple Set methods in a row.
Method 2 Call the UpdateXXX method after you update the fields. For example, the SgtAtmosphere has the UpdateMaterials method, which you can call after updating fields that depend on the material state. To find which Update method you need to call to update a specific field, you can look at the inspector code at the top of the source file for the component, or see the Set method code associated with the field.


Are scriptable render pipelines (SRP) supported?

LWRP/URP is fully supported, and HDRP is mostly supported (currently being worked on).

After you've enabled a scriptable rendering pipeline in your Graphics settings:

STEP 1  Go to to the Space Graphics Toolkit folder.
STEP 2  Select the PIPELINE asset.
STEP 3  Click the Switch To Scriptable Pipeline button.
DONE  SGT has now been converted to use SRP.

If you decide to go back to the standard rendering pipeline, then you can click the Switch To Standard Pipeline button.

NOTE  If you want to use LWRP/URP with the SgtSingulairty feature (black holes), then you must enable the Opaque Texture setting in your pipeline settings asset.
NOTE  LWRP/URP in Unity 2018.4 doesn't provide a callback for when a camera finishes rendering, so some effects may not behave as expected. This issue has been resolved in Unity 2019.1 and beyond.
NOTE  HDRP camera rendering conflicts with the Scene window camera. To solve most issues you can enable the Game window's Maximize On Play setting, or otherwise hide the Scene window while playing.


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 compatibility in mind, and have been heavily optimized to run on almost any device and platform, while still giving impressive visual results.

The only heavy feature that should be used with care is the SgtDynamicPlanet component, because it can quickly generate a lot of triangles. This component has many settings to reduce triangle count for lower end decides though.



Accretion

The Accretion feature allows you to create accretion discs. An accretion disc is a swirling vortex of matter falling toward a massive body like a star, or black hole.


Making an Accretion Disc

Begin by right clicking in your Hierarchy tab, and selecting: Space Graphics Toolkit > Accretion

Or from the menu bar: GameObject > Space Graphics Toolkit > Accretion

Your scene should now contain a new selected GameObject called Accretion, with the SgtAccretion component attached.

If you click the Add Mesh button, the SgtAccretionMesh component will be added, and this will automatically generate the SgtAccretion.Mesh setting for you.

Next, you need to set the SgtAccretion.MainTex setting. The accretion example media comes with the Accretion_Main texture, which you can use here. This should be a vertically seamless texture, where the left edge is the inner edge of the disc.

You now have a very basic accretion disc.

NOTE  The accretion disc is split into multiple segments (default = 8). This allows it to correctly depth sort against objects you want to place in the center (e.g. a planet). If it were a single GameObject then it wouldn't work in such a scenario, you can test this by setting the SgtAccretion.Segments and SgtAccretionMesh.Segments setting to 1, and you will see it renders incorrectly in some scenarios with an object placed in the center.


Adding Detail

If you want matter to fall into the accretion disc, you need to enable the SgtAccretion.Detail setting. You can now set the SgtAccretion.DetailTex setting. The Accretion_Detail texture that comes with SGT can be used here.

NOTE  This should be a seamless texture that tiles on both the X and Y axis.

To make it fall into the disc you need to set the SgtAccretion.DetailSpeed setting (e.g. 1,1).

To make the matter fall in non-linearly, you can adjust the SgtAccretion.DetailTwist setting (e.g. 2).

To make the matter slow its rotation as it approaches the inner edge, you can adjust the SgtAccretion.DetailTwistBias setting (e.g. 1.5).



My Disc Segments Clip Through Objects in the Center?

While the segment splitting improves depth sorting against objects in the center, it won't always fix it 100%.

To improve this you can try increasing the SgtAccretionMesh.BoundsShift setting, or increasing the Segments setting in both components.




Atmosphere

The Atmosphere feature allows you to add a volumetric atmosphere above a planet's surface.


Adding an Atmosphere

An atmosphere can be added on top of a normal sphere to give it a nice volumetric haze.

Begin by right clicking in your Hierarchy tab and selecting: Space Graphics Toolkit > Atmosphere

Or from the menu bar: GameObject > Space Graphics Toolkit > Atmosphere

NOTE  If you want to add this on top of an existing sphere/planet, then right click your object, or select it before using the menu.

Your scene should now contain a new selected GameObject called Atmosphere with the SgtAtmosphere component.

You should now see a lot of settings marked in red, and three buttons at the bottom. If you click these three buttons then the atmosphere will be set up with default settings, and you should see it in the scene. If you don't see anything, you may need to adjust the SgtAtmosphere.Heightsetting, or add your planet renderers to the SgtSharedMaterial.Renderers list.



Adding Lighting

Atmospheres aren't lit by default, to enable this tick the SgtAtmosphere.Lit setting. You can then click the Add LightingTex button to add the SgtAtmosphereLightingTex component.

If your atmosphere turned completely black, then you probably don't have any SGT lights in your scene. To add one, select your light GameObject (e.g. point light), and add the SgtLight component.

Your atmosphere should now automatically detect this and receive lighting.



Adding Atmospheric Scattering

Tick the SgtAtmosphere.Scattering setting, and click the Add ScatteringTex button. Your atmosphere should now have atmospheric scattering.

To see the atmospheric scattering, move your camera into the atmosphere, and look toward your light source.

You can now adjust its settings like SgtAtmosphere.ScatteringMie, which adjust the light halo size/sharpness.

You can also adjust the SgtAtmosphere.ScatteringRayleigh setting, which adjusts the front and back light scattering brightness.

If you want to adjust the color of the scattering, especially near sunrise/sunset, then you can adjust them in the SgtAtmosphereScatteringTex component. The SgtAtmosphereScatteringTex.SunsetSharpnessR/G/B settings controls that color change. You can also control when the

color transition begins and ends using the SgtAtmosphereScatteringTex.SunsetStart/End sliders.



Atmosphere Thickness

In real life, planet atmospheres are very thin relative to the size of the planet. To make the scenes look more interesting in SGT I made the planet atmospheres much thicker. However, if you make them too thin then the atmosphere may not look so impressive up close, because your planets probably aren't going to be so big. If you want the best of both worlds then you can use the SgtAtmosphereHeight component.

This component will adjust the SgtAtmosphere.Height setting based on the distance between the camera and your planet, allowing you to have thin and realistic atmospheres from a distance, and thicker more interesting looking ones up close.



Lighting Tex

The SgtAtmosphereLightingTex component allows you to control the color of the atmosphere based on the angle of the light, and control the sunset/sunrise colors. Keep in mind that the SunsetStart/End values should be chosen with consideration to the size of your atmosphere. If your atmosphere is very thick, then it's likely the sunset point will be pushed back quite far, and be spread over a large range. Whereas if your atmosphere is thin, then the sunset period is likely to be quite short.



Scattering Tex

The SgtAtmosphereScatteringTex component allows you to specify how far into sunset the light scattering appears, and its colors. Keep in mind that setting the SunsetStart too early means you will see sunlight scattering through your planet, so make sure you test it in your game so it looks good and fades out at the right time.



Other Objects/Renderers

By default, the SgtAtmosphere component only applies atmospheric fog to the planet surface. If you have objects on the surface of your planet then they will not receive any fog. This usually isn't an issue for planet objects that are near the camera (e.g. player spaceship), but if you need to place an object on your planet and move far away, then you probably want fog to be applied to it. To do this, simply drag and drop the MeshRenderer you want into the SgtSharedMaterial.Renderers list attached to your SgtAtmosphere GameObject.




Aurora

The Aurora feature allows you to add a animated aurora ribbons above a planet's surface.


Making an Aurora

Begin by right clicking in your Hierarchy and selecting: Space Graphics Toolkit > Aurora

Or from the menu bar: GameObject > Space Graphics Toolkit > Aurora

NOTE  If you want to add this on top of an existing GameObject (e.g. your planet), then right click your object, or select it before using the menu.

Your scene should now contain a new selected GameObject called Aurora with the SgtAurora component.

Next, you can click the the "Add MainTex" button. This will add the SgtAuroraMainTex component to your Aurora GameObject.

NOTE  There are many settings in these components, and it's not always easy to explain what they do. To understand what they do I recommend you read the individual documentation for each setting (or read the tooltips), and then adjust it to see what visual change it makes. This is easiest to do if you open the aurora feature example scenes.



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.


Making a Backdrop

Begin by right clicking in your Hierarchy and selecting: Space Graphics Toolkit > Backdrop

Or from the menu bar selecting: GameObject > Space Graphics Toolkit > Backdrop

NOTE  If you want to add this on top of an existing GameObject, then right click your object, or select it before using the menu.

Your scene should now contain a new selected GameObject called Backdrop with the SgtBackdrop component.

Next, you need to set the SgtBackdrop.MainTex setting. This can be any texture, or atlas of textures.

NOTE  This effect uses additive blending, so your texture background should be black with no transparency.


Power RGB

This setting can be used with stars. This retains the bright white color in the center, and allows you to tint only the edges with the star color.



Clamp Size

When billboards get too small they tend to flicker, which looks bad. The SgtBackdrop.ClampSize setting can be used to avoid this by limiting the size, and any billboards falling under this size will be faded proportional to the size they would otherwise have been.




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.


Making a Belt

Begin by right clicking in your Hierarchy and selecting: Space Graphics Toolkit > Belt Simple

Or from the menu bar: GameObject > Space Graphics Toolkit > Belt Simple

NOTE  If you want to add this on top of an existing GameObject (e.g. your planet), then right click your object, or select it before using the menu.

Your scene should now contain a new selected GameObject called "Belt Simple" with the SgtBeltSimple component.

NOTE  There are many settings in this component. To understand what they do I recommend you read the individual documentation for each setting (or read the tooltips), and then adjust it to see what visual change it makes. This is easiest to do if you open the belt example scenes.



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.


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\Basic Toolkit\Textures\Baked Flare A 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.



Sprite Billboard Flares

Step 3 - 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, follow step 1 again, but this time drag and drop the sprite onto the sprite GameObject you created earlier. This will add a new sprite

as a child of your existing sprite.

Similar to step 2, you 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, begin by changing the Layer of all your billboard GameObjects to Ignore Raycast.

Next, right click your Hierarchy window and select Space Graphics Toolkit > Depth Camera, your scene should now have a Depth Camera GameObject.

Next, add the SgtDepthScale component to your second billboard layer. This component will use the Depth Camera you added earlier to

calculate how much it should shrink the current GameObject based on the optical thickness (occlusion) between the camera, and the light flare.

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.

If not, try adjusting the SgtDepthCamera component's Size setting. This value is in world space and should correspond to your scene scale.

You can also examine the Sprite Billboard Flare demo scenes to see how they're setup.




Cloudsphere

The Cloudsphere feature allows you to add a layer of clouds around your planets.

To understand how this works, I recommend you check out the demo scenes inside the Features/Cloudsphere folder.



Corona

The Corona feature allows you to add a volumetric atmosphere above a star's surface.


Step 1 - Make a Sphere

You can use a basic Unity sphere for this. For example, right click in the Hierarchy window, and select 3D Object > Sphere, and your scene will have a new Sphere GameObject.

If you want an even rounder sphere, I recommend you use the Geosphere40 mesh that comes with SGT. Keep in mind the SGT sphere has a radius of 1.0 unit, whereas the default Unity one has a radius of 0.5, so your collider settings may need updating.



Step 2 - Add a Corona

Right click your Sphere GameObject in the Hierarchy window, and select Space Graphics Toolkit > Corona, your sphere will now have the

Corona GameObject added as a child, with the SgtAtmosphere and SgtSharedMaterial components.



Step 3 - Set up the Corona

At the bottom of the SgtCorona component in the Inspector window, you will see 3 buttons. If you click these, then your corona will automatically be set up using basic values.

The first button adds the SgtCoronaDepthTex component, which will automatically generate the Inner Depth Tex and Outer Depth Tex settings for your SgtCorona.

The second button sets the Outer Mesh to use the Geosphere40 mesh, as well as calculate the Outer Mesh Radius.

The third button adds your basic sphere from step 1 into the SgtSharedMaterial.Renderers list, and calculates the Inner Mesh Radius field.

This renderers list lets the SgtCorona know which renderers you want the corona material to be applied to.



Step 4 - Done

You now have a basic corona with a fully volumetric atmosphere, so your camera can seamlessly travel from space to the surface.

I recommend you now experiment with all the corona settings to understand what they alter. If you're unsure what a particular setting does, then hover your mouse over the field to see a tooltip, or read the associated documentation file.

NOTE  If you're using the floating origin system then you also need to add the SgtFloatingPoint and SgtFloatingObject components.


Optional Step - Adding Prominences

A sphere with a corona looks nice, but to make it look more interesting you can add prominences around it to make the corona look less regular.

To add one, right click your Sphere GameObject in the Hierarchy window, and select Space Graphics Toolkit > Prominence, your sphere will now have the Prominence GameObject added as a child, with the SgtProminence component.

You can set the Main Tex setting of the SgtProminence component to the Prominence texture that comes with SGT, and adjust the RadiusMin/Max settings.



Optional Step - Procedurally Animated Surface

If you want the surface of your star to be procedurally animated, then you can use one of the materials in the Star Pack/Materials folder/directory. If you want to customize the material then I recommend you duplicate one of these materials first.

To use it, simply find the MeshRenderer component in the inspector window for your Sphere GameObject, expand the Materials array, and

drag and drop your new material over the Element 0 slot.




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.


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 that can be combined with the Billboard feature. These flares are generated 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.

Most of the SGT demo scenes have impressive looking star billboards that use the Sprite Renderer component with a large texture. You can

replace these by deleting the Sprite Renderer component, and following the steps below to replace it.


Step 1 - Add a Flare

Right click in the Hierarchy window and select Space Graphics Toolkit > Flare, you should now see a Flare GameObject with the SgtFlare component attached.



Step 2 - Set up the Flare

At the bottom of the SgtFlare component in the Inspector window, you will see two buttons. If you click these then your flare will be set up with basic values.

The first button adds the SgtFareMesh component, which generates the SgtFlare component's Mesh setting.

The second button adds the SgtFareMaterial component, which generates the SgtFlare component's Material setting.



Step 3 - Done!

You now have a basic flare that uses very little texture memory.

To make it look more impressive you can enable the Wave and/or Noise setting in the SgtFlareMesh component. I recommend you

experiment with all of these settings until you get a visual result you're happy with.



Optional Step - Make it a Billboard

By default the flare will remain static and flat. To make it look better it needs to rotate toward the camera to become a billboard. To do this, you can add the SgtBillboard component on the Flare GameObject.

If your flare is very large or your camera gets very close to the flare then I recommend you enable the Avoid Clipping setting.

NOTE  If your scene has many billboards then I recommend you replace the SgtBillboard with SgtFastBillboard, and add a SgtFastBillboardManager to your scene.


Optional Step - Make it Render In Front

By default the flare will render like a normal transparent object, but to make it look really bright it should render in front of everything. To do this, change the Z Test setting to Always, and change the Render Queue setting to Overlay (4000).

If you do this then I recommend you also use the SgtDepthScale component combined with SgtDepthCamera, and set the flare's layer to Ignore Raycast. You can read the Camera Depth Flares tutorial inside the Bonus Pack for more information.




Jovian

The Jovian feature allows you to create volumetric gas giant planets.


Step 1 - Add a Jovian

Right click in your Hierarchy window, and select Space Graphics Toolkit > Jovian, and you should see a new Jovian GameObject in your scene with the SgtJovian component attached.



Step 2 - Set Up The Jovian

At the bottom of the SgtJovian component, you can see the the Add DepthTex button, if you click this then the SgtJovianDepthTex component will be added. This component generates the DepthTex setting for you.

If you click the Set Mesh & MeshRadius button, then the Mesh setting will be set to the Geosphere40 mesh, and the MeshRadius setting will be calculated based on this mesh.

You then have to specify the MainTex setting, which should be a cubemap of your gas giant surface texture. You can generate cube maps from normal cylindrical (equirectangular) textures from the texture input settings in the inspector.



Step 3 - Done!

You now have a basic gas giant. The gas giant atmosphere is fully volumetric, so your camera can seamlessly travel from space through the atmosphere.

I recommend you now experiment with all the jovian settings to understand what they alter. If you're unsure what a particular setting does, then hover your mouse over the field to see a tooltip, or read the associated documentation file.

NOTE  If you're using the floating origin system then you also need to add the SgtFloatingPoint and SgtFloatingObject components.


Optional Step - Adding Lighting

To add lighting to your gas giant, first enable the Lit setting, and then click the Add LightingTex button.

Next, you need to let the jovian know which lights you want to use. To do this, add the SgtLight component to your main scene light (By default this will be the Directional Light GameObject).

NOTE  Adding lighting means the nearest shadow will also be received by the gas giant.


Optional Step - Casting Shadows

If you want this planet to cast shadows using the SGT shadow system (e.g. so it can cast on rings), then add the SgtShadowSphere component alongside the SgtJovian component.

To make the shadows look correct the Radius Min/Max values should be similar to the SgtJovian component's Radius setting.




Lightning

The Lightning feature allows you to add an animated lightning effect to your planet. The lightning is procedurally spawned around the planet, and the animation is defined by the texture, giving you very high performance.

To understand how this works, I recommend you check out the demo scenes inside the Features/Lightning folder.



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 SgtStaticPlanet component allows you to quickly make planets that look good at medium to far distances. These planets are based on a single mesh, and can be deformed using a heightmap to make them look more interesting.

The SgtDynamicPlanet component allows you to make planets that look good from space all the way down to the surface. These planets are based on a dynamic mesh that increases in detail based on camera distance.

NOTE  This feature is only available in the full Space Graphics Toolkit asset.
NOTE  If your planets are large (e.g. more than 1km radius), then you should integrate the floating origin system (Universe feature) into your scene, otherwise you will get floating precision issues that cause the rendering to break down.

SGT 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/SGT Planet shader.

NOTE  Due to Shader Graph limitations, the night light feature of this shader only works with the standard render pipeline.

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

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 Map

This is the normal map. This should match the albedo mapping.

Normal Map Scale

This allows you to dampen or strengthen the normal map effect.

Height (A)

This is the height map, where the height is stored in the alpha channel.

NOTE  The RGB channels of this texture aren't used by this shader, but they can be used as splat maps for object placement, heightmap detail during mesh generation, etc.

Night Lights (RGB)

This is the emissive texture for the planet's dark side. This should match the albedo mapping.

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.

Detail Mask (RG)

This allows you to control where the detail textures are applied, where the red channel is detail map A, the green channel is detail map B, and

the blue channel is the transition to the planet poles. This should match the albedo mapping.

Detail Tiling

This allows you control the amount of times the detail textures are tiled along the surface.

Detail Map A

This allows you to set the first detail normal map.

Detail Scale A

The allows you to reduce or increase the normal map strength.

Detail Map B

This allows you to set the second detail normal map.

Detail Scale B

The allows you to reduce or increase the normal map strength.

Water Level

This allows you to control the water level, where 0 is no water, and 1 is full water. You can set this higher than 1 because water is transparent and a value of 1 may still reveal some land.

Water Tiling

This allows you to set the amount of times the water normal map is tiled around the planet.

Water Color

This allows you set the water color lookup table texture, where the left side is used along the shore, and the right side is used in the deep ocean.

Water Color Scale

This allows you to set how quickly the water color texture goes to the deep ocean color on the right side.

Water Normal Map

This allows you to set the normal used by the water.

Water Normal Scale

The allows you to reduce or increase the normal map strength.

Water Distortion

This allows you to control how much the water normal is deformed over time. This is used to make the water surface look active and have waves.

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.

Coast Detail Map (A)

This allows you to apply a detail texture to the coastline of the water using the texture alpha channel.

Coast Detail Scale

This allows you to set the strength of the coastline detail map influence.

Coast Sharpness

This allows you to set how quickly the water hides the underwater terrain.



Static Planet

The SgtStaticPlanet component can be used to combine a Mesh and Material, and render them out as a planet.

While it's possible to do this manually with a MeshFilter and MeshRenderer components, this component also adds additional UV data to the mesh so it can seamlessly tile detail textures around the surface without polar distortion.

NOTE  The material should use the SGT Planet shader, otherwise the WaterLevel setting will not work properly.
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.



Dynamic Planet

The SgtDynamicPlanet component can be used to render a Material on a dynamically generated mesh that increases in detail based on the camera position.

NOTE  The material should use the SGT Planet shader, otherwise the WaterLevel setting will not work properly.
NOTE  This component bakes the water level into the mesh, so changing it requires the whole planet mesh to be regenerated.

The SgtDynamicPlanetObject component can be used to snap a Transform to the planet surface.

The SgtDynamicPlanetDetail component can be used to enhance the heightmap data with procedural noise when you get closer to the surface.

The SgtDynamicPlanetCollider component can be used to add MeshColliders to the planet as you get closer.

The SgtDynamicPlanetSpawner component can be used to spawn prefabs to the planet as you get closer.

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




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.

To understand how this works, I recommend you check out the demo scenes inside the Features/Prominence folder.



Ring

The Ring feature allows you to add high detail planetary rings to your planets.


Step 1 - Make Your Planet

This step is optional, but I recommend you first make a planet to put the ring around by following the Making a Terrestrial Planet or Making a Gas Giant tutorials.



Step 2 - Add a Ring

Right click your planet GameObject in the Hierarchy window (or just right click if you don't have one), and select Space Graphics Toolkit > Ring, you should now see a Ring GameObject with the SgtRing component attached.



Step 3 - Set up the Ring

At the bottom of the SgtRing component in the inspector window, you will see the Add Mesh button, clicking this will add the SgtRingMesh component.

You should now see a ring in your Scene or Game window. Feel free to adjust the Radius Min/Max values of this new component to adjust the visual size until it looks good.

Next, you need to set the Main Tex setting to a texture of your ring. This should be a transparent texture.

NOTE  If your ring texture doesn't have transparency, then you can add the SgtRingMainTexFilter component, which will generate a transparent Main Tex for you based on a normal RGB ring texture. This is very useful if you need to make a transparent ring from space

pictures of rings (e.g. Saturn) that don't have transparency.



Step 4 - Done!

You should now have a basic ring.



Optional Step - Adding Lighting

To add lighting to your ring, first enable the Lit setting, and then click the Add LightingTex button.

Next, you need to let the ring know which lights you want to use. To do this, add the SgtLight component to your main scene light (By default this will be the Directional Light GameObject).

NOTE  Adding lighting means the nearest shadow will also be received by the ring.


Optional Step - Casting Shadows

If you want this ring to cast shadows using the SGT shadow system (e.g. so it can cast on planets), then add the SgtShadowRing component to the same GameObject as the SgtRing component.

To make the shadows look correct the Radius Min/Max values should be similar to the SgtRingMesh component's Radius Min/Max settings.




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 implementated in two ways, using the the SgtSingularity, and the SgtLens components.

The main difference between these two implementations is that SgtLens can give you more accurate results, 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). Since the cubemap is baked for rendering, it also means the subemap 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 SgtSingularity instead.


Singularity

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 LWRP/URP, then you must go to your LightweightRenderPipelineAsset settings, and enable General > Opaque Texture.


Lens

The SgtLens component is a world space (cubemap) effect, which means it's slow to update, but it can rener 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.


Step 1 - Make a Spacetime

Right click in your Hierarchy window, and select Space Graphics Toolkit > Spacetime, and you should see a new Spacetime GameObject in your scene with the SgtSpacetime and SgtSharedMaterial components attached.

You can now set the Main Tex setting in the SgtSpacetime component to the Grid texture that comes with SGT.



Step 2 - Make a Grid

For the spacetime effect to render, you need to make a grid that it will be displayed on. You can use Unity's built-in Plane for this by right clicking in the Hierarchy window, and selecting 3D Object > Plane, and your scene will have a new Plane GameObject. If you want a higher detail plane with a more sensible size (+- 1 unit), then you can use the Plane100 mesh that comes with SGT.

You can use as many GameObjects as you like to render the effect. Also keep in mind they don't have to be flat planes, you can use a sphere or box or anything you like, as long as it has enough vertices to deform correctly.



Step 3 - Remove Grid Renderers

The spacetime effect works by adding a new material to your grid renderers, so unless you really want a second material, I recommend you remove any materials used by your grid. To do this, find the MeshRenderer component on each of your grid GameObjects, expand the Materials array, and set the Size setting to 0 and press Enter on your keyboard.



Step 4 - Link Grid Renderers

Now that you have removed all grid renderer materials, it's time to add the spacetime one. To do this, find the SgtSharedMaterial component on your Spacetime GameObject, find the Renderers setting, and drag and drop each of your grid GameObjects from the Hierarchy window to this list. If you do it correctly, it should display an add [+] icon, and automatically add them to the list. Do this for all your grid GameObjects.



Step 5 - Add Wells

To make the spacetime effect display curvature, you need to add gravitational wells. To do this, right click in your Hierarchy window, and select Space Graphics Toolkit > Spacetime Well, and you should see a new Spacetime Well GameObject in your scene with the SgtSpacetimeWell component attached.

You should now see your spacetime deform. If not, adjust the position to ensure it's on or near the grid, or try adjust the Radius setting so it's large enough.



Step 6 - 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.




Star

The Star feature includes a star surface shader that renders with procedural animation, giving you full control over its visuals to make any kind of star surface you like.

To make your own, simply make a new Material with the Space Graphics Toolkit/Star shader, and adjust the settings as you like.

NOTE  I recommend you keep the NoiseTex and Noise Step settings as they are.

Feel free to experiment with the other settings to see what visual changes is makes. You can always look at the example star materials to get some ideas.



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.

To understand how these work, I recommend you look at the demo scenes inside the Features/Starfield folder.



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.


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 implement a floating origin system into your scene.


What is a Floating Origin System?

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 this floating origin system, 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 with a floating origin system, 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 this floating origin system 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.








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


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!


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.


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.


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 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 GUI Shapes

Lean GUI Shapes

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


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!


Planet Pack - Space Graphics Toolkit

Planet Pack - Space Graphics Toolkit

This pack contains 26 high detail PBR planets, all finished using the powerful planet features of Space Graphics Toolkit (SGT). This is a standalone package, so SGT is not required. You can even use the included features to turn your own planets into beautiful worlds!


Lean Touch+

Lean Touch+

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


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

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.
Added Starfield/Infinite Floating Origin 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 floating origin support to SgtStarfieldInfinite.
Added SgtCamera.UseOrigin setting for floating origin compatibility.
Added SgtStarfield.StretchLimit to improve warp effects at high speed.







Components

SgtAccretion

This component allows you to render an accretion disc. This disc can be animated to spiral dust into the center. This disc can be split into multiple segments to improve depth sorting.


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the disc material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



Texture
MainTex

The texture applied to the disc, where the left side is the inside, and the right side is the outside.



Mesh
Mesh

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



int
Segments

This allows you to set how many copies of the Mesh are required to complete the disc. For example, if the Mesh is 1/4 of the disc, then Segments should be set to 4.



bool
Detail

Should the disc have a detail texture? For example, dust noise when you get close.



Texture
DetailTex

This allows you to set the detail texture that gets repeated on the disc surface.



float
DetailScaleX

The detail texture horizontal tiling.



int
DetailScaleY

The detail texture vertical tiling.



Vector2
DetailOffset

The UV offset of the detail texture.



Vector2
DetailSpeed

The scroll speed of the detail texture UV offset.



float
DetailTwist

The amount the detail texture is twisted around the disc.



float
DetailTwistBias

The amount the twisting is pushed to the outer edge.



bool
Near

Enable this if you want the disc to fade out as the camera approaches.



Texture
NearTex

The lookup table used to calculate the fade opacity based on distance, where the left side is used when the camera is close, and the right side is used when the camera is far.



float
NearDistance

The world space distance the fade will begin from.




SgtAccretionMesh

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


int
Segments

The amount of segments the final disc will be comprised of.



int
SegmentDetail

The amount of triangle edges along the inner and outer edges of each segment.



int
SegmentTiling

The amount of times the main texture is tiled around the ring segment.



float
RadiusMin

The radius of the inner edge in local space.



float
RadiusMax

The radius of the outer edge in local space.



int
RadiusDetail

The amount of edge loops around the generated disc. If you have a very large ring then you can end up with very skinny triangles, so increasing this can give them a better shape.



float
BoundsShift

The amount the mesh bounds should get pushed out by in local space. This should be used with 8+ Segments.



void
ExportMesh

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

Once done, you can remove this component, and set the SgtAccretion component's Mesh setting using the exported asset.




SgtAccretionModel

This component is used to render a segment of the accretion disc.


SgtAccretion
Accretion

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




SgtAccretionNearTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.



void
ExportTexture

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

Once done, you can remove this component, and set the SgtAccretion component's NearTex setting using the exported asset.




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.


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the atmosphere materials. You can normally adjust the render queue in the material settings, but since these materials are procedurally generated your changes will be lost.



Texture
InnerDepthTex

The look up table associating optical depth with atmospheric color for the planet surface. The left side is used when the atmosphere is thin (e.g. center of the planet when looking from space). The right side is used when the atmosphere is thick (e.g. the horizon).



float
InnerMeshRadius

The radius of the meshes set in the SgtSharedMaterial.



Texture2D
OuterDepthTex

The look up table associating optical depth with atmospheric color for the planet sky. The left side is used when the atmosphere is thin (e.g. edge of the atmosphere when looking from space). The right side is used when the atmosphere is thick (e.g. the horizon).



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 thick the atmosphere is when the camera is inside its radius.



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.



bool
Lit

If you enable this then nearby SgtLight and SgtShadow casters will be found and applied to the lighting calculations.



Color
AmbientColor

The atmosphere will always be lit by this amount.



Texture
LightingTex

The look up table associating light angle with surface color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



bool
Scattering

If you enable this then light will scatter through the atmosphere. This means light entering the eye will come from all angles, especially around the light point.



bool
GroundScattering

If you enable this then atmospheric scattering will be applied to the surface material.



Texture
ScatteringTex

The look up table associating light angle with scattering color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



float
ScatteringStrength

The scattering is multiplied by this value, allowing you to easily adjust the brightness of the effect.



float
ScatteringMie

The mie scattering term, allowing you to adjust the distribution of front scattered light.



float
ScatteringRayleigh

The mie rayleigh term, allowing you to adjust the distribution of front and back scattered light.



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.


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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 outer shell of an atmosphere.


SgtAtmosphere
Atmosphere

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




SgtAtmosphereOuterMesh

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


int
Rings

The amount of rings in the generated mesh.



int
Detail

The amount of edges around each ring in the mesh.



void
ExportMesh

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

Once done, you can remove this component, and set the SgtAtmosphere component's OuterMesh setting using the exported asset.




SgtAtmospherePointer

This component points the current atmosphere to the rendering camera, allowing you to keep the atmosphere vertex density high near the camera. This should be used with the SgtAtmosphereOuterMesh component, or an exported mesh from it.



SgtAtmosphereScatteringTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.




SgtAurora

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


Texture
MainTex

The base texture tiled along the aurora.



Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the aurora material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



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.



bool
Near

Should the aurora fade out when the camera gets near?



Texture
NearTex

The lookup table used to calculate the fading amount based on the distance, where the left side is used when the camera is near, and the right side is used when the camera is far.



float
NearDistance

The distance the fading begins from in world space.



bool
Anim

Should the aurora paths animate?



float
AnimOffset

The current age/offset of the animation.



float
AnimSpeed

The speed of the animation.



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.


int
Width

The width of the generated texture. A higher value can result in a smoother transition. This stores the noise samples.



int
Height

The height of the generated texture. A higher value can result in a smoother transition. This stores the vertical color samples.



TextureFormat
Format

The format of the generated texture.



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 a group of aurora paths.


SgtAurora
Aurora

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




SgtAuroraNearTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



SgtEase.Type
Ease

The ease type used for the transition.



float
Sharpness

The sharpness of the 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 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.


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.



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



bool
PowerRgb

Instead of just tinting the stars with the colors, should the RGB values be raised to the power of the color?



bool
ClampSize

Prevent the quads from being too small on screen?



float
ClampSizeMin

The minimum size each star can be on screen in pixels. If the star goes below this size, it loses opacity proportional to the amount it would have gone under.




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 asteroid texture.



Color
Color

Color tint of this star.



float
Radius

Radius of this star in local space.



float
Angle

Angle of this star in degrees.



Vector3
Position

Position of the star in local space.




SgtBelt

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


float
OrbitOffset

The amount of seconds this belt has been animating for.



float
OrbitSpeed

The animation speed of this belt.



bool
Lit

If you enable this then nearby SgtLight and SgtShadow casters will be found and applied to the lighting calculations.



Texture
LightingTex

The look up table associating light angle with surface color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



Color
AmbientColor

The belt will always be lit by this amount.



bool
PowerRgb

Instead of just tinting the asteroids with the colors, should the RGB values be raised to the power of the color?




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

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


List<SgtBeltAsteroid>
Asteroids

The custom asteroids in this belt.




SgtBeltLightingTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.




SgtBeltSimple

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.



private Gradient
asteroidColors

Each asteroid is given a random color from this gradient.



float
AsteroidSpin

The maximum amount of angular velcoity 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.

NOTE  If you're using the floating origin system then you should use the SgtFloatingBillboard component instead.

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.




SgtDepth

This is the base class for depth calculations, allowing you to find how opaque the view is between two points.


LayerMask
Layers

The layers that will be sampled when calculating the optical depth.



SgtEase.Type
Ease

The transition style between 0..1 depth.




SgtDepthCamera

This component calculates depth based on camera optical depth. This can be used by the SgtFlare to adjust size.


int
Resolution

The width & height of the camera RenderTexture in pixels.



float
Size

The width & height of the camera viewport in world space.




SgtDepthRaycast

This component calculates depth based on raycast depth. This can be used by the SgtFlare to adjust size.


float
MaxThickness

For the depth to return 1, the raycast must go through an object with this thickness in world space.




SgtDepthScale

This component allows you to scale the current GameObject based on optical thickness between the current camera and the current position.


Vector3
MaxScale

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




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.




SgtFastBillboardManager

All SgtFastBillboards will be updated from here.



SgtCloudsphere

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


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the cloudsphere material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



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.



Cubemap
MainTex

The cube map applied to the cloudsphere surface.



Texture2D
DepthTex

The look up table associating optical depth with cloud color. The left side is used when the depth is thin (e.g. edge of the cloudsphere when looking from space). The right side is used when the depth is thick (e.g. center of the cloudsphere when looking from space).



float
Softness

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



bool
Lit

If you enable this then nearby SgtLight and SgtShadow casters will be found and applied to the lighting calculations.



Texture
LightingTex

The look up table associating light angle with surface color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



Color
AmbientColor

The cloudsphere will always be lit by this amount.



bool
Near

Enable this if you want the cloudsphere to fade out as the camera approaches.



Texture
NearTex

The lookup table used to calculate the fade opacity based on distance, where the left side is used when the camera is close, and the right side is used when the camera is far.



float
NearDistance

The distance the fading begins from in world space.



bool
Detail

Enable this if you want the cloud edges to be enhanced with more detail.



Texture
DetailTex

This allows you to set the detail map texture, the detail should be stored in the alpha channel.



float
DetailScale

This allows you to set how many times the detail texture is repeating along the cloud surface.



float
DetailTiling

This allows you to set how many times the detail texture is repeating along the cloud surface.



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 SgtCloudsphere.DepthTex field.


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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 SgtCloudsphere.LightingTex field.


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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 renders the outer shell of a cloudsphere.


SgtCloudsphere
Cloudsphere

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




SgtCloudsphereNearTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.



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.




SgtCorona

This component allows you to draw a volumetric corona around a sphere.


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the corona materials. You can normally adjust the render queue in the material settings, but since these materials are procedurally generated your changes will be lost.



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 corona, giving you fine control over the render order.



Texture
InnerDepthTex

The look up table associating optical depth with coronal color for the star surface. The left side is used when the corona is thin (e.g. center of the star when looking from space). The right side is used when the corona is thick (e.g. the horizon).



float
InnerMeshRadius

The radius of the inner renderers (surface) in local coordinates.



Texture2D
OuterDepthTex

The look up table associating optical depth with coronal color for the star sky. The left side is used when the corona is thin (e.g. edge of the corona when looking from space). The right side is used when the corona is thick (e.g. the horizon).



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 corona will render incorrectly.



float
OuterSoftness

Should the outer corona fade out against intersecting geometry?



float
Height

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



float
InnerFog

If you want an extra-thin or extra-thick density, you can adjust that here (0 = default).



float
OuterFog

If you want an extra-thin or extra-thick density, you can adjust that here (0 = default).



float
Sky

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




SgtCoronaDepthTex

This component generates the SgtCorona.InnerDepthTex and SgtCorona.OuterDepthTex textures.


int
Width

The resolution of the surface/space optical thickness transition in pixels.



TextureFormat
Format

The format of the generated texture.



Color
HorizonColor

The horizon color for both textures.



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 SgtCorona component's InnerDepthTex 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 SgtCorona component's OuterDepthTex setting using the exported asset.




SgtCoronaModel

This component renders the outser shell of a corona.


SgtCorona
Corona

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




SgtDebris

This component handles a single debris object.


System.Action
OnSpawn

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



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 (e.g. MainCamera).



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 decreated 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 debis 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.




SgtFlare

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


Mesh
Mesh

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



Material
Material

The material used to render this 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.




SgtFlareMaterial

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


ZTestState
ZTest

The ZTest mode of the material (LEqual = default, Always = draw on top).



DstBlendState
DstBlend

The ZTest mode of the material (One = Additive, OneMinusSrcColor = Additive Smooth).



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the flare material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



TextureFormat
Format

The format of the generated texture.



int
Width

The width of the generated texture. A higher value can result in a smoother transition.



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 handles rendering of a flare.


SgtFlare
Flare

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




SgtJovian

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


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the jovian material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



Cubemap
MainTex

The cube map used as the base texture for the jovian.



Texture2D
DepthTex

The look up table associating optical depth with atmosphere color. The left side is used when the atmosphere is thin (e.g. edge of the jovian when looking from space). The right side is used when the atmosphere is thick (e.g. the center of the jovian when looking from space).



float
Sky

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



bool
Lit

If you enable this then nearby SgtLight and SgtShadow casters will be found and applied to the lighting calculations.



Texture
LightingTex

The look up table associating light angle with surface color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



Color
AmbientColor

The jovian will always be lit by this amount.



bool
Scattering

If you enable this then light will scatter through the jovian atmosphere. This means light entering the eye will come from all angles, especially around the light point.



Texture
ScatteringTex

The look up table associating light angle with scattering color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



float
ScatteringStrength

The scattering is multiplied by this value, allowing you to easily adjust the brightness of the effect.



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.




SgtJovianDepthTex

This component allows you generate the SgtJovian.DepthTex field. If you want to improve performance then you can use the context menu to export the texture and manually apply it.


int
Width

The resolution of the optical depth color. A higher value can result in smoother results.



TextureFormat
Format

The format of the generated texture.



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 generate the SgtJovian.LightingTex field. If you want to improve performance then you can use the context menu to export the texture and manually apply it.


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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 handles rendering of a jovian.


SgtJovian
Jovian

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




SgtJovianScatteringTex

This component allows you generate the SgtJovian.ScatteringTex field. If you want to improve performance then you can use the context menu to export the texture and manually apply it.


int
Width

The resolution of the day/sunset/night color transition in pixels. A higher value can result in smoother results.



int
Height

The resolution of the scattering transition in pixels.



TextureFormat
Format

The format of the generated texture.



float
Mie

The sharpness of the forward scattered light.



float
Rayleigh

The brightness of the front and back scattered light.



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.




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.


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.




SgtDynamicPlanet

This component allows you to create a planet with dynamic LOD, where the surface mesh detail increases as your camera gets closer to the surface.


static LinkedList<SgtDynamicPlanet>
Instances

This stores all active and enabled SgtTerrain instances in the scene.



double
Radius

The distance between the center and edge of the planet in local space.



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.


Material
Material

This allows you to set the material applied to the terrain surface.



SgtSharedMaterial
SharedMaterial

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



Transform
Observer

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

None = Main Camera.



double
Detail

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



double
Boost

The higher you set this, the higher the detail will appear from orbit.

NOTE  The surface detail will remain the same, this only impacts distant LOD splitting.


int
MaxSplitsPerFrame

This allows you to control the speed of the LOD generation. The higher you set this, the lower the performance.



Texture2D
Heightmap

The heightmap texture, where the height data is stored in the alpha channel.

NOTE  This should use an Equirectangular projection.
NOTE  This texture should be marked as readable.


float
Displacement

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



float
WaterLevel

The current water level.

0 = Radius.

1 = Radius + Displacement.



bool
ClampWater

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



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.



int
GetDepth
double triangleSize

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




SgtDynamicPlanetChunk

This class stores data for a terrain chunk that can be split into 4 smaller chunks.


static readonly int
QUADS

The amount of rows & columns of quads in each chunk.

NOTE  This should be a multiple of 2.


static readonly int
VERTS

The amount of rows & columns of vertices in each chunk.



static readonly int
VERTS_COUNT

Vertices in the main chunk surface + skirt.



static readonly int
POINTS

The amount of rows & columns of direction & height data.



static readonly int
LAST_POINT

The last index in the points array.



static readonly double
STEP

The 0..1 amount each vertex traverses across the chunk surface.




SgtDynamicPlanetCollider

This component allows you to add colliders to a terrain at the specified triangle size.

NOTE  The geometry at that level must generate before the collider can appear there.

double
TriangleSize

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.


int
Layer

The GameObject layer the colliders will use.



PhysicMaterial
Material

The physics material the colliders will use.




SgtDynamicPlanetDetail

This component allows to displace the height of a terrain using procedural noise based on a splat map texture.


Texture2D
Splat

The splat texture used to control the contribution of the detail settings below.

NOTE  This should use an Equirectangular projection.
NOTE  This texture should be marked as readable.


ChannelType
Channel

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



StyleType
Style

This allows you to choose the type of noise applied from the splat map.



double
Frequency

This allows you to control the frequency/tiling of the detail applied from the red channel of the splat texture.



int
Octaves

This allows you to control the levels of detail applied from the red channel of the splat texture.



double
Strength

This allows you to control the height displacement of detail applied from the red channel of the splat texture.




SgtDynamicPlanetModifier

This is the base class for any component that modifies the terrain.



SgtDynamicPlanetObject

This component keeps the current Transform locked to the surface of the planet below it.


SgtDynamicPlanet
Planet

This allows you to specify which planet this object will snap to.

None = Closest.



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.




SgtDynamicPlanetSpawner

This component allows you to spawn prefabs on the terrain at the specified triangle size.

NOTE  The geometry at that level must generate before the prefab can spawn there.

double
TriangleSize

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.


Texture2D
Splat

The splat texture used to control the amount of prefabs that get spawned.

NOTE  This should use an Equirectangular projection.
NOTE  This texture should be marked as readable.


ChannelType
Channel

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



Transform
Prefab

The prefab that will be spawned.



RotateType
Rotate

How should the spawned prefab be rotated?



int
Count

The maximum amount of prefabs that can be spawned on the current chunk when the splat value is at maximum.




SgtDynamicPlanetVisual

This class combines many SgtTerrainChunk instances, and can draw them together in a single batch.


static readonly int
BATCH_SIZE

The amount of chunks that can be batched into one visual.

NOTE  This should be at least 4.


static readonly int[]
INDICES

The index data used by each mesh.




SgtDynamicPlanet

This class contains job specific methods for the SgtDynamicPlanet class.



SgtStaticPlanet

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.



Texture2D
Heightmap

The heightmap texture, where the height data is stored in the alpha channel.

NOTE  This should use an Equirectangular projection.
NOTE  This texture should be marked as readable.


float
Displacement

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



float
WaterLevel

The current water level.

0 = Radius.

1 = Radius + Displacement.



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.




SgtProminence

This component allows you to render a halo disc around a star.


Texture
MainTex

The main texture of the prominence.



Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the prominence material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



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.



bool
FadeEdge

Should the plane fade out when it's viewed edge-on?



float
FadePower

How sharp the transition between visible and invisible is.



bool
ClipNear

Should the plane fade out when it's in front of the star?



float
ClipPower

How sharp the transition between visible and invisible is.



float
CameraOffset

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



bool
Distort

Should the prominence be animated to distort? This makes the edges flicker like a flame.



Texture
DistortTex

This allows you to set the distortion texture that gets repeated on the prominence surface.



float
DistortScaleX

The distortion texture horizontal tiling.



int
DistortScaleY

The distortion texture vertical tiling.



float
DistortStrength

The distortion texture strength.



Vector2
DistortOffset

The UV offset of the distortion texture.



Vector2
DistortSpeed

The scroll speed of the distortion texture UV offset.



bool
Detail

Should the disc have a detail texture? For example, dust noise when you get close.



Texture
DetailTex

This allows you to set the detail texture that gets repeated on the prominence surface.



float
DetailScaleX

The detail texture horizontal tiling.



int
DetailScaleY

The detail texture vertical tiling.



float
DetailStrength

The detail texture strength.



Vector2
DetailOffset

The UV offset of the detail texture.



Vector2
DetailSpeed

The scroll speed of the detail texture UV offset.




SgtProminenceModel

This component handles rendering of a prominence.


SgtProminence
Prominence

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




SgtRing

This component allows you to render a planetary ring. This ring can be split into multiple segments to improve depth sorting.


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the ring material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



Texture
MainTex

The texture applied to the ring, where the left side is the inside, and the right side is the outside.



Mesh
Mesh

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



int
Segments

This allows you to set how many copies of the Mesh are required to complete the ring. For example, if the Mesh is 1/4 of the ring, then Segments should be set to 4.



bool
Detail

Should the ring have a detail texture? For example, dust noise when you get close.



Texture
DetailTex

This allows you to set the detail texture that gets repeated on the ring surface.



float
DetailScaleX

The detail texture horizontal tiling.



int
DetailScaleY

The detail texture vertical tiling.



Vector2
DetailOffset

The UV offset of the detail texture.



Vector2
DetailSpeed

The scroll speed of the detail texture UV offset.



float
DetailTwist

The amount the detail texture is twisted around the ring.



float
DetailTwistBias

The amount the twisting is pushed to the outer edge.



bool
Near

Enable this if you want the ring to fade out as the camera approaches.



Texture
NearTex

The lookup table used to calculate the fade opacity based on distance, where the left side is used when the camera is close, and the right side is used when the camera is far.



float
NearDistance

The distance the fading begins from in world space.



bool
Scattering

If you enable this then light will scatter through the ring atmosphere. This means light entering the eye will come from all angles, especially around the light point.



float
ScatteringMie

The mie scattering term, allowing you to adjust the distribution of front scattered light.



float
ScatteringStrength

The scattering is multiplied by this value, allowing you to easily adjust the brightness of the effect.



bool
Lit

If you enable this then nearby SgtLight and SgtShadow casters will be found and applied to the lighting calculations.



Texture
LightingTex

The look up table associating light angle with surface color. The left side is used on the dark side, the middle is used on the horizon, and the right side is used on the light side.



Color
AmbientColor

The ring will always be lit by this amount.




SgtRingLightingTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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.




SgtRingMesh

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


int
Segments

The amount of segments the final ring will be comprised of.



int
SegmentDetail

The amount of triangle edges along the inner and outer edges of each segment.



float
RadiusMin

The radius of the inner edge in local space.



float
RadiusMax

The radius of the outer edge in local space.



int
RadiusDetail

The amount of edge loops around the generated ring. If you have a very large ring then you can end up with very skinny triangles, so increasing this can give them a better shape.



float
BoundsShift

The amount the mesh bounds should get pushed out by in local space. This should be used with 8+ Segments.



SgtShadowRing
Shadow

If you want these values to control the shadow RadiusMin/Max, then set this here.



void
ExportOuterTexture

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

Once done, you can remove this component, and set the SgtRing component's Mesh setting using the exported asset.




SgtRingModel

This component is used to render a segment of the ring mesh.


SgtRing
Ring

The ring this belongs to. If this is null it will automatically be destroyed.




SgtRingNearTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



SgtEase.Type
Ease

The ease type used for the transition.



float
Sharpness

The sharpness of the 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 SgtRing component's NearTex setting using the exported asset.




SgtBehaviour

This class allows you to quickly exit play mode or close the application by skipping code when quitting is true.



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




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.




SgtDepthTextureMode

This component allows you to control a Camera component's depthTextureMode setting.


DepthTextureMode
DepthMode

The depth mode that will be applied to the camera.




SgtEase

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



SgtEditor<T>

This is the base class for all SGT component inspectors.



SgtGuide

This class defines documentation data that can be viewed in the inspector.



SgtHelper

This class contains some useful features used by most other SGT code.



SgtHelper

This class contains some useful editor-only features used by most other SGT code.



SgtLight

This component marks the attached Light as one that will be used by SGT. Most SGT features only work with a limited amount of lights, so having to explicitly define which ones will be used helps stop you going over this limit.


bool
TreatAsPoint

The SgtLightPointer component allows you to treat a Directional light like a Point light, and enabling this allows you to notify SGT about this.




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.



SgtLinkedBehaviour<T>

This class allows for quick registering and unregistering of class instances that can then be quickly looped through



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.



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.




SgtPoolObject

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


string
TypeName

The name of the type this pool manages.



List<Object>
Elements

The pooled elements in this pool.




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.




SgtQuadsModel

This component handles rendering of a quads model.


SgtQuads
Quads

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




SgtRenderingPipeline

This object allows you to switch SGT material shaders between standard shader usage, and scriptable render pipelines (SRP) shaders.


static bool
IsScriptable

This will be true if this asset has been switched to use a scriptable pipeline.



static TextAsset
Instance

This gives you the asset used to define




SgtRenderQueue

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



SgtSeedAttribute

This attribute allows you to turn a normal integer into a seed integer, adding a button to its inspector, allowing you to quickly randomize it.



SgtShader

This class caches all shader property IDs used by SGT shaders.



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

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

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



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
Opacity

The opacity of the shadow.



float
RadiusMin

The inner radius of the sphere in local space.



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

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 transtion 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

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.



SgtEase.Type
Ease

The transtion style between minimum and maximum density.



float
Sharpness

How quickly the density increases when inside the sphere.




SgtShapeTorus

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




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.

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



static Material
CachedMaterial

This property gives you the Material used by this component when rendering




SgtSingularity

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


Mesh
Mesh

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



float
MeshRadius

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



float
Radius

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the singularity material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



float
PinchPower

How much the singulaity distorts the screen.



float
PinchOffset

How large the pinch start point is.



EdgeFadeType
EdgeFade

To prevent rendering issues the singularity can be faded out as it approaches the edges of the screen. This allows you to set how the fading is calculated.



float
EdgeFadePower

How sharp the fading effect is.



Color
HoleColor

The color of the pinched hole.



float
HolePower

How sharp the hole color gradient is.



bool
Tint

Enable this if you want the singulairty to tint nearby space.



Color
TintColor

The color of the tint.



float
TintPower

How sharp the tint color gradient is.




SgtSingularityModel

This component handles rendering of a singularity.


SgtSingularity
Singularity

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




SgtSpacetime

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


Color
Color

The base color will be multiplied by this.



float
Brightness

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



SgtRenderQueue
RenderQueue

This allows you to adjust the render queue of the spacetime material. You can normally adjust the render queue in the material settings, but since this material is procedurally generated your changes will be lost.



Texture2D
MainTex

The main texture applied to the spacetime.



int
Tile

How many times should the spacetime texture be tiled?



Color
AmbientColor

The ambient color.



float
AmbientBrightness

The ambient brightness.



Color
DisplacementColor

The displacement color.



float
DisplacementBrightness

The displacement brightness.



Color
HighlightColor

The color of the highlight.



float
HighlightBrightness

The brightness of the highlight.



float
HighlightScale

The scale of the highlight.



float
HighlightPower

The sharpness of the highlight.



DisplacementType
Displacement

How should the vertices in the spacetime get displaced when a well is nearby?



bool
Accumulate

Should the displacement effect additively stack if wells overlap?



float
Power

The pinch power.



Vector3
Offset

The offset direction/vector for vertices within range of a well.



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.




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
Frequency

The frequency of the ripple.



float
Strength

The minimum strength of the well.



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.




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.


bool
PowerRgb

Instead of just tinting the stars with the colors, should the RGB values be raised to the power of the color?



bool
ClampSize

Prevent the quads from being too small on screen?



float
ClampSizeMin

The minimum size each star can be on screen in pixels. If the star goes below this size, it loses opacity proportional to the amount it would have gone under.



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 floating origin system the camera velocity can get too large, this allows you to limit it.



bool
Near

Should the stars fade out when the camera gets near?



Texture
NearTex

The lookup table used to calculate the fading amount based on the distance.



float
NearThickness

The thickness of the fading effect in world space.



bool
Pulse

Should the stars pulse in size over time?



float
PulseOffset

The amount of seconds this starfield has been animating.



float
PulseSpeed

The animation speed of this starfield.




SgtStarfieldBox

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
StarPulseMax

The maximum amount a star's size can pulse over time. A value of 1 means the star can potentially pulse between its maximum size, and 0.




SgtStarfieldCustom

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.




SgtStarfieldElliptical

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
StarPulseMax

The maximum amount a star's size can pulse over time. A value of 1 means the star can potentially pulse between its maximum size, and 0.




SgtStarfieldInfinite

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


float
Softness

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



bool
Far

Should the stars fade out when the camera gets too far away?



Texture
FarTex

The lookup table used to calculate the fading amount based on the distance.



float
FarRadius

The radius of the fading effect in world coordinates.



float
FarThickness

The thickness of the fading effect in world coordinates.



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
StarPulseMax

The maximum amount a star's size can pulse over time. A value of 1 means the star can potentially pulse between its maximum size, and 0.




SgtStarfieldInfiniteFarTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The format of the generated texture.



SgtEase.Type
Ease

The transition style.



float
Sharpness

The sharpness of the 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 SgtStarfieldInfinite component's FarTex setting using the exported asset.




SgtStarfieldNearTex

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


int
Width

The width of the generated texture. A higher value can result in a smoother transition.



TextureFormat
Format

The texture format of the generated texture.



SgtEase.Type
Ease

The transition style.



float
Sharpness

The sharpness of the transition.



float
Offset

The start point of the fading.



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

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


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 viweing 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
StarPulseMax

The maximum amount a star's size can pulse over time. A value of 1 means the star can potentially pulse between its maximum size, and 0.




SgtStarfieldSpiral

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 amound 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
StarPulseMax

The maximum amount a star's size can pulse over time. A value of 1 means the star can potentially pulse between its maximum size, and 0.




SgtStarfieldStar

This class stores information about a single star inside a starfield. These can either be manually populdated 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 (requires AllowPulse).



float
PulseRange

How much this star can pulse in size (requires AllowPulse).



float
PulseOffset

The original pulse offset (requires AllowPulse).




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
Rigidbody

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 ading 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




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
Dampening

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.




SgtFloatingCamera

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.


float
SnapDistance

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



static event System.Action<SgtFloatingCamera, Vector3>
OnSnap

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



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 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 localPosition

This gives you the universal SgtPosition of the input camera-relative world space position.



Vector3
CalculatePosition
ref SgtPosition input

This gives you the camera-relative position of the input SgtPosition in world space.



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



float
Dampening

How quickly this point follows the target.

-1 = instant.



bool
Rotate



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 floating origin system.



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.




SgtFloatingObject

This component turns a normal GameObject + Transform into one that works with the floating origin system.

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 floating origin snaps to a new position.

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.


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



double
Angle

The curent position along the orbit in degrees.



double
DegreesPerSecond

The orbit speed.



SgtFloatingOrbitVisual
Visual

If you want to display the orbit path, set the visual here. The visual should be in a child GameObject.



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.


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.




SgtFloatingPoint

This component wraps SgtPosition into a component, and defines a single point in the floating origin system.

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.

NOTE  If you modify this then you must call the PositionChanged method after.


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
PositionChanged

Call this method after you've finished modifying the Position, and it will notify all event listeners.



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.




SgtFloatingRoot

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



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.


SgtFloatingObject
CachedObject

The SgtFloatingObject component alongside this component.




SgtFloatingSpawner

This is the base class for all floating origin 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.



SgtFloatingObject
CachedObject

The SgtFloatingObject component alongside this component.




SgtFloatingSpawnerOrbit

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

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

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

The maximum distance away the prefabs can spawn in meters.



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.




SgtFloatingWarp

This is the base class for all warp styles.


SgtFloatingPoint
Point

The point that will be warped.



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.


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

The the pin if we're within warping distance?




SgtFloatingWarpSmoothstep

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.




SgtLength

This struct allows you to define a length or distance in the floating origin system. 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.



SgtPosition

This class stores a coordinate in the floating origin system, 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.




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 beloning to this spawn list.




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#?

Are scriptable render pipelines (SRP) supported?

Is VR supported?

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

Accretion

Atmosphere

Aurora

Backdrop

Belt

Billboard

Cloudsphere

Corona

Debris

Flare

Jovian

Lightning

Planet

Prominence

Ring

Singularity

Spacetime

Star

Starfield

Thruster

Universe



Assets

Lean GUI

Lean Transition

Paint in 3D

Lean Pool

Space Graphics Toolkit

Lean Touch

Lean Localization

Lean GUI Shapes

Destructible 2D

Planet Pack - Space Graphics Toolkit

Lean Touch+

Volumetric Audio



Versions

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

SgtAccretion

SgtAccretionMesh

SgtAccretionModel

SgtAccretionNearTex

SgtAtmosphere

SgtAtmosphereDepthTex

SgtAtmosphereHeight

SgtAtmosphereLightingTex

SgtAtmosphereModel

SgtAtmosphereOuterMesh

SgtAtmospherePointer

SgtAtmosphereScatteringTex

SgtAurora

SgtAuroraMainTex

SgtAuroraModel

SgtAuroraNearTex

SgtBackdrop

SgtBackdropQuad

SgtBelt

SgtBeltAsteroid

SgtBeltCustom

SgtBeltLightingTex

SgtBeltSimple

SgtBillboard

SgtDepth

SgtDepthCamera

SgtDepthRaycast

SgtDepthScale

SgtFastBillboard

SgtFastBillboardManager

SgtCloudsphere

SgtCloudsphereDepthTex

SgtCloudsphereLightingTex

SgtCloudsphereModel

SgtCloudsphereNearTex

SgtCorona

SgtCoronaDepthTex

SgtCoronaModel

SgtDebris

SgtDebrisGrid

SgtDebrisSpawner

SgtFlare

SgtFlareMaterial

SgtFlareMesh

SgtFlareModel

SgtJovian

SgtJovianDepthTex

SgtJovianLightingTex

SgtJovianModel

SgtJovianScatteringTex

SgtLightning

SgtLightningSpawner

SgtDynamicPlanet

SgtDynamicPlanetChunk

SgtDynamicPlanetCollider

SgtDynamicPlanetDetail

SgtDynamicPlanetModifier

SgtDynamicPlanetObject

SgtDynamicPlanetSpawner

SgtDynamicPlanetVisual

SgtDynamicPlanet

SgtStaticPlanet

SgtProminence

SgtProminenceModel

SgtRing

SgtRingLightingTex

SgtRingMainTexFilter

SgtRingMesh

SgtRingModel

SgtRingNearTex

SgtBehaviour

SgtCamera

SgtCameraState

SgtDepthTextureMode

SgtEase

SgtEditor<T>

SgtGuide

SgtHelper

SgtHelper

SgtLight

SgtLightPointer

SgtLinkedBehaviour<T>

SgtLong3

SgtLongBounds

SgtLongRect

SgtPoolClass<T>

SgtPoolComponent

SgtPoolObject

SgtProcedural

SgtQuadsModel

SgtRenderingPipeline

SgtRenderQueue

SgtSeedAttribute

SgtShader

SgtShadow

SgtShadowLayer

SgtShadowRing

SgtShadowRingFilter

SgtShadowSphere

SgtShape

SgtShapeBox

SgtShapeGroup

SgtShapeSphere

SgtShapeTorus

SgtSharedMaterial

SgtLens

SgtSingularity

SgtSingularityModel

SgtSpacetime

SgtSpacetimeWell

SgtStarfield

SgtStarfieldBox

SgtStarfieldCustom

SgtStarfieldElliptical

SgtStarfieldInfinite

SgtStarfieldInfiniteFarTex

SgtStarfieldNearTex

SgtStarfieldNebula

SgtStarfieldSpiral

SgtStarfieldStar

SgtThruster

SgtThrusterRoll

SgtThrusterScale

SgtFloatingCamera

SgtFloatingFollow

SgtFloatingLight

SgtFloatingLod

SgtFloatingObject

SgtFloatingOrbit

SgtFloatingOrbitVisual

SgtFloatingPoint

SgtFloatingRoot

SgtFloatingScaler

SgtFloatingSpawner

SgtFloatingSpawnerOrbit

SgtFloatingSpawnerRing

SgtFloatingSpawnerSphere

SgtFloatingSpeedometer

SgtFloatingTarget

SgtFloatingWarp

SgtFloatingWarpButton

SgtFloatingWarpPin

SgtFloatingWarpSmoothstep

SgtLength

SgtPosition

SgtSpawnList