enumeration
Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.
CloseFor some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.
CloseDefines set by editor when compiling shaders, based on the target platform and GraphicsTier.
Additional resources: GraphicsSettings.HasShaderDefine.
UNITY_NO_DXT5nm | UNITY_NO_DXT5nm is set when compiling shader for platform that do not support DXT5NM, meaning that normal maps will be encoded in RGB instead. |
UNITY_NO_RGBM | UNITY_NO_RGBM is set when compiling shader for platform that do not support RGBM, so dLDR will be used instead. |
UNITY_ENABLE_REFLECTION_BUFFERS | UNITY_ENABLE_REFLECTION_BUFFERS is set when deferred shading renders reflection probes in deferred mode. With this option set reflections are rendered into a per-pixel buffer. This is similar to the way lights are rendered into a per-pixel buffer. UNITY_ENABLE_REFLECTION_BUFFERS is on by default when using deferred shading, but you can turn it off by setting “No support” for the Deferred Reflections shader option in Graphics Settings. When the setting is off, reflection probes are rendered per-object, similar to the way forward rendering works. |
UNITY_FRAMEBUFFER_FETCH_AVAILABLE | UNITY_FRAMEBUFFER_FETCH_AVAILABLE is set when compiling shaders for platforms where framebuffer fetch is potentially available. |
UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS | UNITY_ENABLE_NATIVE_SHADOW_LOOKUPS enables use of built-in shadow comparison samplers on OpenGL ES 2.0. |
UNITY_METAL_SHADOWS_USE_POINT_FILTERING | UNITY_METAL_SHADOWS_USE_POINT_FILTERING is set if shadow sampler should use point filtering on iOS Metal. |
UNITY_NO_SCREENSPACE_SHADOWS | UNITY_NO_SCREENSPACE_SHADOWS is set when screenspace cascaded shadow maps are disabled. |
UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS | UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS is set when Semitransparent Shadows are enabled. |
UNITY_PBS_USE_BRDF1 | UNITY_PBS_USE_BRDF1 is set if Standard Shader BRDF1 should be used. |
UNITY_PBS_USE_BRDF2 | UNITY_PBS_USE_BRDF2 is set if Standard Shader BRDF2 should be used. |
UNITY_PBS_USE_BRDF3 | UNITY_PBS_USE_BRDF3 is set if Standard Shader BRDF3 should be used. |
UNITY_SPECCUBE_BOX_PROJECTION | UNITY_SPECCUBE_BLENDING is set if Reflection Probes Box Projection is enabled. |
UNITY_SPECCUBE_BLENDING | UNITY_SPECCUBE_BLENDING is set if Reflection Probes Blending is enabled. |
UNITY_ENABLE_DETAIL_NORMALMAP | UNITY_ENABLE_DETAIL_NORMALMAP is set if Detail Normal Map should be sampled if assigned. |
SHADER_API_MOBILE | SHADER_API_MOBILE is set when compiling shader for mobile platforms. |
SHADER_API_DESKTOP | SHADER_API_DESKTOP is set when compiling shader for "desktop" platforms. |
UNITY_HARDWARE_TIER1 | UNITY_HARDWARE_TIER1 is set when compiling shaders for GraphicsTier.Tier1. |
UNITY_HARDWARE_TIER2 | UNITY_HARDWARE_TIER2 is set when compiling shaders for GraphicsTier.Tier2. |
UNITY_HARDWARE_TIER3 | UNITY_HARDWARE_TIER3 is set when compiling shaders for GraphicsTier.Tier3. |
UNITY_COLORSPACE_GAMMA | UNITY_COLORSPACE_GAMMA is set when compiling shaders for Gamma Color Space. |
UNITY_LIGHT_PROBE_PROXY_VOLUME | UNITY_LIGHT_PROBE_PROXY_VOLUME is set when Light Probe Proxy Volume feature is supported by the current graphics API and is enabled in the Graphics Tier settings. You can only set a Graphics Tier in the Built-in Render Pipeline. |
UNITY_LIGHTMAP_DLDR_ENCODING | UNITY_LIGHTMAP_DLDR_ENCODING is set when lightmap textures are using double LDR encoding to store the values in the texture. |
UNITY_LIGHTMAP_RGBM_ENCODING | UNITY_LIGHTMAP_RGBM_ENCODING is set when lightmap textures are using RGBM encoding to store the values in the texture. |
UNITY_LIGHTMAP_FULL_HDR | UNITY_LIGHTMAP_FULL_HDR is set when lightmap textures are not using any encoding to store the values in the texture. |
UNITY_VIRTUAL_TEXTURING | Is virtual texturing enabled and supported on this platform. |
UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION | Unity enables UNITY_PRETRANSFORM_TO_DISPLAY_ORIENTATION when Vulkan pre-transform is enabled and supported on the target build platform. |
UNITY_ASTC_NORMALMAP_ENCODING | Unity enables UNITY_ASTC_NORMALMAP_ENCODING when DXT5nm-style normal maps are used on Android, iOS or tvOS. |
SHADER_API_GLES30 | SHADER_API_ES30 is set when the Graphics API is OpenGL ES 3 and the minimum supported OpenGL ES 3 version is OpenGL ES 3.0. |
UNITY_UNIFIED_SHADER_PRECISION_MODEL | Unity sets UNITY_UNIFIED_SHADER_PRECISION_MODEL if, in Player Settings, you set Shader Precision Model to Unified. |
UNITY_PLATFORM_SUPPORTS_WAVE_32 | Unity sets UNITY_PLATFORM_SUPPORTS_WAVE_32 when the target platform is known to support wave-level shader operations with a wave size of 32. |
UNITY_PLATFORM_SUPPORTS_WAVE_64 | Unity sets UNITY_PLATFORM_SUPPORTS_WAVE_64 when the target platform is known to support wave-level shader operations with a wave size of 64. |
UNITY_NEEDS_RENDERPASS_FBFETCH_FALLBACK | UNITY_NEEDS_RENDERPASS_FBFETCH_FALLBACK is set when we need to generate a fallback for RenderPass due to the possibility of not having framebuffer fetch |
UNITY_PLATFORM_SUPPORTS_DEPTH_FETCH | UNITY_PLATFORM_SUPPORTS_DEPTH_FETCH is set if RenderPass can use its depth attachment as input. |
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.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.