According to the classification of the rendering pipeline, Sharder can be divided into 3 categories:
1. Fixed FuncTIon Shader
The fixed function shader is a concrete expression of the fixed function rendering pipeline.
2. Surface shaders
There is a technology developed by U3D in Unity3D. UnTIy3D packs Shader's complexity for us, reducing the threshold for writing in shaders.
3, vertex shader and fragment shader
There are two components on the GPU: a programmable vertex processor and a programmable fragment processor. The vertex and fragment processors are separated into programmable units. The programmable vertex processor is a hardware unit that can run vertex programs with programmable fragments. The processor is a unit that can run fragment programs.
Vertex shader
The vertex shader extracts primitive information (vertex position, normal vector, and texture coordinates) from the GPU front end (register), and completes operations such as vertex coordinate space conversion, normal vector space conversion, and lighting calculation. Finally, the calculation data is transferred to the specified register. in.
Fragment shader
Fragment program obtains the necessary data from the above registers: texture coordinates and lighting information, etc., and performs color calculation (texture query) for each segment based on the information and texture information passed from the application, and finally transmits the processed data to the raster. Operation module.
Common to all three shaders:
• All must begin with a single root shader • The ProoerTIes parameter section has exactly the same role and syntax.
• The specific functionality is in SubShader.
• All can be labeled • Fallback is available
• Can handle basic functions such as diffuse reflection and specular reflection. However, fixed function shaders cannot be completed with advanced functions such as uv calculation effects.
The difference between the three shaders
• The surface shader does not have a pass pass}, and an error is reported when it is added. The shader has already packaged the content in the lighting model.
• There is no ";" after every code in the fixed rendering pipeline
• Different core structures:
- The core of a fixed rendering pipeline is:
Material{} and SetTexture[_MainTex]{}
- The core of vertex and fragment shaders is:
CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" ENDCG
- The core of the surface shader is:
1. The surface shader uses Unity3D's own illumination model Lambert. It does not do vertex processing. It only needs a surface function surf. CGPROGRAM #Pragma surface surf Lambert ENDCF 2. This set of representations uses the lighting model lsyLightModel that you wrote and uses the vertex processing function vert CGPROGRAM #pragma surface surf lsyLightModel vertex:vert ENDCG
How to distinguish the above three shaders in Unity
• There is no nested CG language, that is, there is no CGPROGARAM and ENDCG keyword in the code, which is a fixed function shader.
• Nested CG language, surface shader with surf function in code • nested CG language, vertex shader & fragment shader with #pragma vertex name and #pragma fragment frag in the code.
GALOCE various kinds range of strain gage static torquemeters, allowing to measure in the two directions from ± 0.1 Nm up to ± 5000 Nm with high accuracies (1%). Using standard din flanges. This torque sensors are usually used for measuring tightening torques, verify and calibrate screw driving systems and dynamometric torque wrenches. Click here, if you are interested in Dynamic Torque Sensor.
Static Torque Sensor,Static Torque Transducer,Torque Measurement Sensor,rotary torque sensor
GALOCE (XI'AN) M&C TECHNOLOGY CO., LTD. , https://www.galoce-meas.com