Version: Unity 6 (6000.0)
Language : English
Include a shader pass with the UsePass command
Shader program fundamentals

Writing HLSL shader programs

Resources for writing HLSL shaderA program that runs on the GPU. More info
See in Glossary
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
Shader program fundamentals 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.
Duplicate HLSL in multiple programs Use the HLSLINCLUDE directive to add a block of HLSL code that the compiler duplicates in each shader program.
Shader input Resources for HLSL data types, using 16-bit precision, input vertex data, and texture samplers.
Include another HLSL file in a shader Use the HLSL #include directive, or the #include_with_pragmas directive if you want to share #pragma directives between multiple files.
Pass information to the shader compiler Use the #pragma or #define_for_platform_compiler directives to pass information to the shader compiler.
Writing shaders for different graphics APIs Write shaders to take into account how graphics rendering differs between different graphics APIs.
GLSL in Unity If a platform supports OpenGL Core and OpenGL ES, you can write OpenGL Shading Language (GLSL) shader programs in Unity.

Additional resources

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