GithubHelp home page GithubHelp logo

unity3d-shaders-basic's Introduction

Unity3D-Shaders-Basic

Basic Unity3D Shaders

Author: Shantanu Bhadoria

Date: 2/7/2014

These are Basic Shaders built using Unity. Shader files are in Shaders folder and can be dragged and dropped into Unity Assets.Each subsequent shader adds a certain effect to the pervious shader. Shaders upto 4 are single pass shaders which means they don't support multiple light sources. 5 and onwards are multi pass shaders which combine the effects of multiple lights in the scene.

  • 1 Flat Color: Flat Color shader, no effects, no reaction to ambient, directional or any other light, this is the simplest possible shader you can have. Very little Practical use. Single Pass Vertext ShaderSingle Pass
  • 2 Lambert Shader: A Diffuse Shader, Reflects soft light from one light source Attenuates light reflection based on surface angle towards light source direction. no reflection, specular effects etc. Doesn't include Ambient Light in Calculations. Single Pass
  • 2b Ambient Lambert Shader: Same Shader as above. Adds Ambient Light effect to output. Single Pass
  • 3a Specular Shader: Adds a Specular reflection effect on top to emulate a shiny surface like metal for example in addition to base diffuse and ambient effects. Uses Vertex Shading, achieves a decent output for subdivided surface meshes. Not so good for low poly models. Single Pass
  • 3b Specular Pixel Shader: like above except uses Pixel Shading. i.e. This shader calculates shader values for each pixel on each face of the mesh. Way more expensive than vertex shaders but it gives a much more beautiful output.Single Pass
  • 4 Rim Shader: Adds a Rim Lighting effect to the object, Mathematically this in effect is the inverse of specular effect. Rim Shader adds extra lighting to the edge of an object.Single Pass
  • 5 Multi Lights: This is a double pass shader which supports more than one lights in the scene. This Shader only supports directional lights and ambient light. It doesn't work well with point lights.
  • 5b Point Lights: This Shader supports point lights in addition to directional lights.
  • 6 Texture Shader: This Shader allows you to use a image texture map on your mesh to add realistic look to objects.
  • 7 Normal Maps: This Shader allows you to add a normal map to the object. Normal Map is a specific image where the image pixel coordinate decides how the light is reflected on the corresponding pixel coordinate on your mesh. This allows you to give a illusion of surface bumps, gashes etc. on your mesh surface. Normal Maps is the most common kind of Bump Mapping technique.
  • 8a gloss map: This shader uses the alpha channel of your texture map to decide glossiness coefficient of a surface. This coefficient is used to calculate the specular reflections across the surface. This causes certain sections of your mesh to emit less reflections than others depending on you texture images alpha channel.
  • 8b emission map: This is a rarely used setting that gives a light emission on a surface irrespective of any light source. This will be rarely used except to show lightings in building windows in dark scenes like at night for example. The emission surfaces don't emit any light at the moment, They are just illuminated.

unity3d-shaders-basic's People

Contributors

shantanubhadoria avatar

Watchers

 avatar  avatar

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.