• Stars
    star
    459
  • Rank 95,377 (Top 2 %)
  • Language
    C#
  • License
    MIT License
  • Created over 3 years ago
  • Updated over 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A minimal atmospheric scattering implementation for Unity

Preview shots

MinimalAtmosphere

A minimal (single cginc file) atmospheric scattering implementation for Unity to use as a base for further work and as a reference for anyone wanting to learn. Includes a simple skybox and object shader. No optimizations are implemented and so it probably should not be used in an actual application.

Above all else, this repository aims to be easy to understand, and although implemented in Unity, the shader file does not make use of any Unity-specific code, meaning it can be ported easily. The file containing the implementation is Assets/Atmosphere/Shaders/Atmosphere.cginc

Supports Rayleigh and Mie (single) scattering + ozone absorption. The object shader also shows how atmospheric transmittance can be used to attenuate the directional light (planet shadow).

The project is using URP (just to get screen tonemapping and dithering) but you can export the atmosphere part to any pipeline, just grab the Atmosphere directory from Assets.

This repository represents my current best understanding of atmospheric scattering, so I happily accept corrections on things that are implemented incorrectly, just raise an issue and I will check it out.

Recommended reading

A Scalable and Production Ready Sky and Atmosphere Rendering Technique

More Repositories

1

BNAO

A tiny, GPU-based Bent Normal and Ambient Occlusion baker for Unity.
C#
529
star
2

BakerBoy

A single-component, GPU-based universal ambient occlusion and bent normal baker for Unity. The successor to my BNAO respository
HLSL
302
star
3

MeshDecal

A simple mesh decal component for Unity
C#
210
star
4

TerrainPrettifier

A small GPU-based component designed to aid in cleaning and refining satellite/DEM based terrains directly inside Unity.
C#
185
star
5

CloudNoiseGen

A static utility class for Unity which handles generating and loading periodic, cloud-like (perlin-worley) 3D noise textures on the GPU.
C#
127
star
6

VolumetricTracer

A simple way to render soft, volumetric bullet tracers in Unity. Only needs a unit cube and a material to render and supports instancing.
ShaderLab
117
star
7

CapsuleOcclusion

Unity package implementing clustered capsule/character occlusion
C#
92
star
8

VertexColorBaker

A tiny vertex color baker for Unity that runs on the GPU, implemented as an AssetPostprocessor
C#
86
star
9

SDFGI

A Monte Carlo path tracer implemented on the GPU in Unity, using Signed Distance Fields.
C#
77
star
10

Celery

Mask
24
star
11

SphericalHarmonicsDev

ShaderLab
10
star
12

SphericalHarmonics

HLSL
9
star
13

TNM084_Lab3

A procedural lava ball in Unity
C#
5
star
14

BasicPlayerMovement

A super simple Unity demo featuring two ways of doing basic player and camera movement.
C#
5
star
15

AtomicSurfer

A super-rad surfing/shark shooter simulator.
C#
4
star
16

TextureProcessor

Static utility class for processing texture on the GPU.
C#
4
star
17

InfinitePain

A RougLike FPS created during a game jam
C#
4
star
18

LiTHeLan_Final

C#
3
star
19

LudumDare38

C#
2
star
20

iMat

Java
1
star
21

MoS

C#
1
star