项目作者: midnightSuyama

项目描述 :
Unity Shader Code with “BASIC×SHADER”
高级语言: ShaderLab
项目地址: git://github.com/midnightSuyama/BASICxSHADER.git
创建时间: 2019-07-19T19:03:57Z
项目社区:https://github.com/midnightSuyama/BASICxSHADER

开源协议:

下载


" class="reference-link">BASIC×SHADER

Unity Shader Code with “BASIC×SHADER

Frames

Getting Started

Unlit Shader

To set a shader to Unity object, assign through a material. Let’s create object for display, material for the object, and shader for the material.

Object

Create a sphere object via GameObject > 3D Object > Sphere from the Unity Editor menu.

Object (Wireframe)

Material

Create a material file via Assets > Create > Material from the Unity Editor menu. Assign the material to the object.

Inspector (Object)

Shader

Create a shader file via Assets > Create > Shader > Unlit Shader from the Unity Editor menu. Replace the contents of shader with the code below and assign the shader to the material.

Inspector (Material)

  1. Shader "BASICxSHADER/Unlit" {
  2. SubShader {
  3. Pass {
  4. CGPROGRAM
  5. #pragma vertex vert
  6. #pragma fragment frag
  7. float4 vert(float4 vertex : POSITION) : SV_POSITION {
  8. return UnityObjectToClipPos(vertex);
  9. }
  10. fixed4 frag() : SV_Target {
  11. return fixed4(1.0, 0, 0, 1.0);
  12. }
  13. ENDCG
  14. }
  15. }
  16. }

#3 Lighting

#3.1 Ambient

Ambient

#3.2 Diffuse

Diffuse

#3.3 Specular

Specular

#3.4 Phong

Phong

#3.5 Blinn-Phong

Blinn-Phong

#3.6 Rim

Rim

#3.7 Toon

Toon

#3.8 Oren-Nayar

Oren-Nayar

#3.9 Cook-Torrance

Cook-Torrance

#3.10 SH

SH

#3.11 Point/Spot

Point/Spot

#4 Texturing

#4.1 Color

Color

#4.2 Gloss

Gloss

#4.3 Bump

Bump

#4.4 Parallax

Parallax

#4.5 Reflection

Reflection

#4.6 Refraction

Refraction

#5 Shadow

#5.1 Projection

Projection

#5.2 Volume

Volume

#5.3 Map

Map

#6 Fog

#6.1 Depth

Depth

#6.2 Distance

Distance

#6.3 Height

Height

#7 PostEffect

#7.1 Original

Original

#7.2 Negaposi

Negaposi

#7.3 Grayscale

Grayscale

#7.4 Sepia

Sepia

#7.5 Threshold

Threshold

#7.6 Mosaic

Mosaic

#7.7 LED

LED

#7.8 Noise

Noise

#7.9 Scanline

Scanline

#7.10 Twirl

Twirl

#7.11 Fisheye

Fisheye

#7.12 Sobel

Sobel

#7.13 Kuwahara

Kuwahara

#7.14 FXAA

FXAA

#7.15 ZoomBlur

ZoomBlur

#7.16 MotionBlur

MotionBlur

#7.17 GaussianBlur

GaussianBlur

#7.18 Bloom

Bloom

#7.19 DOF

DOF

#7.20 SSAO

SSAO