Unity and other particle system

1, Shuriken particle system

  In 3D games, most game objects can be in the form of meshes (mesh) to render. 2D game usually sprites (wizard) displays. For the game objects fixed shape, mesh and spirit indeed is ideal for visual presentation. But the game also need other elements or objects, their natural shape is not fixed, it is difficult to achieve with a mesh or elves.

  For example Storm lightning rain and fog, etc., these objects usually depends on the particle effects system to complete.

(1) What is the particle system

  Refers to a small particle system is very simple 2D image or a 3D mesh model. In the particle system, through a variety of settings so that tiny particles in a particular form displayed, on the formation of particle effects.

  In general, each particle has a predetermined life cycle. Usually set to a few seconds. During this time, the particle experience different changes.

(2) Shuriken particle system

  In 2012, Unity from 3.5 version began to support the Shuriken particle system. In Unity, the particle system is a form of components to achieve.

  Although there are many attributes particle system, but can be divided into three categories: the main module, the system of the particle particle system modules specific attributes, and the default texture and particle Shader .

2, Shader use

(1) What is Shader

  In computer graphics, Shader (shaders) refers to a computer program specific to the rendering colored, its role is provided an image light, and dark colors and the like. Shader usually extremely flexible rendered effect is calculated on the graphics hardware. Most Shader in encoding is directed to a graphics processing unit (GPU) is, Shader programming languages ​​typically used to write GPU rendering pipeline. Shader by predefined algorithm to dynamically modify the display position of the image pixel, vertex, texture elements, hue, saturation, brightness and contrast. In addition, it can also be based on external variables or texture by calling Shader way.

  In Unity, rendering the object of the game is through the material (Material), shader (Shader) and texture (Texture) jointly completed.

  Material for surface defining how the object is rendered, including texture mapping is used, the laying surface and color changes.

  The Unity shader actually coding a small fragment, which contains various algorithms and mathematical operations, and the role of material setting input light color and other attributes calculated for each pixel based.

  Texture mapping is actually a bitmap. The material may contain a reference to the texture, so the material used in texture mapping shaders can be used in the calculation of the surface color, in addition to presenting the basic surface color of the object, the texture can also be used to represent other materials, roughness such as reflection or the like.

Standard Shader (2) Unity of

  Unity standards Shader can be highly customized Shader, but also can be a good show the surface of various types.

  Unity standards Shader with a rich set of features specially rendered "real world" objects. Unity the standard shader Shader support various types and combinations, simply using different options and parameters to a texture in the material editor.

  Shader same standard incorporates advanced lighting model. Called physics-based rendering.

  When we use the standard Shader, a plurality of types of shader (e.g., Diffuse, Specular, Bumped Specular, Reflective, etc.) are integrated into a single shader can be used on all types of materials. The advantage of this method is calculated using the same lighting effect in all areas of the scene, which allows the use of all models have authentic Shader light and shade distribution.

 

Guess you like

Origin www.cnblogs.com/jiaxinli/p/11725504.html