A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Shaders' started by Zergling103, Jun 13, 2013.
What does UNITY_INITIALIZE_OUTPUT() do? I need the exact source for it. Thanks.
From HLSLSupport.cginc (found in [Unity Install Folder]/Data/CGIncludes) :
#define UNITY_INITIALIZE_OUTPUT(type,name) name = (type)0;
So, it does nothing unless the HLSL compiler is compiling.
In that case it sets its value to a typecasted zero. That way the compiler won't complain about uninitialized output values.
Ah, thanks. Now I know, hopefully this will be useful to someone else too.
The general resource is the built-in shaders, which are available at the top of the forum. Since 4.1 or so, the CGIncludes are in there as well, so you don't have to fish them out of your Unity install.