Search Issue Tracker
Fixed in 2017.1.0f3
Fixed in 2017.2.X
Votes
0
Found in
2017.1.0b10
Issue ID
924464
Regression
No
Incorrect definition of _ShadowCoord in AutoLight.cginc
In AutoLight.cginc, _ShadowCoord is defined in some cases where it is not needed. This results in a useless interpolator. It can also lead to unexpected compile errors if UNITY_INITIALIZE_OUTPUT is not used to initialize the interpolator struct. Usage of UNITY_INITIALIZE_OUTPUT in Unity's shaders hides this bug.
The definition is on line 116. Here are lines 115-117:
#else
# define UNITY_SHADOW_COORDS(idx1) unityShadowCoord2 _ShadowCoord : TEXCOORD##idx1;
# if defined(SHADOWS_SHADOWMASK)
The line should be moved inside the defined(SHADOWS_SHADOWMASK) block below it. So lines 115-117 become:
#else
#if defined(SHADOWS_SHADOWMASK)
#define UNITY_SHADOW_COORDS(idx1) unityShadowCoord2 _ShadowCoord : TEXCOORD##idx1;
Reproduced with: 5.6.2p1, 2017.1.0f1, 2017.2.0b1
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UI Overlay Image gets darker on each Camera when multiple Cameras are used
- Assertion failed on expression: 'scriptedImporterClass == SCRIPTING_NULL error when opening the standalone profiler window
- Disabled assets in Import Unity Package window aren't tracked but count as being selected by user
- [Windows] Crash on GetManagerFromContext when video is playing and creating High Definition 3D Projects after FMOD failed to switch back to normal output Error appeared
- GC Alloc produced when adding items to MultiColumnListView with Auto Assign Binding
shubhamswaraj2021
Aug 19, 2020 05:32
good one <a href="https://www.lyricsauto.com">lyricsauto</a>
xZeroCoolx
Jan 18, 2018 19:19
I can still reproduce this bug in Unity 2017.3.0f3 with the following custom shader:
https://pastebin.com/Htg5p0EP
Can be fixed by using UNITY_INITIALIZE_OUTPUT macro in the vertex shader.