Git Product home page Git Product logo

unity-graphics's Introduction

Unity Graphics

A collection of URP shaders and render features.

Developed and tested with Unity 2020.3.16f1 and URP 10.5.1.

Table of Contents

Fog Skybox

Fog Skybox

A skybox shader that blends with fog.

Blob Shadows

Blob Shadows

A render feature that adds support for blob shadows:

  • Either circle or box shape
  • Can be used as primitive AO
  • Includes an example shader that supports receiving blob shadows (an extension of Toon Shader Lite)

Performance

  • Measured on Snapdragon 845 via Unity's GPU Profiler (OpenGL ES)
  • Setup: ~20 capsules
  • Blob Shadows:
    • All circles
    • Resolution per unit = 8 (further increase does not improve visual quality)
    • Shadow Distance = 15
  • Shadow Maps:
    • Shadow Resolution = 256
    • Shadow Distance = 20
    • Soft Shadows On
    • 1 Cascade

Note: sampling shadow maps when rendering shadow receivers is NOT taken into account.

Results (in ms):

  • Blob: 0.08 (Submit) + 0.21 (Render) = 0.29
  • Shadow Maps: 0.05 (Setup) + 0.21 (PrepareDrawShadows) + 0.21 (Submit) + 0.13 (Render) = 0.6

Drawing

Runtime drawing on the GPU side with configurable brush (color, size, hardness).

Layered Grass

Layered Grass

Grass shader made with the technique that is typically used for fur (Reference).

Warning: the shader has poor performance on both mobile and desktop platforms. It is only a technical demo, which might not be suitable for production even if further optimized.

Billboard Grass

Billboard Grass

Billboard grass shader:

  • Automatic random spread
  • Per-chunk frustum culling (in the screenshot above, chunk size is 15x15)
  • LOD system: the further the grass chunk from the camera, the sparser it is
  • Interactive: the grass reacts to contacts with other objects
  • Receives and optionally casts shadows
  • Wind animation

Geometry Grass

Geometry Grass

Grass implemented with geometry shader:

  • Grass placement mesh is generated via Job System
  • Automatic LOD system implemented in the geometry shader (controlled via material properties)
  • Based on this tutorial

Matcap

Matcap

Basic Matcap shader. Matcap textures are taken from this repo.

Toon Terrain

Toon Terrain

Lightweight toon terrain shader.

  • Configurable ramp (specified as a texture)
  • Shadow casting and receiving
  • 4 layers (splats) max

Parallax Ice

Parallax Ice

Ice shader imitating depth.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.