CyberAgentGameEntertainment / NovaShader

Licence: MIT license
Multi-functional shader for the Particle System that supports Universal Render Pipeline (URP) of Unity.

Programming Languages

C#
18002 projects
HLSL
714 projects
ShaderLab
938 projects

Projects that are alternatives of or similar to NovaShader

MoravaEngine
2D/3D graphics engine written in C++ language. It currently supports the following graphics APIs: OpenGL 3.3+, Vulkan 1.2, DirectX 11. Its current purpose is to experiment with various CG concepts and techniques.
Stars: ✭ 129 (-71.21%)
Mutual labels:  shaders, particles
Height-Based-Gradient-Color-Shaders-for-Unity
Height Based 2 color gradient shaders for Unity
Stars: ✭ 18 (-95.98%)
Mutual labels:  shaders, vfx
VertexAnimation
Vertex animation baking tool, shaders and animation system for Unity DOTS/ECS.
Stars: ✭ 132 (-70.54%)
Mutual labels:  shaders, urp
Unity Script Collection
A maintained collection of useful & free unity scripts / library's / plugins and extensions
Stars: ✭ 3,640 (+712.5%)
Mutual labels:  shaders, particles
Unity resources
A list of resources and tutorials for those doing programming in Unity.
Stars: ✭ 170 (-62.05%)
Mutual labels:  shaders, particles
Gpu Particles
A GPU Particle System for Unity
Stars: ✭ 313 (-30.13%)
Mutual labels:  particles, vfx
Holoshield
Highly customizable sci-fi shield / force field shader for Unity3D. Allows you to set edge power & color, inner texture scrolling, waviness, scale pulsation and procedural intensity noise. Implements tessellation for low-poly base meshes.
Stars: ✭ 401 (-10.49%)
Mutual labels:  shaders, vfx
Newtonian-Particle-Simulator
C# OpenGL Particle Simulation, GPU accelerated
Stars: ✭ 131 (-70.76%)
Mutual labels:  particles, particlesystem
Pencilsketcheffect
Real Time Hatching In Unity
Stars: ✭ 134 (-70.09%)
Mutual labels:  shaders, vfx
Phenomenon
⚡️ A fast 2kB low-level WebGL API.
Stars: ✭ 1,551 (+246.21%)
Mutual labels:  shaders, particles
Openshadinglanguage
Advanced shading language for production GI renderers
Stars: ✭ 1,382 (+208.48%)
Mutual labels:  shaders, vfx
pipeVFX
A Visual Effects pipeline to manage jobs, shots and software assignment, with a simple asset manager. Its extensively integrated with CortexVFX and Gaffer. (and it builds booth, with support for Maya, Houdini and Nuke, if you have then installed!)
Stars: ✭ 47 (-89.51%)
Mutual labels:  shaders, vfx
GPU-Fog-Particles
Textureless fog particles using a highly customizable shader to attenuate noise values.
Stars: ✭ 303 (-32.37%)
Mutual labels:  shaders, particles
Unity3DShaders
Simple shaders for Unity3D that I created for games, for a challenge or following tutorials.
Stars: ✭ 17 (-96.21%)
Mutual labels:  shaders, vfx
ofxLSystem
3D turtle graphics interpretation of L-Systems
Stars: ✭ 39 (-91.29%)
Mutual labels:  shaders
GPU-Zen-2-Baker
🥧 An OpenGL 4.x example of GPU Zen 2's ray casting techniques for baked texture generation chapter.
Stars: ✭ 32 (-92.86%)
Mutual labels:  shaders
Shader-Playgrounds
A WebGL shaders editor for beginners and otherwise.
Stars: ✭ 28 (-93.75%)
Mutual labels:  shaders
Cabana
Performance-portable library for particle-based simulations
Stars: ✭ 115 (-74.33%)
Mutual labels:  particles
manyworlds
A scifi-inspired study of signed distanced functions and noise fields in WebGL
Stars: ✭ 24 (-94.64%)
Mutual labels:  shaders
nerv pathtracer
a pathtracer with physically based rendering in mind
Stars: ✭ 27 (-93.97%)
Mutual labels:  shaders

NOVA Shader NOVA Shader

NOVA Shader: Uber shader for Particle System

license license license

Docs (English, 日本語) | Samples (English, 日本語) | Demo (English, 日本語)

NOVA Shader is a multi-functional shader for the Particle System that supports Universal Render Pipeline (URP). General-purpose functions commonly used in visual effects are implemented so you can create high-quality effects efficiently.

Sample1

Sample2
Author: @Ugokashiya

It implements some distinctive features like Flow Map, Flip-Book (sequential texture animation), Dissolve, Fade, Rotation, Animated Tint Map, Emission, Distortion, and so on.

Features
Features

For more information, please refer to the following documents, Samples and Demo.

Table of Contents

Details

Setup

Requirements

This library is compatible with the following environments.

  • Unity 2020.3 or higher
  • Universal Render Pipeline
  • Shader Model 3.5

Note that Shader Model 4.5 is required to use Mesh GPU Instancing. And also, if you want to use Mirror Sampling, your hardware needs to support Inline Sampler States. And if you are using 3D Texture or 2D Texture Array, the compression format must support them.

And this document assumes that you have already set up the Universal Render Pipeline. For more information about the Universal Render Pipeline, please refer to the Unity Manual

Install

To install the software, follow the steps below.

  1. Open the Package Manager from Window > Package Manager
  2. "+" button > Add package from git URL
  3. Enter the following

Package Manager

Or, open Packages/manifest.json and add the following to the dependencies block.

{
    "dependencies": {
        "jp.co.cyberagent.nova": "https://github.com/CyberAgentGameEntertainment/NovaShader.git?path=/Assets/Nova"
    }
}

If you want to set the target version, write as follows.

Note that if you get a message like No 'git' executable was found. Please install Git on your system and restart Unity, you will need to set up Git on your machine.

To update the version, rewrite the version as described above.
If you don't want to specify a version, you can also update the version by editing the hash of this library in the package-lock.json file.

{
  "dependencies": {
      "jp.co.cyberagent.nova": {
      "version": "https://github.com/CyberAgentGameEntertainment/NovaShader.git?path=/Assets/Nova",
      "depth": 0,
      "source": "git",
      "dependencies": {},
      "hash": "..."
    }
  }
}

Uber Unlit Shader

The Uber Unlit shader is a multifunctional shader with no lighting applied. Use this shader for particles that do not need lighting, such as glowing effects.

To use this shader, assign the Nova/Particles/UberUnlit shader to your material. The following is the description of each property that can be set from the Inspector.

Render Settings

The Render Settings control how the Material is rendered.

Render Settings
Render Settings

Property NameDescription
Render Type

You can specify the type of rendering from the following options.

  • Opaque
  • Cutout
  • Transparent (Default)

If you select Cutout, the CutOff property will be displayed. When Transparent is selected, the Blend Mode property will be displayed.

CutOff

This property is visible only when the Render Type is set to Cutout.

Controls the threshold to clip semi-transparent areas. The higher this value is, the more alpha will be cropped.

Blend Mode

This property is visible only when the Render Type is set to Transparent.

You can specify the color blend method from the following options.

  • Alpha (Alpha Blending / Default)
  • Additive
  • Multiply

Render Face

You can specify the rendering face from the following options.

  • Front (Default)
  • Back
  • Both

Render Priority

If the Render Type is the same, the one with the lower Render Priority will be drawn first.

Vertex Alpha Mode

You can specify how to use the alpha value of the vertex color from the following options.

  • Alpha: Use as alpha value (Default).
  • Transition Progress: Use as Progress in Alpha Transition function (see below).

Base Map

Base Map controls the base color texture and its settings.

Base Map
Base Map

Property NameDescription
Mode

You can specify the type of the Base Map from the following options.

  • Single Texture: Use 2D texture (Default).
  • Flip Book: Use Flip-Book animation.
  • Flip Book Blending: Use Flip-Book animation with interpolated frames.

The required texture type will change depending on the mode you selected.

Texture

Set the Base Map.

If you specify Flip Book as the Mode, you need to set Texture2DArray. And if you specify Flip Book Blending, you need to set Texture3D.

Rotation

Set the amount of rotation of the Base Map.

Offset

Shifts the center coordinate of rotation.

Mirror Sampling

If true, mirrors the texture to create a repeating pattern.

Flip-Book Progress

This property is visible only when the Mode is set to Flip Book or Flip Book Blending.

The progress of the Flip-Book or Flip-Book Blending.

Tint Color

Tint Color controls the color to be multiplied.

Tint Color
Tint Color

Property NameDescription
Mode

You can specify the area to apply the Tint Color from the following options.

  • None: Disable the Tint Color (Default).
  • All: Apply to the entire surface.
  • Rim: Apply to the rim.

Progress

This property is visible only when the Mode is set to Rim.

The larger this value is, the more only the areas near the edges will be colored.

Sharpness

This property is visible only when the Mode is set to Rim.

The larger this value is, the sharper the edge of the rim will be.

Inverse

This property is visible only when the Mode is set to Rim.

If checked, reverse the range of the rim.

Color Mode

You can specify how you set the Tint Color.

  • Single Color: Single Color (Default).
  • Texture 2D: Specified by the texture.
  • Texture 3D: Specified by the 3D texture (Animatable).

Color

This property is visible only when the Color Mode is set to Single Color.

The color to be multiplied.

Texture

This property is visible only when the Color Mode is set to Texture 2D or Texture 3D.

The texture whose color will be multiplied.

Progress

This property is visible only when the Color Mode is set to Texture 3D.

The progress of the 3D Texture.

Blend Rate

The color multiplication factor. If this value is zero, the color will not be applied; if it is one, the color will be multiplied as is.

Flow Map

You can use the Flow Map to distort the Base Map to the specified directions.

Flow Map
Flow Map

Property NameDescription
Texture

Sets the Flow Map. The specifications are as follows.

  • Shifts the UV values of the Base Map based on the texture color channels.
  • The color channels used is determined by the X value and Y value of the Channels properties.
  • The smaller the value from 0.5, the more the UV value shifts in the negative direction, and vice versa.
Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Intensity

Sets the Flow Map intensity.

Targets

Set the targets to which the flow map will be applied (multiple selections are possible).

  • Base Map
  • Tint Map
  • Alpha Transition Map
  • Emission Map

Color Correction

Color Correction correct the colors up to this point.

Color Correction
Color Correction

Property NameDescription
Mode

You can specify how to correct the colors.

  • None: Disable the Color Correction (Default).
  • Greyscale: Chage the colors to greyscale.
  • Gradient Map: Use the gradient map.

Texture

This property is visible only when the Mode is set to Gradient.

Sets the Gradient Map. The specifications are as follows.

  • Replace the luminance with the colors of the gradient map.
  • Change the U value for sampling the gradient map according to luminance.
  • Therefore, we need to use a texture with a horizontal gradient.

Alpha Transition

Alpha Transition controls the alpha value using a texture.

Alpha Transition
Alpha Transition

Property NameDescription
Mode

You can specify Alpha Transition Mode from the following options.

  • None: Disable the Alpha Transition (Default).
  • Fade: Transition using the fade texture.
  • Dissolve: Transition using the dissolve texture.

Map Mode

You can specify the type of the Alpha Transition Map from the following options.

  • Single Texture: Use 2D texture (Default).
  • Flip Book: Use Flip-Book animation.
  • Flip Book Blending: Use Flip-Book animation with interpolated frames.

The required texture type will change depending on the mode you selected.

Texture

Sets the Alpha Transition Map. The specifications are as follows.

  • Changes the alpha value based on the texture color channel.
  • The color channels used is determined by the X value of the Channels properties.
  • The smaller the R value, the easier it is to disappear, and vice versa.

If you specify Flip Book as the Mode, you need to set Texture2DArray. And if you specify Flip Book Blending, you need to set Texture3D.

Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Flip-Book Progress

This property is visible only when the Map Mode is set to Flip Book or Flip Book Blending.

Sets the progress of Flip-Book or Flip-Book Blending.

Transition Progress

Sets the progress of Transition.

Edge Sharpness

This property is visible only when the Mode is set to Transition.

Sets the sharpness of the edge.

Emission

The Emission control how the particles are glowing.

Emission
Emission

Property NameDescription
Mode

You can specify the area to be glowed.

  • None: Disable the Emission (Default).
  • All: The entire surface will glow.
  • By Texture: The area specified by the texture will glow.
  • Edge: Edges (areas where alpha is greater than 0 and less than 1) will glow.

Map Mode

This property is visible only when the Mode is set to By Texture.

You can specify the Mode of the Emission Map from the following options.

  • Single Texture: Use 2D texture (Default).
  • Flip Book: Use Flip-Book animation.
  • Flip Book Blending: Use Flip-Book animation with interpolated frames.

The required texture type will change depending on the mode you selected.

Texture

This property is visible only when the Mode is set to By Texture.

Sets the Emission Map. The specifications are as follows.

  • The larger the texture color channles value, the more likely it is to glow.
  • The color channels used is determined by the X value of the Channels property.

If you specify Flip Book as the Mode, you need to set Texture2DArray. And if you specify Flip Book Blending, you need to set Texture3D.

Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Flip-Book Progress

This property is visible only when the Mode is set to By Texture and the Map Mode is set to Flip Book or Flip Book Blending.

Sets the progress of Flip-Book or Flip-Book Blending.

Color Type

You can specify the type of the emission color from the following options.

  • Color: Use the specified single color as the emission color.
  • Base Color: Use the RGB values up to this point as the emission color.
  • Gradient Map: Use a gradient map to specify the emission color.
Gradient Map can only be selected when Mode is set to By Texture or Edge.

Color

This property is visible only when the Color Type is set to Color.

Sets the emission color as HDR color.

Keep Edge Transparency

This property is visible only when the Mode is set to Edge.

If checked, the edges will not be transparent.

Gradient Map

This property is visible only when the Color Type is set to Gradient Map.

Sets the Gradient Map. The specifications are as follows.

  • When Mode is By Texture: Sampling the R value of the Emission Map as the U value of the Gradient Map.
  • When Mode is Edge: Sample alpha values as U values of the Gradient Map.
  • You need to use a texture with a horizontal gradient as the Gradient Map.

Intensity

Sets the intensity of the emission.

Transparency

Control the transparency in various ways.

Transparency
Transparency

Property NameDescription
Rim

If checked, the rim will be transparent.

Progress

Sets the progress of transparency.

Sharpness

The larger this value is, the sharper the edge will be.

Inverse

Inverse the transparency area.

Luminance

If checked, areas with low brightness will be transparent.

Progress

Sets the progress of transparency.

Sharpness

The larger this value is, the sharper the edge will be.

Inverse

Inverse the transparency area.

Sort Particles

If checked, soft particles will be enabled. To use this feature, the Depth Texture in URP settings must be enabled.

Intensity

The larger this value, the larger the transparent area.

Depth Fade

Makes the areas near and far from the camera transparent. To use this feature, the Depth Texture in URP settings must be enabled.

Distance

Set the transparency range. The area closer than Near and farther than Far from the camera will be transparent.

Width

The distance from the beginning of transparency to the end of complete transparency.

Distortion Shader

Using the Distortion shader, you can apply distortion effects to the screen, such as heat waves.

To use this shader, assign the Nova/Particles/Distortion shader to your material. The following is the descriptions of each property that can be set from the Inspector.

Render Settings

The Render Settings control how the Material is rendered.

Render Settings
Render Settings

Property NameDescription
Render Face

You can specify the rendering face from the following options.

  • Front (Default)
  • Back
  • Both

Distortion

Distortion controls how it is distorted.

Distortion
Distortion

Property NameDescription
Texture

Sets the Distortion Map. The specifications are as follows.

  • Distorts the screen based on the texture color channels.
  • The color channels used is determined by the X value of the Channels Property.
  • 0.5 is the reference value, and the further away from the reference value, the stronger the distortion.
Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Intensity

Sets the distortion intensity.

Rotation

Set the amount of rotation of the Distortion Map.

Offset

Shifts the center coordinate of rotation.

Mirror Sampling

If true, mirrors the texture to create a repeating pattern.

Flow Map

You can use the Flow Map to distort the Distortion Map to the specified directions.

Flow Map
Flow Map

Property NameDescription
Texture

Sets the Flow Map. The specifications are as follows.

  • Shifts the UV values of the Distortion Map based on the texture color channles.
  • The texture color channels used is determined by the X value of the Channels property.
  • The smaller the value from 0.5, the more the UV value shifts in the negative direction, and vice versa.
Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Intensity

Sets the Flow Map intensity.

Alpha Transition

Alpha Transition controls the alpha value using a texture.

Alpha Transition
Alpha Transition

Property NameDescription
Mode

You can specify Alpha Transition Mode from the following options.

  • None: Don't use the Alpha Transition (Default).
  • Fade: Transition using the fade texture.
  • Dissolve: Transition using the dissolve texture.

Texture

Sets the Alpha Transition Map. The specifications are as follows.

  • Changes the alpha value based on the texture color channel.
  • The color channles used is determined by the X value of the Channels property.
  • The smaller the R value, the easier it is to disappear, and vice versa.

Note that you need to uncheck sRGB Color in the texture import setting because the pixels will be used as values, not colors.

Progress

Sets the progress of Transition.

Edge Sharpness

This property is visible only when the Mode is set to Transition.

Sets the sharpness of the edge.

Transparency

Control the transparency in various ways.

Transparency
Transparency

Property NameDescription
Rim

If checked, the rim will be transparent.

Progress

Sets the progress of transparency.

Sharpness

The larger this value is, the sharper the edge will be.

Inverse

Inverse the transparency area.

Luminance

If checked, areas with low brightness will be transparent.

Progress

Sets the progress of transparency.

Sharpness

The larger this value is, the sharper the edge will be.

Inverse

Inverse the transparency area.

Sort Particles

If checked, soft particles will be enabled. To use this feature, the Depth Texture in URP settings must be enabled.

Intensity

The larger this value, the larger the transparent area.

Depth Fade

Makes the areas near and far from the camera transparent. To use this feature, the Depth Texture in URP settings must be enabled.

Distance

Set the transparency range. The area closer than Near and farther than Far from the camera will be transparent.

Width

The distance from the beginning of transparency to the end of complete transparency.

Use with the Custom Vertex Streams

Using the Particle System's Custom Vertex Streams, you can animate the properties of the Material. In the following example, we will use the Custom Vertex Streams to rotate the texture.

Set up the Custom Data

First, set up the Particle System's Custom Data. In this case, we have set a value that changes from 0 to 1 over time to Custom1.X.

Custom Data
Custom Data

Set up the Custom Vertex Streams

Next, set the Custom Vertex Streams as shown below to pass Custom1.x to TEXCOORD1.x.

Custom Vertex Streams
Custom Vertex Streams

Set up the Material Property

Next, select COORD 1X from the Rotation dropdown to use the value passed to TEXCOORD1.x as shown below.

Coord
Coord

The texture will now rotate.

Rotation
Rotation

Use Mesh GPU Instancing

You can use the Particle System Mesh GPU Instancing to draw particles efficiently. The following section describes how to use Mesh GPU Instancing for materials using this shader.

Enable Mesh GPU Instancing

To use Mesh GPU Instancing, you need to set the Render Mode of the Renderer module to Mesh. Then, check the Enable Mesh GPU Instancing checkbox.

Enable Mesh GPU Instancing
Enable Mesh GPU Instancing

Set up the Custom Vertex Streams

Next, set up the Custom Vertex Streams as shown below.

Custom Vertex Streams
Custom Vertex Streams

The Custom Data section can be filled with values from other modules, such as Noise, but make sure that all of INSTANCED1.xyzw and INSTANCED2.xyzw are filled without excess or deficiency.

Now you can use Mesh GPU Instancing.

About Lit Shader

The NOVA Shader currently only provides the Unlit shader. The Lit shader is still under consideration and will be added in a future update.

Licenses

This software is released under the MIT license. You are free to use it within the scope of the license, but the following copyright and license notices are required.

In addition, the table of contents for this document has been created using the following software

See Third Party Notices.md for more information about the license of toc-generator.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].