由编辑器在编译着色器时根据目标平台和层设置的定义。
UNITY_NO_DXT5nm | 在为不支持 DXT5NM 的平台(这意味着法线贴图将改为以 RGB 编码)编译着色器时,设置 UNITY_NO_DXT5nm。 |
UNITY_NO_RGBM | 在为不支持 RGBM 的平台(将改用 dLDR)编译着色器时,设置 UNITY_NO_RGBM。 |
UNITY_ENABLE_REFLECTION_BUFFERS | 当延迟着色渲染反射探针处于延迟模式时,设置 UNITY_ENABLE_REFLECTION_BUFFERS。设置此选项后,反射渲染进逐像素缓冲区中。这与光线渲染进逐像素缓冲区中的方式类似。使用延迟着色时,UNITY_ENABLE_REFLECTION_BUFFERS 默认开启,不过,通过在 Graphics Settings 中将“Deferred Reflections”着色器选项设置为“No support”可以将其关闭。此设置关闭后,反射探针逐对象渲染,与前向渲染的工作方式类似。 |
UNITY_FRAMEBUFFER_FETCH_AVAILABLE | 在为帧缓冲提取可能可用的平台编译着色器时,设置 UNITY_FRAMEBUFFER_FETCH_AVAILABLE。 |
UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS | UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS 允许在 OpenGL ES 2.0 上使用内置阴影比较采样器。 |
UNITY_METAL_SHADOWS_USE_POINT_FILTERING | 在阴影采样器应在 iOS Metal 上使用点过滤时,设置 UNITY_METAL_SHADOWS_USE_POINT_FILTERING。 |
UNITY_NO_SCREENSPACE_SHADOWS | 在屏幕空间级联阴影贴图禁用时,设置 UNITY_NO_SCREENSPACE_SHADOWS。 |
UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS | 在启用了 Semitransparent Shadows 时,设置 UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS。 |
UNITY_PBS_USE_BRDF1 | 在应使用标准着色器 BRDF1 时,设置 UNITY_PBS_USE_BRDF1。 |
UNITY_PBS_USE_BRDF2 | 在应使用标准着色器 BRDF2 时,设置 UNITY_PBS_USE_BRDF2。 |
UNITY_PBS_USE_BRDF3 | 在应使用标准着色器 BRDF3 时,设置 UNITY_PBS_USE_BRDF3。 |
UNITY_NO_FULL_STANDARD_SHADER | 在应使用具有额外简化的标准着色器 BRDF3 时,设置 UNITY_NO_FULL_STANDARD_SHADER。 |
UNITY_SPECCUBE_BOX_PROJECTION | 在启用了 Reflection Probes Box Projection 时,设置 UNITY_SPECCUBE_BLENDING。 |
UNITY_SPECCUBE_BLENDING | 在启用了 Reflection Probes Blending 时,设置 UNITY_SPECCUBE_BLENDING。 |
UNITY_ENABLE_DETAIL_NORMALMAP | 如果在分配时应该对细节法线贴图进行采样,则设置 UNITY_ENABLE_DETAIL_NORMALMAP。 |
SHADER_API_MOBILE | 在为移动平台编译着色器时,设置 SHADER_API_MOBILE。 |
SHADER_API_DESKTOP | 在为“desktop”平台编译着色器时,设置 SHADER_API_DESKTOP。 |
UNITY_HARDWARE_TIER1 | 在为 GraphicsTier.Tier1 编译着色器时,设置 UNITY_HARDWARE_TIER1。 |
UNITY_HARDWARE_TIER2 | 在为 GraphicsTier.Tier2 编译着色器时,设置 UNITY_HARDWARE_TIER2。 |
UNITY_HARDWARE_TIER3 | 在为 GraphicsTier.Tier3 编译着色器时,设置 UNITY_HARDWARE_TIER3。 |
UNITY_COLORSPACE_GAMMA | 在为伽马颜色空间编译着色器时,设置 UNITY_COLORSPACE_GAMMA。 |
UNITY_LIGHT_PROBE_PROXY_VOLUME | 在当前图形 API 支持 Light Probe Proxy Volume 功能并且在当前 Tier Settings(Graphics Settings) 中启用了该功能时,设置 UNITY_LIGHT_PROBE_PROXY_VOLUME。 |
UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS | 对于片元着色器中不需要完全浮点精度支持的平台,会自动设置 UNITY_HALF_PRECISION_FRAGMENT_SHADER_REGISTERS。 |
UNITY_LIGHTMAP_DLDR_ENCODING | 在光照贴图纹理使用双 LDR 编码存储纹理中的值时,设置 UNITY_LIGHTMAP_DLDR_ENCODING。 |
UNITY_LIGHTMAP_RGBM_ENCODING | 在光照贴图纹理使用 RGBM 编码存储纹理中的值时,设置 UNITY_LIGHTMAP_RGBM_ENCODING。 |
UNITY_LIGHTMAP_FULL_HDR | 在光照贴图纹理不使用任何编码存储纹理中的值时,设置 UNITY_LIGHTMAP_FULL_HDR。 |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.