Search Issue Tracker

Fixed in Unity 5.5.0

Votes

61

Found in

5.0.1f1

Issue ID

686520

Regression

Yes

Shadow moves in relation to the object that casts it when using a custom projection matrix

Shadows/Lights

-

-

Priority: 2Necessary for shipping a final release

-

Severity: 0Severity not yet defined

Reproduction steps:
1. Open the attached project "ShadowProjection 5.0"
2. Open the scene "Scene"
3. Select the camera and change it's "Oblique" value
4. In the game view notice when you change the "Oblique" value the shadows will move relative to the objects that cast them (see Oblique.gif)
5. Open the project "ShadowProjection 4.6.3p3.zip" in Unity 4.6
6. Open the scene "Scene"
7. Select the camera and change it's "Oblique" value
8. Notice that the shadow stays in its place

Comments (20)

  1. 1c26c942b1cde8cfbf89322f41823d80?d=mm

    monark

    Nov 10, 2016 13:46

    This is a very bad solution only supporting 5.4 means it can't be ported into Webplayer builds as 5.4 no long supports that pipeline.

  2. Ed6a318d0c81336cd4b02cf6d6ea7e05?d=mm

    Zema

    Aug 10, 2016 20:23

    So after testing the posted solution with Unity 5.4.1 and my custom projection setup in deferred rendering, I have observed that this will only work for a shadows from a Directional Light(s).
    Having a single Point or Spot light will still result in the same behaviour for any shadows cast by these lights.

    How can I go about solving this for non-screen space shadows like those rendered from positional lights and derived from AutoLight.cginc

  3. D801836441b4c0439b84c52187d32704?d=mm

    fguinier

    Feb 23, 2016 06:59

    Hi All,

    To deliver the fix faster we have decided to deliver it as a unity package ->

    To do so please:
    * Download http://files.unity3d.com/florent/Fixes/FixFor686520_ScreenSpaceShadow.unitypackage
    * Import the package into your beloved 5.4 Unity project.
    * Attach the ReplaceScreenSpaceShadowsShader script to the camera using a custom perspective matrice.

    PS : BuiltinShaderType.ScreenSpaceShadows was not exposed in yet in Unity 5.3. Please upgrade to Unity 5.4 if you need this fix.

    As a consequence the fix wont be ported to unity 5.3/5.4, it will be fixed engine side starting from unity 5.5 (and we will probably ship that version with a better fix especially in term of performance)

    Have a good day!

    Florent

  4. 6fa0af40abc327982287802268f3d468?d=mm

    Art Leaping

    Feb 18, 2016 19:54

    Excellent news! Will it be in one of the 5.4 betas prior to release? Would be good for at least pro users to have the chance to test it with their individual cases before it's declared solved.

  5. D801836441b4c0439b84c52187d32704?d=mm

    fguinier

    Feb 18, 2016 14:02

    Hi All,
    Just to let you know that a fix is on its way (being validated atm). The goal is to have it included to 5.3 and 5.4 release.

    Have a good day

    Florent

  6. 6fa0af40abc327982287802268f3d468?d=mm

    Art Leaping

    Feb 15, 2016 22:36

    Hi Karl,

    This issue has not been resolved in 5.4 - I just tested it.

    See example here: http://artleaping.com/off_site_hosting/randomstuff/ProjectionMatrixShadowIssue.gif

    If you need me to provide a sample project, I can do so.

    Thanks!

  7. B69218c3d2aeb4bd89a80a310b080c64?d=mm

    jpfranssen

    Jan 25, 2016 21:53

    Added my vote too, @Karl.Jones any news/patches/workarounds? This issue is unfortunately stopping us to move to Unity5 :-(

  8. 5a3b578403f8b635d8a32d865a2c1173?d=mm

    matpow2

    Jan 07, 2016 15:15

    It would be nice if this issue could be reopened, since it hasn't been fixed in 5.3.1 yet (including any of the patch releases).

    For anyone experiencing this issue, there's been some recent discussion in this thread:
    http://forum.unity3d.com/threads/shadows-with-custom-projection-matrix-still-broken-in-5-3-0f4.372623/

  9. E8ad69406a99c92230571461d974b0f1?d=mm

    Alkann

    Dec 21, 2015 09:48

    Release notes for 5.3.1 http://unity3d.com/unity/whats-new/unity-5.3.1
    say that this issue has been fixed so I downloaded it but no changes.

  10. Dc1b254760f44d16cd4f684456bf554f?d=mm

    karl_jones

    Dec 09, 2015 12:35

    The fix is not in 5.3, it went into 5.4. We will get it backported to a patch release. Keep an eye on the patch notes.

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.