Overall, performance from high to Low:
- unlit, only textures, light does not produce effects
- Vertexlit
- Diffuse diffuse reflection
- Normal Mapped normal map
- Specular High-Gloss
- Normal Mapped Specular
- Parallax Normal Mapped
- Parallax Normal Mapped Specular
In addition, Unity3d has some simplified shader/shaders for use as a mobile platform.
Recommended article built-in shader detailed (with diagram)
Shader Performance Impact factors:
There are many factors affecting the performance of shaders, the most important are two:
- Shader itself
- Rendering Paths (render path?) )
Two built-in shaders with the best performance:
- Deffered Shader
- Vertex Lit
Only once, performance depends only on the number of textures.
In forward rendering path:
Performance depends only on the shader itself and the light source in the scene.
- Pixel Lit performance is worse, better results, multiple draw, it can be achieved (shadow, normal, highlight, etc.)
- Vertex Lit performance is better, all light effects are plotted only once
Popular understanding of built-in shader (RPM):
1.vertex-lit:
Based on: Vertex computing-based illumination model
Cube: "Direct exposure to the place will not be very bright" "light exposure to the plane no effect"
Round: "Direct exposure to the place is very bright" "light does not reach the place has a high light effect"
Support: Device automatically selects "Programmable pipeline" and "fixed pipeline"
Parameters: "Primary color" "Speccolor Light Color" "Emissivecolor self-luminous color" "Shininess light Intensity"
Rendering cost: Relatively small
2.Diffuse:
Based on: Lambertian of light model based on simple
Cube: "Direct exposure to the place will be very bright" "light can not be photographed in the plane no effect"
Round: "Direct exposure to the place is very bright" "light is not exposed to the place no effect"
Support: Device needs to support "programmable pipeline" if not supported will automatically use "Vertex-lit"
Parameters: "Primary color Color"
Rendering cost: Relatively small
3.Specular
Based on: The same illumination model as diffuse, which has an observation angle-related specular highlights (#pragmasurface surf Blinnphong)
Square: "The direct exposure to the place will be very bright" "light can not be photographed in the plane without effect" "observation angle and light incident angle will produce reflected light"
Round: "Direct exposure to the place is very bright" "light is not exposed to the place without effect" "observation angle and light incident angle will produce reflected light"
Support: Device needs to support "programmable pipeline" if not supported will automatically use "Vertex-lit"
Parameters: "Primary Color" "Specularcolor Reflected Light color" "shininess reflected light intensity"
Rendering cost: Larger than
4.Bumped Diffuse
Based on: and diffuse the same illumination model, while using the normal map normalmapping technology (unpacknormal) "grayscale, white means concave, black means recessed"
Square: Like "diffuse", "more bump Feeling"
Round: Like "diffuse", "more bump Feeling"
Support: "Diffuse" will be used automatically if the device is not supported
Parameters: "Main Color" "More normal map"
Rendering cost: Larger than
5.Bumped Specular Bump Reflection
Merger of "bumped diffuse" and "specular"
Support: If the device is not supported, "specular" will be used
6.Parallax Diffuse
Based on: Lambertian with the same lighting model as Bumpeddiffuse, normalmapping Technology (unpacknormal) is used, and Heightmap (Parallaxoffset)
Now more realistic bump sense "height map in the normal map of the alpha channel preservation, All black means height, white indicates high and low"
Support: Device is not available, will automatically use "Bumpeddiffuse"
Parameters: "Primary Color" "More normal map" "More height Map" "Height set height parameter"
Rendering cost: Larger than "bumped diffuse"
7.Parallax Specular
Based on: using "bumpedspecular" + "Height chart"
Support: Device is not available, will automatically use "Bumpedspecular"
8.Decal "Decal"
Based on: Lambert with diffuse, add second poster, then blend color (lerp) over main texture "Note: Diffusdetail Fusion is Rgb*rgb"
Support: Device needs to support "programmable pipeline" if not supported will automatically use "Vertex-lit"
Parameters: "Main Color" "two posts"
9.Diffuse Detail "Detail map"
Based on: As with diffuse based on Lambert, more than a map with the fusion (RGB*RGB), generally used for the terrain, the camera closer to the additional details will appear.
Description: The Detail texture is overlaid on top of the main texture. A darker part of the Detail texture will darken the winner's texture, while the tint will lighten the main texture, Detail
is usually light gray. (unlike the Decal texture inside the Decal, the Decal texture is RGBA, which controls the fusion of Decaltexture and Main Texture through alpha, while detail
The texture is RGB, directly the two textures of the RGB channel multiplied by the * *, that is, the detail texture color value = 0.5 will not change the main texture color, >0.5 will lighten, <0.5 deepened)
Reference
Reference article shader example (v) How to better apply shader in Unity
Reference documentation Usage and performance of built-in Shaders
Unity3d Shader Performance Ranking