Version: Unity 6.5 Alpha (6000.5)
Language : English
Include a shader pass with the UsePass command
Introduction to HLSL shader programs

Writing HLSL shader programs

Write High-Level ShaderA program that runs on the GPU. More info
See in Glossary
Language (HLSL) vertex and fragment shader programs inside a Pass block in a custom ShaderLabUnity’s language for defining the structure of Shader objects. More info
See in Glossary
shader.

Page Description
Introduction to HLSL shader programs Learn about writing shader programs in HLSL in Unity, and vertex and fragment shaders.
Add an HLSL shader program Use the HLSLPROGRAM directive to add a shader program to a shader pass.
Reuse HLSL code Include or duplicate HLSL in different places, or share #pragma directives across different shaders.
Input data into HLSL Create a struct that declares shader variables and connects them to the vertex data of the meshThe main graphics primitive of Unity. Meshes make up a large part of your 3D worlds. Unity supports triangulated or Quadrangulated polygon meshes. Nurbs, Nurms, Subdiv surfaces must be converted to polygons. More info
See in Glossary
.
Sample a texture in HLSL Declare and sample a texture in HLSL using a sampler.
Writing HLSL for different graphics APIs Write HLSL to take into account how graphics rendering differs between different graphics APIs.
Use 16-bit precision in shaders Use 16-bit precision in GPU calculations, so shaders use less memory, bandwidth, and power, and calculations are faster.
Pass information to the shader compiler Use the #define, #pragma, and #define_for_platform_compiler directives to pass information to the shader compiler.

Additional resources

Include a shader pass with the UsePass command
Introduction to HLSL shader programs
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961