Search Issue Tracker
Fixed in 2017.1.0f3
Votes
0
Found in
5.6.0f3
Issue ID
898067
Regression
Yes
Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)' faulty replacement breaking shader
Steps reproduce:
1. Open attached project
2. Open ShadowMeta.cginc
3. Replace UnityObjectToClipPos(pos4) to mul(UNITY_MATRIX_MVP, pos4)
4. Save script
5. Notice that mul(UNITY_MATRIX_MVP, pos4) is upgraded to UnityObjectToClipPos(pos4)
Expected result: mul(UNITY_MATRIX_MVP, pos4) should not be replaced with UnityObjectToClipPos(pos4)
Reproduced in: 2017.1.0a6, 5.6.0f3, 5.6.0f2
Not reproduced in: 5.6.0f1, 5.6.0b11, 5.6.0b1 ,5.6.0a1, 5.5.3f1
Regression since: 5.6.0f2
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
- Red spots appear when Blending Lighting Scenarios using Adaptive Probe Volumes
- [Windows] About Unity Window needs to be opened twice to adapt to resolution
- NullReferenceException and temporary graph corruption after entering playmode if output node connection was changed
- Sprite Renderer with Animation does not reflect Sprite changes in the Scene when switching Mask Interaction
- User is redirected to a non-existing online documentation link when clicking on "?" help button inside Inspector window while Animator Override Controller is selected
toolparaphrase
Jan 12, 2020 18:37
It prevents unity from fixing the shader because you are the dev, so you are the one who fix the bugs
https://seotoolcheckers.com/what-is-my-browser
https://seotoolcheckers.com/mozrank-checker
https://articlespinner.rewriter-tool.com/
https://paraphrase.tools/
https://seotoolcheckers.com/get-source-code-of-webpage
farrukhnawaz
Oct 24, 2019 13:12
It prevents unity from fixing the shader because you are the dev, so you are the one who fix the bugs
https://afashionz.com/kashees-artist-chaand-raat-eid-mehandi-designs/
https://awampk.com/prime-minister-apna-ghar-housing-scheme-forms/
https://mobiledady.com/pakistani-flag/
farrukhnawaz
Jul 28, 2019 05:37
I have 5.5.0 and i get this error when i follow the survival shooter tutorial made by unity. It happened when i switched the camera to orthographic mode.
https://mobilefone.pk/brand/oppo/
lshinamashiro_unity
May 23, 2018 07:18
#define UNITY_SHADER_NO_UPGRADE 1
that is a grate idea
cfazilleau
Apr 06, 2018 14:36
marked fixed but broken again on 2017.3.1f1
I fixed it by placing
#define UNITY_SHADER_NO_UPGRADE 1
at the beginning of the shader.
It prevents unity from fixing the shader because you are the dev, so you are the one who fix the bugs
rtilton1
Dec 14, 2017 05:57
Also seeing this issue in 2017.2
andybak
Nov 20, 2017 12:58
Still broken in 2017.2
Try opening this: https://github.com/mattatz/unity-photo-particle-system
and look at the error for either the billboard or butterfly shaders.
toddw
Sep 11, 2017 18:20
There's a better way to fix this than SK_AVARITIA's suggestion. Simply replace all lines that were converted to this:
o.position = UnityObjectToClipPos(v.position);
with this:
o.position = UnityObjectToClipPos(float4(v.position.xyz, 1.0));
The compiler won't attempt to replace it again and it works fine for me.
pigshape
Jun 23, 2017 11:33
@SK_AVARITIA
It worked great for me!!Thanks!
sk_avaritia
Jun 16, 2017 20:00
I used "UNITY_VERSION" and "UNITY_SHADER_NO_UPGRADE" then my code worked.
I hope that I will be helpful for everyone.
[before]
o.vertex = UnityObjectToClipPos(v.vertex);
[after]
#if UNITY_VERSION >= 560
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
#else
#if UNITY_SHADER_NO_UPGRADE
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
#endif
#endif